Skip to content

feat(acp): migrate subagent observation to ACP sessions - #315

Merged
danielkov merged 6 commits into
mainfrom
feat/acp-subagent-sessions
Oct 30, 2026
Merged

danielkov merged 6 commits into
mainfrom
feat/acp-subagent-sessions

Conversation

@danielkov

@danielkov danielkov commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Replace Kit’s private subagent transcript polling with ACP subagent session announcements and same-connection event streams in both protocol versions, the TUI, and the macOS desktop client. Preserve generation-checked child steering as an explicitly advertised Kit extension.

Impact

kit/subagent/transcript/read is removed; clients must consume ACP child-session updates. Child cancellation is not advertised because the runtime cannot yet cancel one generation without destroying its reusable session.

Technical details

Ownership and replay

Announce ancestors before nested child traffic, keep child identity stable across assignments, and route directed messages by enclosing session. Retain bounded best-effort history, distinguish explicit replay from no-history resume, and revoke cached mutation grants on reconnection. Project compatible child events for v1 without letting unsupported events terminate forwarding.

Published dependencies

Use registry releases of ACP SDK/HTTP 3.6.0, schema 1.14.0, and AgentKit ACP 0.12.0, replacing all temporary Git patches. Explicitly enable SDK stdio while preserving injection and bounded HTTP behavior. Keep the audited wasm-bindgen 0.2.128 family and SDK-required libc 0.2.189 pin; newer held releases are not adopted.

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Found issues with directed-message clearing, child lifecycle reconciliation, and v1 state/reasoning projection.

Took 29 min

Comment thread src/acp_child/stream.rs Resolved
Comment thread src/tui/app/subagent_sessions.rs Resolved
Comment thread src/protocols/acp/subagents.rs Resolved
Comment thread src/protocols/acp/subagents.rs Resolved
@danielkov danielkov changed the title feat(acp)!: migrate subagent observation to ACP sessions feat(acp): migrate subagent observation to ACP sessions Oct 30, 2026
@danielkov
danielkov force-pushed the feat/acp-subagent-sessions branch from 26b62d8 to 30e1727 Compare October 30, 2026 13:56

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Five existing defects remain: explicit null content is lost during directed-message projection; macOS streamed roster rows suppress runtime lifecycle information; late TUI announcements can recreate removed children; live v1 subscribers miss descendant state transitions; and v1 projection relabels reasoning as ordinary messages.

[P2] Restore the breaking-change marker for the removed transcript RPC

This PR still removes kit/subagent/transcript/read, but the commit subject and PR title now use feat(acp): rather than feat(acp)!:, and the commit body no longer has a BREAKING CHANGE: footer. scripts/next-release-version.sh selects a minor bump only from those commit markers; the removal described under the PR body's Impact section does not count. If merged with the current commit metadata and no other breaking commit in the release range, this incompatible RPC removal receives a patch release, and existing callers fail with method-not-found without the required minor-version signal. Restore ! on the commit subject (and PR title for squash merges), or retain a BREAKING CHANGE: kit/subagent/transcript/read is removed; clients must consume ACP child-session updates. footer in the merged commit.

Took 7 min 45 sec

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The existing desktop lifecycle finding still applies to late descendants: subagent_descendants_removed records only IDs already present in rowsByID. A first association arriving after its ancestor's cleanup has no ID tombstone, passes syncStreamed's cleanedIDs check, and remains displayed and counted as live/idle after the branch is closed. Retain cleaned ancestor fences and check retained ownership before roster admission, including unseen grandchildren; keep transcript retention separate. Cover cleanup before first announcement as well as cleanup of already-known descendants.

[P2] Restore the breaking-change marker for the removed transcript RPC

kit/subagent/transcript/read is still removed, but neither the current PR title nor either commit has a Conventional Commit ! or BREAKING CHANGE: footer. scripts/next-release-version.sh reads those commit markers, not the PR body's Impact prose. If the merged metadata remains unmarked and the release range contains no other breaking commit, this incompatible RPC removal receives a patch rather than the policy-required minor release, leaving existing callers with method-not-found without the required version signal. Restore ! on the feature commit subject and PR title for squash merges, or ensure the actual merged commit includes a BREAKING CHANGE: footer naming the removed RPC and migration to ACP child-session updates.

Took 16 min

Comment thread macos/KitDesktop/Models/AppState.swift Resolved
Comment thread src/tui/app/subagent_sessions.rs Resolved
Replace private transcript polling with bounded ACP child-session streams in the bundled TUI and desktop client. Retain generation-checked Kit steering without advertising unsupported child cancellation.
@danielkov
danielkov force-pushed the feat/acp-subagent-sessions branch from f1349ee to a77241e Compare October 30, 2026 16:26

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[P2] Persist cleanup ancestry when rejecting runtime descendants

The existing desktop lifecycle finding remains in a narrower runtime-only path. AgentRoster.apply records a late child's parent and propagates cleanup, then returns false for the cleaned child. ConversationController.applyRuntime discards that mutated value because it commits only on true. A subsequent grandchild can therefore appear and count as live under the closed branch before streamed ancestry arrives. Preserve ownership/tombstone changes even when rejecting the row. Add a controller-level regression for cleanup → unseen child → grandchild; the direct-roster test retains mutations that this caller discards.

[P2] Restore the breaking-change marker for the removed transcript RPC

kit/subagent/transcript/read is removed, but the current PR title and all four commits lack ! or a BREAKING CHANGE: footer. If the actual merged metadata remains unmarked and the release range contains no other breaking commit, scripts/next-release-version.sh selects a patch rather than the policy-required minor release. Mark the actual merged commit as breaking (including the PR title for squash merges), naming the removed RPC and migration to ACP child-session updates.

Took 20 min

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[P2] Restore the breaking-change marker for the removed transcript RPC

kit/subagent/transcript/read is removed, but the current PR title and all five commits lack ! or a BREAKING CHANGE: footer. If the actual merged metadata remains unmarked and the release range contains no other breaking commit, scripts/next-release-version.sh selects a patch rather than the policy-required minor release. Mark the actual merged commit as breaking (including the PR title for squash merges), naming the removed RPC and migration to ACP child-session updates.

Took 9 min 24 sec

Replace temporary Git patches with SDK/HTTP 3.6.0, schema 1.14.0 and AgentKit ACP 0.12.0. Retain the approved wasm .128 cohort and SDK-required libc 0.2.189 pin. Adapt released protocol APIs without changing bounded gateway or subagent semantics.
@danielkov

danielkov commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor Author

Review clarification: this change is intentionally NOT classified as breaking. The TUI and macOS app bundle their matching Kit server version and are migrated together in this PR. The removed kit/subagent/transcript/read RPC is an internal, version-coupled implementation detail, not a cross-version public compatibility contract. Model-facing subagent, fork, and prompt tools remain available.

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[P2] Restore the breaking-change marker for the removed transcript RPC

kit/subagent/transcript/read is removed, but the current PR title and all six commits lack ! or a BREAKING CHANGE: footer. If the actual merged metadata remains unmarked and the release range contains no other breaking commit, scripts/next-release-version.sh selects a patch rather than the policy-required minor release. Mark the actual merged commit as breaking (including the PR title for squash merges), naming the removed RPC and migration to ACP child-session updates.

Took 17 min

@danielkov

Copy link
Copy Markdown
Contributor Author

@kit-code-agent check my comment above for reasoning on non-breaking change.

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

Copy link
Copy Markdown
Contributor

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.

Took 8 min 3 sec

@danielkov
danielkov merged commit e725f24 into main Oct 30, 2026
6 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