Skip to content

feat(acp): support native session forks - #85

Merged
danielkov merged 4 commits into
mainfrom
feat/native-acp-session-fork
Sep 2, 2026
Merged

feat(acp): support native session forks#85
danielkov merged 4 commits into
mainfrom
feat/native-acp-session-fork

Conversation

@danielkov

Copy link
Copy Markdown
Contributor

Summary

Adds native ACP session/fork routing for harnesses that advertise the capability while retaining a safe transcript-cloning fallback. Fork copies discard session-bound provider state without modifying the source transcript.

Motivation

Fallback forks could copy OpenAI continuation metadata bound to the source session, causing Responses continuation metadata binding is invalid. Kit also did not expose the native fork operation already available in the ACP protocol.

Impact

Kit-backed ACP subagent forks can share one ACP process while preserving independent durable session identities and inherited model settings. Cancelling or timing out a fork leaves the source and sibling sessions usable, and branches rebuild provider continuation state on their next response.

Technical details

Fork-safe transcripts

Fork copies remove openai.responses.continuation.v1, openai.subscription.v1, and generated assistant media. The source transcript remains untouched.

Session lifecycle

Native forks are claimed and activated as durable sessions, inherit source model and reasoning-effort selection, and carry parent context for nested subagent reporting. Late fork responses are closed instead of orphaned, and per-session close cleans up descendants without terminating the shared ACP process.

Compatibility

Harnesses without native fork support continue to use sanitized transcript cloning.

@kit-code-agent kit-code-agent Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found two lifecycle issues in the native fork path: failed attachment can leave an unreachable durable session, and failed close can leave descendant state visible after its parent is removed.

Comment thread src/runtime.rs
Comment thread src/acp_child.rs Outdated
@danielkov
danielkov force-pushed the feat/native-acp-session-fork branch from 534bf01 to 85c05af Compare September 2, 2026 14:13

@kit-code-agent kit-code-agent Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The two prior lifecycle findings are addressed. One new limited roster-lifecycle issue remains in the descendant tombstone handling.

Comment thread src/tui/app.rs Outdated
@danielkov
danielkov enabled auto-merge (squash) September 2, 2026 14:49

@kit-code-agent kit-code-agent Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found. The changes look good to merge.

@danielkov
danielkov merged commit c4dd8ae into main Sep 2, 2026
3 checks passed
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