Skip to content

feat(acp,tui): native /compact forwarding and session branching via ACP session/fork#525

Open
CSRessel wants to merge 3 commits into
mainfrom
acp-native-compact-and-fork
Open

feat(acp,tui): native /compact forwarding and session branching via ACP session/fork#525
CSRessel wants to merge 3 commits into
mainfrom
acp-native-compact-and-fork

Conversation

@CSRessel

@CSRessel CSRessel commented Jul 4, 2026

Copy link
Copy Markdown
Collaborator

Summary

🤖 Generated with Nori

  • Native compact: when the agent advertises a compact slash command (claude-agent-acp and codex-acp both do), /compact now forwards the agent's own command in the current session — no session swap, no summary re-injection. The custom summarize-and-swap flow remains as the fallback for agents without native compaction. A cancelled compaction (either path) is no longer recorded as one.
  • Session branching: new "⎇ Branch from current point" entry in the /fork picker forks the session at its head via the unstable ACP session/fork (capability-gated per agent; clear error when unsupported, e.g. codex/gemini adapters today). The original session stays resumable; transcript resume follows the fork. Rewind-to-a-message stays the local summary fork until fork-at-message lands upstream (ACP PR #629). Deliberately a single /fork command — no /branch//rewind aliases.
  • Shared session-replacement machinery (MCP reassembly, nori-client re-registration, capability rebroadcast) extracted into backend/session_replace.rs; also fixes an ETXTBSY flake in the script-agent connection tests.

Known follow-ups (deliberately out of scope): gate/dim the picker's branch entry on the fork capability instead of post-selection error; pre-existing stale-transcript-id on the compact-fallback swap; evaluate @agentclientprotocol/codex-acp as successor adapter.

Test Plan

  • 7 new integration tests against mock-acp-agent (native forward, fallback regression, cancel semantics ×2, fork swap, capability error, fork config capture) + loader test for branched-transcript resume
  • Full workspace cargo test green; tui-pty-e2e green; insta snapshot for the picker
  • Live TUI drive (elizacp): picker renders branch entry; unsupported agent surfaces "does not support branching"

Share Nori with your team: https://www.npmjs.com/package/nori-skillsets

CSRessel added 2 commits July 3, 2026 20:56
…ssion/fork

When the agent advertises a compact command, /compact now forwards it
in-session (no session swap, no summary injection); the custom
summarize-and-swap path remains as fallback. New /fork picker entry
branches at the current point via the unstable ACP session/fork,
capability-gated per agent; rewind-to-message stays local. Shared
session-replacement machinery extracted into backend/session_replace.rs.
Also fixes an ETXTBSY flake in script-agent connection tests.
- Transcript loader now prefers the last recorded SessionBranched id so
  resuming a branched transcript targets the forked session
- Cancelled fallback compaction no longer captures a truncated summary
  or replaces the session (same EndTurn invariant as native compact)
- Branch busy-error wording covers loads, not just turns
- /fork picker opens with the branch entry even with no user messages
@cursor

cursor Bot commented Jul 4, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

…scoped ignores)

New RustSec advisories landed upstream and fail cargo-deny on any fresh
run (main included). anyhow 1.0.100->1.0.103 fixes RUSTSEC-2026-0190;
quick-xml 0.38.0->0.38.4 stays current though no in-range fix exists yet
for RUSTSEC-2026-0194/0195 (trusted-input paths only: wayland-scanner
build-time XML, syntect bundled themes) so those are ignored with
reasons, as is RUSTSEC-2026-0189 (rmcp Streamable HTTP *server*
transport; this codebase is client-only, loopback server is axum).
@cursor

cursor Bot commented Jul 4, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant