Skip to content

wip refactor: fold agent sessions on the backend only - #5570

Draft
ehayes2000 wants to merge 16 commits into
new-ai-agentsfrom
claude/acp-fold-backend-migration-qc0j64
Draft

wip refactor: fold agent sessions on the backend only#5570
ehayes2000 wants to merge 16 commits into
new-ai-agentsfrom
claude/acp-fold-backend-migration-qc0j64

Conversation

@ehayes2000

Copy link
Copy Markdown
Contributor

Rip out the wasm/browser half of the fold. The server already ran a fold machine per live session to keep placeholder rows in step; it is now also the only fold anywhere:

  • GET /agent-sessions/channel/{id}/messages returns the folded messages (with the session bot, and answering empty rather than 404 for channels without a session). The raw-log endpoint is gone.
  • The realtime path publishes the folded message each frame changed (agent_session_message: kind new/update + the whole message) instead of raw ACP frames. Frames that change nothing renderable publish nothing.
  • Snapshot/stream alignment is a counter instead of content comparison: the snapshot carries logLength (frames folded), every event carries logIndex, and a reader drops events with logIndex <= logLength. This replaces the client-side buffered-frame overlap alignment entirely.
  • agent_session gains a wire module: one serializable shape for folded messages, shared by the REST endpoint and the websocket event so the two cannot drift.

agent_fold loses its wasm inbound module, cdylib crate type, wasm dependencies and the cli feature split; agent_runtime_protocol loses its transport feature split; the hakari exclusions and workspace-hack memberships for the fold's dependency chain are restored.

The web app no longer folds: the worker, wasm module, hand-written types and the fold stream client are deleted. Channels fetch the folded snapshot and upsert websocket events into a reactive store keyed by agentSessionMessageId. Placeholder-row synthesis (and adoption by the real row) stays, as does hiding duplicate prompts.

@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Ignore keyword(s) in the title.

⛔ Ignored keywords (3)
  • WIP
  • DO NOT MERGE
  • wip

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 9cd7d70e-2278-4934-b9ff-8cc60805d176

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Aug 11, 2026

Copy link
Copy Markdown

@ehayes2000
ehayes2000 force-pushed the claude/acp-fold-backend-migration-qc0j64 branch from a63f4ce to 50cf0b4 Compare August 11, 2026 20:46
@ehayes2000
ehayes2000 force-pushed the claude/acp-fold-backend-migration-qc0j64 branch from 50cf0b4 to 9965314 Compare August 11, 2026 20:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants