Skip to content

Preserve server status when converting realtime message items - #4602

Closed
mikemikimike wants to merge 2 commits into
openai:mainfrom
mikemikimike:fix/realtime-item-status-4597
Closed

Preserve server status when converting realtime message items#4602
mikemikimike wants to merge 2 commits into
openai:mainfrom
mikemikimike:fix/realtime-item-status-4597

Conversation

@mikemikimike

@mikemikimike mikemikimike commented Aug 23, 2026

Copy link
Copy Markdown

Summary

Fixes #4597.

The Realtime conversation item converter previously replaced the server-provided status with in_progress. Retrieved completed or incomplete assistant items therefore regressed in RealtimeSession history after reconciliation.

This update:

  • preserves the server-provided completed and incomplete statuses;
  • preserves an existing assistant history status when a retrieved item omits status;
  • preserves an existing assistant transcript when the retrieved item omits it;
  • tests the converter and the actual RealtimeSession item-update path.

Validation

  • uv run --frozen pytest tests/realtime/test_item_parsing.py tests/realtime/test_session.py -q — 205 passed
  • uv run --frozen ruff format --check src/agents/realtime/session.py src/agents/realtime/openai_realtime.py tests/realtime/test_item_parsing.py tests/realtime/test_session.py — passed
  • uv run --frozen ruff check src/agents/realtime/session.py src/agents/realtime/openai_realtime.py tests/realtime/test_item_parsing.py tests/realtime/test_session.py — passed
  • git diff --check — passed
  • uv run --frozen mypy src — blocked by the local environment missing numpy and numpy.typing stubs

Agent review

GPT-5 via Codex, one fresh review pass after the formatting fix. Verified that the converter preserves server status, the session fallback only applies when the incoming status is absent, transcript preservation remains intact, and the regression tests cover completed, incomplete, and missing-status cases. No additional findings.

@mikemikimike
mikemikimike force-pushed the fix/realtime-item-status-4597 branch from dd130b0 to 5a3aa96 Compare August 23, 2026 16:48
@mikemikimike
mikemikimike force-pushed the fix/realtime-item-status-4597 branch from 5a3aa96 to 46d2545 Compare August 23, 2026 17:41
@seratch

seratch commented Aug 23, 2026

Copy link
Copy Markdown
Member

We are keeping #4598 as the destination for #4597. The useful part here is the session-level assertion that explicit server status and an existing transcript survive reconciliation.

The runtime changes in #4602 go further: they change the released missing-status fallback from in_progress to None and add an assistant-only session rule, while the reported case already carries completed. That broader omitted-status contract is not established by #4597. I am going to close #4602 in favor of the narrower #4598 path.

@seratch seratch closed this Aug 23, 2026
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.

[Realtime] conversation.item.retrieved regresses completed history items to in_progress

2 participants