Skip to content

fix: require Messages start before round content - #396

Merged
franciscojavierarceo merged 1 commit into
mainfrom
codex/messages-start-order
Sep 30, 2026
Merged

franciscojavierarceo merged 1 commit into
mainfrom
codex/messages-start-order

Conversation

@franciscojavierarceo

Copy link
Copy Markdown
Collaborator

Summary

An upstream Messages round without message_start can currently dispatch a built-in tool or report completion. Require a start in each round before accepting content-block events or terminal message events. Invalid order produces a fixed api_error before dispatch or completion; upstream errors and harmless unknown events retain their handling.

Follow-up to #345, part of #313 and #316. Move the accumulator's existing ingestion methods into a private module to keep the single parsing/validation path within the file-size limit, and remove the old exception. Four existing unit fixtures now include their required round starts. Broader schema validation and resource budgets remain open; search-budget accounting is separate work in #391.

Test Plan

  • New regression failed on current main: omitting a round's start still dispatched search. It removes the start from both recorded rounds and separately checks content deltas/stops and message deltas/stops before a start.
  • Core library: 914 passed, 5 ignored. Messages streaming integration: 16 passed. HTTP Messages completion/tool choice: 25 passed (955 total).
  • Workspace all-target Clippy with warnings denied and all-files pre-commit checks passed, including formatting and file sizes.
  • Compared extracted ingestion methods with the original: unchanged except for the ordering guard and private module visibility. Deterministic local fixtures; no live inference.

@franciscojavierarceo
franciscojavierarceo marked this pull request as ready for review September 30, 2026 08:43
@franciscojavierarceo
franciscojavierarceo merged commit d5286a4 into main Sep 30, 2026
20 checks passed
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