Repository navigation
feat(acp): report run boundaries and background work over state_update - #150705
Open
IEatCodeDaily wants to merge 1 commit into
Open
IEatCodeDaily wants to merge 1 commit into
IEatCodeDaily wants to merge 1 commit into
Conversation
Editors that declare clientCapabilities._meta["hermes-agent"|"bb.dev"].stateUpdate (>= 1) now receive _hermes-agent/state_update notifications: running/idle at every admission's message.start/message.complete (today message.start is dropped by the projection), plus the session's process roster in ACP v2 state_update.background shape, recomputed from process.list on every send. Exited processes stay listed as completed/failed until the wake turn that reports their result settles (the claim's message.start card names it), matching the v2 known-follow-up rule: finalized before removed, never silently dropped. Roster reads and notification sends are boundary-guarded: neither can fail the pump. This lets ACP v1 editors (T3 Code) await finite background commands: hold Working while awaited work runs, wake with the result when it exits.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
ACP v2's
state_update.background(agentclientprotocol #2738 / RFD #2452), carried over an ACP v1 connection as an opt-in extension notification_hermes-agent/state_update, modeled on_bb.dev/state_update(#149684) and extended with the background roster.An editor opts in via
clientCapabilities._meta["hermes-agent"].stateUpdate >= 1(thebb.devalias is honoured). Hermes then sends, per session:runningat every claim'smessage.start(with_meta.runId= the admission id),idleatmessage.complete(withstopReason)background: the session'sprocess.listroster asBackgroundWorkitems — running processes asrunning, exited ascompleted/failedwithexitCoderunningwhen a turn is in flightKnown-follow-up rule
An exited process with a pending wake stays in the roster (terminal status) until the wake turn settles — the wake's
message.startcarries the async-result card (display_kind), and itsmessage.completefinalizes the exit so it leaves the roster for good, even while the owner's finished-process registry still lists it. Removal is always preceded by a terminal report; an omitted/failed roster read omits the key (unreported), never an empty list (lying "quiet").Safety
_metasees any new notificationext_notificationsends are boundary-guarded: a failure logs and skips, the projection pump never failsTests
tests/acp_adapter/test_background_state_update.py— 18 tests, written red-first (16 failing before the change, all passing after): opt-in parse (both namespaces, version gating), running/idle boundaries with roster, stop-reason mapping, exited→completed/failed mapping with exitCode, hold-until-wake-settles (including registry eviction), roster-read failure fallback, notification failure isolation, adopt snapshots with/without an in-flight turn, no-opt-in silence. Neighbour pump tests (reattach/replay-gap/approval) pass unchanged; ruff clean.