Skip to content

fix(session): make request lifecycle authoritative and recover empty replies - #2625

Open
wqymi wants to merge 1 commit into
mainfrom
fix/empty-assistant-recovery
Open

wqymi wants to merge 1 commit into
mainfrom
fix/empty-assistant-recovery

Conversation

@wqymi

@wqymi wqymi commented Oct 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Track runtime-scoped command receipts through admission, input consumption, execution handoff, and terminal results. Expose versioned results through the session API and events, including failures that produce no assistant message.
  • Settle handed-off requests only after their actual executions and finalizers exit. Freeze cancellation targets so retries cannot interrupt successor work.
  • Recover an explicitly selected empty assistant from its original user message without duplicating the input, and preserve the selected model.
  • Freeze trusted execution/request/parent context for tools and isolate background inbox wakeups from the initiating request.

Verification

  • bun test test/session/requests.test.ts test/server/session-requests.test.ts test/effect/runner.test.ts --timeout 30000 — 72 passed, 420 assertions.
  • Request, HTTP, plugin registry, and nested tool execution regression suite — 114 passed, 575 assertions.
  • MCP exception regression — 2 passed, 8 assertions.
  • CLI and plugin bun run typecheck passed.
  • Integration consumer rebuilt against this implementation: 71 Electron end-to-end tests passed, covering recovery, cancellation, reload/reconciliation, and trusted tool context.
  • Independent design and code review completed; git diff --check passed.

Scope

Receipts are runtime-only and are cleared with their owning instance/session; this adds no database or persisted receipt store. Unknown outcomes are queried rather than replayed. Untracked callers retain the existing route response behavior. No automation product enablement, release, or merge is included.

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