Skip to content

fix(runtime): process notifications when turn/start omits an ID - #809

Open
sylvesterkaczmarek wants to merge 1 commit into
openai:mainfrom
sylvesterkaczmarek:fix/781-handle-missing-turn-id
Open

sylvesterkaczmarek wants to merge 1 commit into
openai:mainfrom
sylvesterkaczmarek:fix/781-handle-missing-turn-id

Conversation

@sylvesterkaczmarek

Copy link
Copy Markdown

Summary

Fixes #781. captureTurn() currently buffers every notification while state.turnId is falsy. If turn/start returns without turn.id, the buffer is flushed once, but all later notifications, including turn/completed, are buffered again forever. The task remains stuck running even though the server completed it.

  • Track whether the start request has responded independently of turn.id.
  • Buffer only until the start response is processed; then forward subsequent notifications through the normal thread/turn routing.
  • Preserve the existing pre-response buffer flush, previous notification handler forwarding, and cleanup. completeTurn() still adopts the ID from the completion notification if it was omitted from the response.
  • Extend the fake app-server to reproduce two scenarios: a missing turn.id with later notifications, and a pre-response turn/started followed by post-response completion.
  • Add bounded end-to-end tests asserting the task finishes successfully rather than hanging indefinitely.

Verification

  • 93 tests passed (npm test), including 2 new real CLI/fake-server integration tests for the missing-turn-ID cases.
  • Focused Node syntax checks on the three changed files and Git whitespace checks passed.
  • No production app-server or account credentials were used.

This is independent of the existing PRs for terminal error handling and inferred completion, which address different failure triggers.

@sylvesterkaczmarek
sylvesterkaczmarek requested a review from a team October 9, 2026 15:19
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-09T15:23:45.754864Z 80fe237 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

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.

captureTurn drops every notification (including turn/completed) when the start response has no turn.id, hanging the job forever

1 participant