Skip to content

refactor(core): simplify session input promotion#33443

Merged
kitlangton merged 3 commits into
devfrom
simplify-v2-prompt-inbox
Jun 22, 2026
Merged

refactor(core): simplify session input promotion#33443
kitlangton merged 3 commits into
devfrom
simplify-v2-prompt-inbox

Conversation

@kitlangton

@kitlangton kitlangton commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Summary

  • keep session.next.prompt.admitted as the durable, client-visible record of pending Session input
  • replace the redundant session.next.prompt.promoted event with the existing session.next.prompted event when input becomes model-visible
  • atomically consume the inbox row and project the user message from Prompted, regenerate SDK/OpenAPI output, and reset disposable V2 state while preserving canonical V1 conversations

Design

The event log retains both facts needed by servers and clients:

  • PromptAdmitted: the prompt was accepted and is pending; replay can rebuild the inbox and clients can display queued input
  • Prompted: the runner made that input model-visible; the projector marks the inbox row consumed and appends the user message in the same EventV2 transaction

Execution ownership remains process-local. Future multi-server execution still requires an explicit lease, but accepted pending work remains replayable and projectable onto another database.

Verification

  • bun run test test/session-prompt.test.ts test/session-projector.test.ts test/session-create.test.ts test/session-runner.test.ts test/session-runner-recorded.test.ts test/database-migration.test.ts (145 passed)
  • bun test test/cli/tui/data.test.tsx (7 passed)
  • bun run typecheck (23/23 workspace tasks)
  • bun run script/migration.ts --check
  • revised simplify reuse, quality, and efficiency reviews completed

The earlier full Core suite passed 1005/1006 tests. The unrelated macOS watcher test consistently received an add event for .git/HEAD where it expects change; the focused watcher rerun reproduced the same failure.

@kitlangton kitlangton changed the title refactor(core): simplify session input admission refactor(core): simplify session input promotion Jun 22, 2026
@kitlangton kitlangton enabled auto-merge (squash) June 22, 2026 21:47
@kitlangton kitlangton disabled auto-merge June 22, 2026 21:51
@kitlangton kitlangton merged commit f48f24e into dev Jun 22, 2026
7 of 8 checks passed
@kitlangton kitlangton deleted the simplify-v2-prompt-inbox branch June 22, 2026 21:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant