Skip to content

fix(proxy): persist complete HTTP bridge replay transcripts - #1899

Closed
shaqman wants to merge 8 commits into
Soju06:release/beta-1.24.0-beta.4from
shaqman:feat/complete-http-bridge-transcripts
Closed

fix(proxy): persist complete HTTP bridge replay transcripts#1899
shaqman wants to merge 8 commits into
Soju06:release/beta-1.24.0-beta.4from
shaqman:feat/complete-http-bridge-transcripts

Conversation

@shaqman

@shaqman shaqman commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Closes #1898

Summary

This PR makes HTTP Responses bridge recovery replayable when upstream continuity is lost, while keeping the recovery fail-closed when the transcript is incomplete or ambiguous.

The branch is rebased onto main at b311aea760aa639fd96f63bd118f775e9b4a89f9 (currently v1.24.0-beta.4).

Changes

  • Persist root operations in the durable transcript.
  • Materialize terminal response output from the event spool before marking a turn replayable.
  • Persist bounded, account-neutral replay snapshots only after output and replay input are complete.
  • Match continuations while tolerating upstream-omitted reasoning/hosted-search envelopes.
  • Deduplicate echoed tool output.
  • Track synthetic snapshot roots that already contain terminal output so a tool-output-only continuation does not duplicate the preceding function call.
  • Preserve fail-closed behavior when parent identity or transcript completeness cannot be proven.
  • Add unit coverage and OpenSpec updates.

No upstream API or Codex CLI changes are required.

Validation

Local:

  • pytest -q tests/unit/test_complete_transcript.py: 10 passed
  • Ruff check and format check on changed Python files: passed
  • Ty check on changed production files: passed
  • python -m compileall and git diff --check: passed

The full bridge unit module was also attempted. The local test container currently lacks the git executable required by an unrelated worktree-path test, so it stops at that environment failure rather than indicating a regression in this change.

Live deployment evidence:

  • Affinity-aware tool continuation completed across a reconstructed response chain.
  • Root and child operations both recorded response_output_items_complete=true and response_replay_input_complete=true.
  • The child replay snapshot contained exactly one function_call and one function_call_output; no duplicate tool call was emitted.
  • Since deployment: 1,401 HTTP successes and no 502/503/cooldown/retry-circuit responses.
  • Remaining failures are predominantly upstream WebSocket clean closes before response.completed (27 HTTP stream_incomplete responses); seven stale sessions had no durable replay snapshot and correctly failed closed.

Related work

This is intentionally narrower than the existing recovery work:

Those changes do not provide complete transcript materialization plus tool-output deduplication for the replay path addressed here.

Rebase follow-up

The release branch advanced after the initial PR creation. The branch was force-with-lease updated after a clean rebase onto current main at b311aea760aa639fd96f63bd118f775e9b4a89f9 (currently v1.24.0-beta.4); no conflicts occurred. The focused replay suite and static checks were rerun successfully after the rebase (10/10 tests passed).

@shaqman
shaqman requested a review from Soju06 as a code owner August 24, 2026 07:41
@coderabbitai

coderabbitai Bot commented Aug 24, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: f3c13db9-a40a-4c41-ab65-3c9574cc2d40

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added the db migration PR changes Alembic database migrations; maintainer must coordinate merge order label Aug 24, 2026
@shaqman
shaqman force-pushed the feat/complete-http-bridge-transcripts branch from c7ea143 to 4984f8c Compare August 24, 2026 07:42
@Soju06
Soju06 deleted the branch Soju06:release/beta-1.24.0-beta.4 August 24, 2026 08:01
@Soju06 Soju06 closed this Aug 24, 2026

shaqman commented Aug 24, 2026

Copy link
Copy Markdown
Contributor Author

This PR was closed automatically when the temporary release/beta-1.24.0-beta.4 base branch was deleted. The implementation has since been cleanly rebased onto upstream main at b311aea7 and recreated as #1900: #1900

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

db migration PR changes Alembic database migrations; maintainer must coordinate merge order

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants