Skip to content

[WRONG BRANCH] fix(responses): repair terminal-less bridged search legs - #485

Draft
luvs01 wants to merge 1 commit into
mainfrom
codex/propose-fix-for-terminal-less-search-leg-issue
Draft

[WRONG BRANCH] fix(responses): repair terminal-less bridged search legs#485
luvs01 wants to merge 1 commit into
mainfrom
codex/propose-fix-for-terminal-less-search-leg-issue

Conversation

@luvs01

@luvs01 luvs01 commented Sep 11, 2026

Copy link
Copy Markdown
Owner

Motivation

  • A composition change moved the web-search bridge to wrap the raw upstream before terminal repair, which prevented terminal repair from seeing a complete but terminal-less first-leg web_search lifecycle and caused some turns to stall indefinitely.
  • The intent is to preserve request liveness when an upstream emits a complete intercepted web_search call but does not emit a terminal or close the leg.

Description

  • Reordered the passthrough composition in src/server/responses/core.ts so terminal repair is applied to the raw upstream first and the resulting repaired stream is passed as the firstLeg to createPassthroughWebSearchBridgeStream.
  • Updated the source-oracle test tests/responses/passthrough-abort.test.ts to assert the composition order and that the bridge receives the repaired stream as its firstLeg.
  • Preserved existing bridge continuation behavior, outbound-size checks, and all downstream invariants while ensuring terminal repair can arm its grace timer when appropriate.

Testing

  • Ran the focused test bun test tests/responses/passthrough-abort.test.ts, which passed (24 tests, 0 failures).
  • Ran bun run typecheck, which succeeded.
  • Attempted the full test suite with bun run test; focused changes passed but the full-suite run encountered unrelated, environment-sensitive failures and panics in other test areas (combo-management / codex-shim) that prevented a complete parallel run; these failures are not related to the patched changes.

Codex Task

@coderabbitai

coderabbitai Bot commented Sep 11, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: dff2cdb9-c80c-4d15-9515-245830bc3411


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 11, 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-09-11T12:12:53.362413Z d7dce5a 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.

@github-actions github-actions Bot added the bug Something isn't working label Sep 11, 2026
@github-actions

Copy link
Copy Markdown

Deterministic PR hygiene checks passed.

@github-actions

github-actions Bot commented Sep 11, 2026

Copy link
Copy Markdown

⏳ DRAFT

  • wrong target branch (main); retarget to dev.

What to do

  • Retarget this PR to dev — all contributions go to dev.

Its title has been prefixed with [WRONG BRANCH].
This pull request was already a draft. Its draft status will be preserved after every issue above is resolved.

@github-actions github-actions Bot changed the title fix(responses): repair terminal-less bridged search legs [WRONG BRANCH] fix(responses): repair terminal-less bridged search legs Sep 11, 2026
@github-actions
github-actions Bot marked this pull request as draft September 11, 2026 12:11

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d7dce5ac40

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +66 to +70
const terminalRepair = sseBranch.indexOf("relayResponsesSseWithTerminalRepair(");
const webSearchBridge = sseBranch.indexOf("createPassthroughWebSearchBridgeStream({");
expect(terminalRepair).toBeGreaterThanOrEqual(0);
expect(webSearchBridge).toBeGreaterThan(terminalRepair);
expect(sseBranch.slice(webSearchBridge)).toContain("firstLeg: passthroughSseBody,");

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Add behavioral coverage for the terminal-less bridge

These assertions only inspect source-text ordering, so they pass without proving the liveness fix: the repair timer could fail to arm, its synthetic terminal could be ignored by the bridge, or the continuation could remain unsent. Add a focused test that supplies a completed-but-never-closing web_search first leg through handleResponses, advances the injected scheduler, and verifies that search execution and the continuation request occur; this directly protects the production hang this change addresses.

AGENTS.md reference: AGENTS.md:L367-L370

Useful? React with 👍 / 👎.

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

Labels

aardvark bug Something isn't working codex

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant