Skip to content

[codex] Persist direct prompt user events in durable stream#367

Closed
odysseus0 wants to merge 1 commit into
withastro:mainfrom
odysseus0:codex/fix-direct-prompt-transcript
Closed

[codex] Persist direct prompt user events in durable stream#367
odysseus0 wants to merge 1 commit into
withastro:mainfrom
odysseus0:codex/fix-direct-prompt-transcript

Conversation

@odysseus0

Copy link
Copy Markdown

What changed

  • append a durable message_end user event for every direct prompt
  • reserve event index 0 for that input and begin runtime output at index 1
  • use appendEventOnce with a deterministic submission key so normal processing and crash reconciliation can both deliver the event safely
  • cover Node end-to-end replay, Node recovery deduplication, and Cloudflare recovery projection

Root cause

Direct submissions wrote the user input to canonical session state, but only runtime-generated events were subscribed into the public durable event stream. @flue/react reconstructs history from that stream, so a refresh could recover the assistant response while permanently omitting the corresponding user prompt.

Fixes #307.

Validation

  • pnpm --dir packages/runtime run build
  • pnpm --dir packages/runtime run check:types
  • pnpm --dir packages/runtime exec vitest run test/node-agent-coordinator.test.ts test/cloudflare-agent-coordinator.test.ts (57 passed, 1 skipped)
  • Biome and Prettier checks for all changed files
  • local Cloudflare Durable Object integration: a new user prompt and assistant response both reconstructed after a full browser refresh

@astrobot-houston

Copy link
Copy Markdown

Thanks for the contribution! We're closing this PR and moving the conversation to the issue: #368

We've moved to a model where bugs and feature proposals are discussed in issues/discussions before code review, so the community can help prioritize and shape the work. Your branch is linked from the new thread so the implementation isn't lost — please join us there to continue the conversation.

— astrobot 🤖

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.

Cloudflare direct prompts persist user input but do not append user message events to durable agent stream

2 participants