feat(sdk): type turn.resumed and background.changed system events - #180
Merged
Conversation
The broker emits `turn.resumed` when the agent resumes the last turn on its own (a background task finished) and `background.changed` while idle whenever the set of background tasks holding the devbox awake changes. Both previously classified as `unknown`. Adds the SystemEvent members, parsing, guards, re-exports in every module, and docs. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The parser passes unknown kinds through, so the type must say so or an exhaustive switch typechecks and misses at runtime. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
ross-rl
force-pushed
the
ross/background-changed-event
branch
from
September 4, 2026 20:55
de9d21e to
8109ed5
Compare
ross-rl
marked this pull request as ready for review
September 4, 2026 21:00
ross-rl
pushed a commit
that referenced
this pull request
Sep 4, 2026
🤖 I have created a release *beep* *boop* --- ## [0.4.13](remote-agents-sdk-v0.4.12...remote-agents-sdk-v0.4.13) (2026-09-04) ### Features * **sdk:** type turn.resumed and background.changed system events ([#180](#180)) ([cc36192](cc36192)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
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
Adds two broker system events to the SDK's typed
SystemEventunion, shared by the ACP, Claude, and Codex modules:turn.resumed{ turnId }: the agent resumed the last turn on its own, typically because a background task it started finished. SameturnIdas the turn it continues; ends with anotherturn.completed. Parsed liketurn.started.background.changed{ active: BackgroundTask[] }: emitted only while no turn is running, whenever the set of background tasks holding the devbox awake differs from what was last reported.BackgroundTaskis{ id, kind }withkindone ofcommand,agent,workflow; unknown kinds pass through as opaque strings. An emptyactivemeans the agent's background work is done.Both previously classified as
kind: "unknown". AddsSYSTEM_EVENT_TYPESentries, parsing intryParseSystemEvent,isTurnResumedEvent/isBackgroundChangedEventguards with narrowed types, re-exports from/shared,/acp,/claude,/codex, and README / AGENTS docs.Why
Broker side:
turn.resumedis on main (runloopai/runloop#11635);background.changedis runloopai/runloop#11652. The wire shape here matches that PR. Draft until #11652 lands so the shape is final.Checklist
<type>(<scope>): <description>format (see above)bun run checkpasses (lint + format)bun run buildpassesbun run testpasses