Skip to content

feat(sdk): type turn.resumed and background.changed system events - #180

Merged
ross-rl merged 2 commits into
mainfrom
ross/background-changed-event
Sep 4, 2026
Merged

feat(sdk): type turn.resumed and background.changed system events#180
ross-rl merged 2 commits into
mainfrom
ross/background-changed-event

Conversation

@ross-rl

@ross-rl ross-rl commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

What

Adds two broker system events to the SDK's typed SystemEvent union, 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. Same turnId as the turn it continues; ends with another turn.completed. Parsed like turn.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. BackgroundTask is { id, kind } with kind one of command, agent, workflow; unknown kinds pass through as opaque strings. An empty active means the agent's background work is done.

Both previously classified as kind: "unknown". Adds SYSTEM_EVENT_TYPES entries, parsing in tryParseSystemEvent, isTurnResumedEvent / isBackgroundChangedEvent guards with narrowed types, re-exports from /shared, /acp, /claude, /codex, and README / AGENTS docs.

Why

Broker side: turn.resumed is on main (runloopai/runloop#11635); background.changed is runloopai/runloop#11652. The wire shape here matches that PR. Draft until #11652 lands so the shape is final.

Checklist

  • PR title follows <type>(<scope>): <description> format (see above)
  • bun run check passes (lint + format)
  • bun run build passes
  • bun run test passes

ross-rl and others added 2 commits September 4, 2026 13:40
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
ross-rl force-pushed the ross/background-changed-event branch from de9d21e to 8109ed5 Compare September 4, 2026 20:55
@ross-rl
ross-rl marked this pull request as ready for review September 4, 2026 21:00
@ross-rl
ross-rl merged commit cc36192 into main Sep 4, 2026
5 checks passed
@ross-rl
ross-rl deleted the ross/background-changed-event branch September 4, 2026 21:01
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).
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