Skip to content

fix(core): deliver idle synthetic notices without resuming - #45303

Closed
kitlangton wants to merge 1 commit into
v2from
idle-message-delivery
Closed

kitlangton wants to merge 1 commit into
v2from
idle-message-delivery

Conversation

@kitlangton

@kitlangton kitlangton commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

Why

Recording a synthetic status notice with resume: false currently leaves it in the inbox until a later agent run. Callers such as background-job recovery need the notice in durable Session history without starting the model or publishing internal Session events themselves.

What Changes

Session.synthetic({ resume: false }) now delivers an eligible idle steer immediately through the existing inbox-delivery event.

Session/input state Result
Idle, next steered synthetic notice Enter history immediately; do not start execution.
Running Session Keep the notice pending for the next safe boundary.
Earlier steered user input or control item Keep the notice pending; do not bypass earlier work.
Later user input Deliver only the notice; leave user input pending.
Explicit queue delivery Keep the notice pending.
Staged revert Keep the notice pending under existing revert semantics.

Delivery Boundary

The Session API checks the next steered inbox item under the existing per-Session inbox lock and delivers only the requested notice. It does not invoke the runner's batch promotion operation, so it cannot accidentally consume neighboring user prompts. Retries keep the existing stable-ID reconciliation and first-admission behavior.

Scope

This is a standalone prerequisite for simplifying shell notifications in #44844; it does not modify that PR. User-prompt admission and model execution semantics are unchanged. Immediate user-prompt delivery would require separating runner preparation and pending-work accounting, so that broader redesign is intentionally excluded.

Verification

# packages/core
bun run test
bun typecheck

# packages/sdk, using the repository's isolated-home test wrapper
bun run ../core/script/test.ts test/embedded.test.ts --timeout 15000

# repository root
bun run lint:effect-simplifications
  • Full Core suite: 2,310 passed, 16 skipped, zero failures.
  • Isolated embedded SDK suite: 14 passed.
  • Core typechecking and Effect simplification lint passed.
  • Pre-push typechecking passed across all 38 workspace packages.
  • The ancillary server fetch suite has three pre-existing OAuth callback-port assertion failures (7 passed, 3 failed). All three reproduce unchanged on base 91028a690be4ae763141878b6c3f57b43c585d80 in an isolated detached worktree.

@kitlangton

Copy link
Copy Markdown
Contributor Author

Closing in favor of using the existing Session.synthetic({ resume: false }) semantics in #44844. Durable inbox admission already records the notice without waking the agent; immediate placement in model history is not required for background-job recovery.

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