Skip to content

fix: apply Claude config and preserve Codex proxy identity#201

Merged
ymkiux merged 8 commits into
mainfrom
fix/auto-selected-provider-config
Jun 18, 2026
Merged

fix: apply Claude config and preserve Codex proxy identity#201
ymkiux merged 8 commits into
mainfrom
fix/auto-selected-provider-config

Conversation

@awsl233777

@awsl233777 awsl233777 commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • apply newly added Claude configs through the same applyClaudeConfig(name) path used by manual selection
  • keep the UI-selected Claude config and the persisted Claude settings in sync after adding a provider
  • preserve Codex client identity headers across both builtin proxy and --bridge openai upstream requests
  • keep streaming Codex /v1/responses requests on upstream Responses first, only falling back to /chat/completions when Responses is explicitly unsupported
  • normalize upstream Codex Originator to codex_cli_rs even when the local TUI sends codex-tui, matching Codex-only upstream gates
  • add an idle timeout for accepted upstream Responses SSE streams so a headers-only stalled stream fails instead of hanging forever
  • document that the built-in Codex conversion attaches/normalizes Codex fingerprint headers in both English and Chinese READMEs
  • bump the package version to 0.0.53 and update git tag v0.0.53 to point at PR head d1223be4eb12704974d5822b840e42dfa16d09aa

Validation

  • node --input-type=module ... targeted harness for tests/unit/claude-settings-sync.test.mjs → 34 tests passed
  • node --test tests/unit/builtin-proxy-responses-shim.test.mjs → 18 tests passed
  • node --test tests/unit/openai-bridge-upstream-responses.test.mjs → 23 tests passed
  • npm run lint → passed for 220 files
  • npm run test:unit → 661 tests passed
  • README update inspected with grep for the new Codex fingerprint wording
  • version update inspected with grep for no remaining 0.0.52 / v0.0.52 matches outside dependencies/git metadata

Notes

  • npm ci reported existing dependency audit warnings before validation; no dependency changes were made.
  • Some npm run test:unit runs emit the existing search_sessions.py --limit -1 usage message at the end while exiting 0.
  • The reported Codex-only group failures first lacked Codex identity (Go-http-client/1.1), then failed on Originator: codex-tui; the latest code normalizes the upstream Codex originator while preserving the Responses-first streaming behavior.

@coderabbitai

coderabbitai Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@awsl233777, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 18 minutes and 19 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: bbf2b5f5-dadb-4ed3-bdbc-c17bf5ef753f

📥 Commits

Reviewing files that changed from the base of the PR and between 3a1fa04 and d1223be.

📒 Files selected for processing (2)
  • cli/openai-bridge.js
  • tests/unit/openai-bridge-upstream-responses.test.mjs
📝 Walkthrough

Walkthrough

addClaudeConfig is made async and its post-save block is changed to close the modal and await applyClaudeConfig(name) instead of directly emitting a success toast and calling refreshClaudeModelContext. Unit tests are updated to await the method and assert the new delegation behavior. Separately, builtin-proxy and openai-bridge add Codex client identity header extraction and forwarding to upstream /v1/responses and /v1/chat/completions requests, with new streaming SSE handlers that prioritize upstream /responses with fallback decision logic, and corresponding test coverage. Documentation is updated to reflect the new header normalization behavior. Package version is bumped to 0.0.53.

Changes

Claude config async delegation to applyClaudeConfig

Layer / File(s) Summary
addClaudeConfig made async, delegates to applyClaudeConfig
web-ui/modules/app.methods.claude-config.mjs
Method is marked async; after saving the config, it closes the add-config modal and awaits applyClaudeConfig(name), replacing the inline toast.operation.success call and direct refreshClaudeModelContext invocation.
Unit tests updated for async delegation
tests/unit/claude-settings-sync.test.mjs
Validation test converted to async and now awaits addClaudeConfig; happy-path test stub replaces refreshed flag with an applied capture array via an async applyClaudeConfig, awaits the call, and asserts applyClaudeConfig was invoked with the trimmed config name while expecting no success toast.

Codex client identity header forwarding

Layer / File(s) Summary
Builtin-proxy Codex header extraction and streaming handlers
cli/builtin-proxy.js
Introduces codexUpstreamHeaders helper that extracts incoming Codex client identity headers (user-agent, version, openai-beta, originator) and constructs a normalized upstream header set. Adds streamResponsesSse to POST to upstream /responses, detect event-stream by content-type, stream chunks directly when SSE is accepted, or buffer/parse JSON and wrap via sendResponsesSse. Adds streamResponsesSseWithFallbackUrls to retry across candidate upstream base URLs with transient-network retry logic.
Builtin-proxy /v1/responses handler integration with fallback policy
cli/builtin-proxy.js
Updates /v1/responses streaming handler to build commonHeaders via codexUpstreamHeaders, invoke streamResponsesSseWithFallbackUrls for upstream /responses SSE, and apply shouldFallbackFromUpstreamResponses to decide fallback to chat/completions with branching error handling. Updates shim comments to reflect new policy: keep SSE/streaming on /v1/responses unless upstream clearly doesn't support Responses.
OpenAI-bridge Codex header utilities and constants
cli/openai-bridge.js
Updated Codex default identity constants (version, user-agent, originator) and added OpenAI beta header default. Introduces header extraction helpers to derive Codex-specific User-Agent, Version, OpenAI-Beta, and Originator, plus buildCodexBridgeHeaders() to consistently construct upstream headers including Authorization when applicable.
OpenAI-bridge streamResponsesSse with timeout and probe support
cli/openai-bridge.js
Adds streamResponsesSse() to proxy upstream /v1/responses as SSE with capability probing behavior: retries (via {retry:true}) on 404/405, streams through raw SSE chunks when upstream content-type is text/event-stream, otherwise buffers/parses JSON into a Responses SSE stream. Includes max-bytes enforcement, timeout handling, and SSE error emission paths.
OpenAI-bridge /v1/responses streaming path rework and fallback integration
cli/openai-bridge.js
Reworked the streaming /v1/responses path to call streamResponsesSse() with codexHeaders, including: skipping the probe when cached "unsupported" entry exists; clearing the cache on successful /responses streaming; deciding whether to fallback to chat based on shouldFallbackFromUpstreamResponses; returning JSON error or SSE failure events when fallback isn't allowed; marking the endpoint as unsupported when applicable. Updates fallback and non-streaming paths to use codexHeaders for headers. Introduces streamTimeoutMs option computation for SSE upstream streaming calls.
Builtin-proxy tests for header forwarding and streaming behavior
tests/unit/builtin-proxy-responses-shim.test.mjs
New test verifies /v1/responses upstream request includes expected Codex identity header values with proper server shutdown. Existing streaming fallback test is extended to capture and assert /v1/chat/completions upstream request includes the same identity headers. Streaming hanging-responses test case is updated to capture /v1/responses probe headers, assert identity values, verify timeout response (502), and confirm no chat fallback occurs.
OpenAI-bridge tests for timeout handling and /v1/responses passthrough
tests/unit/openai-bridge-upstream-responses.test.mjs
Replaces the chat-fallback streaming test with a scenario where upstream /v1/responses hangs: test includes explicit streamTimeoutMs configuration, expects 502 timeout response with timeout indication in content, verifies forwarded Codex identity headers on the /v1/responses probe, and confirms /v1/chat/completions is not invoked. Adds/updates test to validate successful upstream /v1/responses SSE passthrough while ensuring /v1/chat/completions is not called; extends assertions to confirm captured upstream Responses request headers and checks that the received stream contains response.created and response.completed events.
Documentation updates for Codex fingerprint normalization
README.md, README.zh.md
Feature descriptions are expanded to explain the "OpenAI-Compatible Bridge" behavior: normalizing the Responses API and auto-filling/normalizing Codex fingerprint headers (User-Agent, Version, OpenAI-Beta, Originator) on upstream requests.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

  • SakuraByteCore/codexmate#46: Both PRs update Claude settings sync behavior/tests around addClaudeConfig/applyClaudeConfig including async awaiting, changing expectations in tests/unit/claude-settings-sync.test.mjs.
  • SakuraByteCore/codexmate#151: Both PRs change cli/builtin-proxy.js's /v1/responses POST streaming/fallback implementation and update tests/unit/builtin-proxy-responses-shim.test.mjs to assert upstream headers and request behavior.
  • SakuraByteCore/codexmate#154: Both PRs modify cli/openai-bridge.js's /v1/responses streaming path with responses-first streaming logic, identity-header handling, and related unit test updates for timeout and passthrough behavior.

Suggested reviewers

  • ymkiux

Poem

🐇 Hoppity-hop, async all the way,
applyClaudeConfig saves the day!
Headers dance from Codex streams,
/v1/responses fulfills our dreams,
Identity forwarding, timeout care—the proxy knows you're there! 🎉

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main changes: applying Claude config through a unified code path and preserving Codex identity headers across proxy paths.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/auto-selected-provider-config

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 and usage tips.

@awsl233777 awsl233777 changed the title fix: apply newly added Claude config fix: apply Claude config and preserve Codex proxy identity Jun 18, 2026
@awsl233777

Copy link
Copy Markdown
Collaborator Author

Update pushed in 51da2ca.

Changes:

  • Added Codex CLI identity headers for the built-in /v1/responses proxy upstream requests: User-Agent, Version, OpenAI-Beta, and Originator.
  • The fallback path that converts streaming Responses requests to /v1/chat/completions now uses the same Codex identity headers, so Codex-only upstream groups should no longer see the request as a generic HTTP client such as Go-http-client/1.1.
  • Added regression coverage for direct /v1/responses forwarding and streaming chat fallback header propagation.

Validation:

  • node --test tests/unit/builtin-proxy-responses-shim.test.mjs → 18 tests passed
  • npm run lint → passed for 220 files
  • npm run test:unit → 661 tests passed

Note: npm run test:unit still emits the existing search_sessions.py --limit -1 usage message at the end, but exits with code 0 after all unit tests pass.

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

@awsl233777 Sure, I'll kick off a review of the latest changes in 51da2ca—the Codex CLI identity headers for /v1/responses proxy requests and the streaming chat fallback path, along with the new regression tests.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (2)
cli/builtin-proxy.js (1)

69-71: 💤 Low value

The default user-agent is Mac-specific but used cross-platform.

The DEFAULT_CODEX_USER_AGENT includes Mac-specific metadata (Mac OS 26.0.1; arm64 and Apple_Terminal/464). When this proxy runs on Linux or Windows and the incoming request lacks a codex-compatible user-agent, upstream will see Mac metadata. This is likely intentional to ensure consistent upstream behavior, but document this design choice if cross-platform accuracy matters.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@cli/builtin-proxy.js` around lines 69 - 71, The DEFAULT_CODEX_USER_AGENT
constant at the top of the file contains hardcoded Mac-specific metadata (Mac OS
26.0.1; arm64 and Apple_Terminal/464) that is used cross-platform. Add a comment
above the DEFAULT_CODEX_USER_AGENT constant definition explaining that this
Mac-specific user agent is intentionally used as the default across all
platforms (Linux, Windows, Mac) to ensure consistent upstream behavior,
clarifying the design choice for why platform-specific user agents are not
generated dynamically.
tests/unit/builtin-proxy-responses-shim.test.mjs (1)

131-169: ⚡ Quick win

Consider testing custom header forwarding.

The test verifies that default Codex identity headers are sent upstream when the incoming request lacks them. Consider adding a test that sends custom user-agent, version, openai-beta, and originator headers in the proxy request, then asserts those custom values are forwarded upstream. This would verify the implementation correctly forwards client-provided identity metadata rather than always using defaults.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/unit/builtin-proxy-responses-shim.test.mjs` around lines 131 - 169, Add
a new test function that verifies custom identity headers are forwarded upstream
when provided by the client. Create a test similar to the existing
'builtin-proxy /v1/responses sends Codex client identity upstream' test, but
this time include custom values for the 'user-agent', 'version', 'openai-beta',
and 'originator' headers in the request body sent to the proxy, then assert that
these exact custom values (rather than defaults) are captured in the upstream
request headers. This ensures the proxy correctly forwards client-provided
identity metadata instead of always using defaults.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@cli/builtin-proxy.js`:
- Around line 69-71: The DEFAULT_CODEX_USER_AGENT constant at the top of the
file contains hardcoded Mac-specific metadata (Mac OS 26.0.1; arm64 and
Apple_Terminal/464) that is used cross-platform. Add a comment above the
DEFAULT_CODEX_USER_AGENT constant definition explaining that this Mac-specific
user agent is intentionally used as the default across all platforms (Linux,
Windows, Mac) to ensure consistent upstream behavior, clarifying the design
choice for why platform-specific user agents are not generated dynamically.

In `@tests/unit/builtin-proxy-responses-shim.test.mjs`:
- Around line 131-169: Add a new test function that verifies custom identity
headers are forwarded upstream when provided by the client. Create a test
similar to the existing 'builtin-proxy /v1/responses sends Codex client identity
upstream' test, but this time include custom values for the 'user-agent',
'version', 'openai-beta', and 'originator' headers in the request body sent to
the proxy, then assert that these exact custom values (rather than defaults) are
captured in the upstream request headers. This ensures the proxy correctly
forwards client-provided identity metadata instead of always using defaults.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 89e34ca9-2114-441d-9c23-c21119619983

📥 Commits

Reviewing files that changed from the base of the PR and between 917dbb3 and 51da2ca.

📒 Files selected for processing (2)
  • cli/builtin-proxy.js
  • tests/unit/builtin-proxy-responses-shim.test.mjs
📜 Review details
🔇 Additional comments (4)
cli/builtin-proxy.js (3)

74-79: LGTM!


81-99: LGTM!


1848-1848: LGTM!

tests/unit/builtin-proxy-responses-shim.test.mjs (1)

465-468: LGTM!

@awsl233777

Copy link
Copy Markdown
Collaborator Author

Follow-up pushed in e5fa007 after the reported Codex-only group error still reproduced.

Root cause refined:

  • The previous commit added Codex identity headers, but streaming Codex requests were still taking the built-in proxy fast path from /v1/responses to /v1/chat/completions.
  • In a Codex-only upstream/group chain, that fallback can route through a non-Codex client path and still surface as Only Codex clients can use this group (detected: Go-http-client/1.1).

Additional fix:

  • stream=true requests now try upstream /v1/responses first and preserve the Responses stream.
  • The proxy only falls back to /v1/chat/completions when the upstream explicitly reports Responses is unsupported, such as 404/405/501 or known unsupported-response errors.
  • A hanging Responses stream now times out instead of silently falling back into the non-Codex chat path.

Validation:

  • node --test tests/unit/builtin-proxy-responses-shim.test.mjs → 18 tests passed
  • npm run lint → passed for 220 files
  • npm run test:unit → 661 tests passed

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

@awsl233777 Sure! I'll kick off a review of the latest changes in e5fa007 — the refined fix for streaming Codex requests now trying upstream /v1/responses first, the selective fallback to /v1/chat/completions only on explicit non-support signals (404/405/501), and the hanging stream timeout guard.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@awsl233777

Copy link
Copy Markdown
Collaborator Author

Follow-up pushed in 8c91824 for the reproduced --bridge openai Codex-only group error.

Root cause refined:

  • The user command uses --bridge openai, so the request path goes through cli/openai-bridge.js rather than the builtin proxy fixed in e5fa007.
  • That bridge still used the old streaming fast path that could fall back into /v1/chat/completions and surface upstream as a generic HTTP client, producing Only Codex clients can use this group (detected: Go-http-client/1.1).

Additional fix:

  • Added Codex identity header forwarding in the OpenAI bridge (User-Agent, Version, OpenAI-Beta, Originator).
  • For streaming /v1/responses, the OpenAI bridge now tries upstream /responses first and preserves SSE when available.
  • It only falls back to /chat/completions when upstream explicitly indicates Responses is unsupported.
  • A hanging upstream Responses stream now returns a timeout failure instead of silently falling into the non-Codex chat path.

Validation:

  • node --test tests/unit/openai-bridge-upstream-responses.test.mjs → 22 tests passed
  • npm run lint → passed for 220 files
  • npm run test:unit → 661 tests passed

@coderabbitai review

@awsl233777

Copy link
Copy Markdown
Collaborator Author

Follow-up pushed in 52daca7 for the second reproduced Codex-only group error:

{"error":{"message":"Only Codex clients can use this group (detected: codex_cli_rs/0.98.0 (Mac OS 26.0.1; arm64) Apple_Terminal/464 / codex-tui)","code":"access_denied"}}

Root cause refined:

  • The previous fix successfully replaced the generic Go-http-client/1.1 identity.
  • The remaining denial showed upstream now detected codex_cli_rs... / codex-tui.
  • That second token is the local TUI Originator; Codex-only upstream gates can validate it separately and expect the official Rust CLI originator token.

Additional fix:

  • Normalize upstream Codex Originator to codex_cli_rs in both builtin proxy and --bridge openai paths.
  • Keep forwarding/normalizing the other Codex identity headers and preserving the Responses-first streaming behavior.
  • Added regression coverage where the incoming request sends Originator: codex-tui but upstream receives Originator: codex_cli_rs.

Validation:

  • node --test tests/unit/openai-bridge-upstream-responses.test.mjs → 22 tests passed
  • node --test tests/unit/builtin-proxy-responses-shim.test.mjs → 18 tests passed
  • npm run lint → passed for 220 files
  • npm run test:unit → 661 tests passed

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

@awsl233777 Sure! I'll kick off a review of the latest changes in 52daca7 — the Originator header normalization to codex_cli_rs in both the builtin proxy and --bridge openai paths, along with the regression coverage for the codex-tuicodex_cli_rs normalization.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@awsl233777

Copy link
Copy Markdown
Collaborator Author

Docs follow-up pushed in 3d47432.

Requested README update:

  • README.zh.md: the OpenAI-compatible bridge section now states that the built-in Codex conversion fills/normalizes Codex fingerprints (User-Agent, Version, OpenAI-Beta, Originator) and presents upstream as an official Codex CLI-shaped request.
  • README.md: same behavior documented in English.
  • The progress table in both READMEs now mentions attaching/normalizing Codex fingerprints in the built-in conversion.

Validation for this docs-only follow-up:

  • inspected the README diff
  • verified the new wording with grep

Existing code validation from the latest functional change still applies:

  • node --test tests/unit/openai-bridge-upstream-responses.test.mjs → 22 tests passed
  • node --test tests/unit/builtin-proxy-responses-shim.test.mjs → 18 tests passed
  • npm run lint → passed for 220 files
  • npm run test:unit → 661 tests passed

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

@awsl233777 Sure! I'll kick off a review of the latest changes in 3d47432 — the README documentation updates for Codex fingerprint normalization in both README.md and README.zh.md, including the progress table updates.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@cli/openai-bridge.js`:
- Around line 1656-1673: The current implementation disables the request timeout
when SSE headers are detected (via the setTimeout(0) call in the
text/event-stream condition block) and ignores timeout callbacks after
streamAccepted is set to true. This creates a vulnerability where if upstream
sends the SSE headers but then stalls without sending any data, the response
hangs indefinitely. Add an idle timer mechanism that activates after the SSE
headers are accepted to monitor for data flow on the upstreamRes. This idle
timer should reset each time a data chunk is received on upstreamRes and should
trigger a timeout event if no data arrives within a specified idle threshold,
allowing the promise to settle and the client to disconnect gracefully rather
than hanging.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 0389cb20-f04b-4f95-9858-1d8ce6033cbf

📥 Commits

Reviewing files that changed from the base of the PR and between e5fa007 and 3d47432.

📒 Files selected for processing (6)
  • README.md
  • README.zh.md
  • cli/builtin-proxy.js
  • cli/openai-bridge.js
  • tests/unit/builtin-proxy-responses-shim.test.mjs
  • tests/unit/openai-bridge-upstream-responses.test.mjs
✅ Files skipped from review due to trivial changes (1)
  • README.zh.md
🚧 Files skipped from review as they are similar to previous changes (2)
  • tests/unit/builtin-proxy-responses-shim.test.mjs
  • cli/builtin-proxy.js
📜 Review details
🔇 Additional comments (3)
cli/openai-bridge.js (2)

14-17: LGTM!

Also applies to: 28-62


1815-1817: LGTM!

Also applies to: 1908-1908, 1985-2024, 2037-2038, 2072-2072, 2134-2134

tests/unit/openai-bridge-upstream-responses.test.mjs (1)

95-168: LGTM!

Also applies to: 171-234

Comment thread cli/openai-bridge.js
@awsl233777

Copy link
Copy Markdown
Collaborator Author

Version follow-up pushed in 3a1fa04.

Requested update:

  • bumped global package version from 0.0.52 to 0.0.53
  • updated package.json
  • updated package-lock.json
  • created and pushed git tag v0.0.53
  • tag v0.0.53 points at current PR head 3a1fa047d95a24e762601319b958baaf072f5d41

Validation:

  • grep check found no remaining 0.0.52 / v0.0.52 matches outside git/dependency metadata
  • npm run lint → passed for 220 files
  • npm run test:unit → 661 tests passed

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

@awsl233777 Sure! I'll kick off a review of the version bump in 3a1fa04 — the package.json and package-lock.json update from 0.0.52 to 0.0.53 and the new v0.0.53 git tag.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@awsl233777

Copy link
Copy Markdown
Collaborator Author

CodeRabbit follow-up pushed in d1223be.

Fix:

  • Added an idle timeout after upstream /v1/responses accepts SSE headers.
  • The timer starts once text/event-stream is accepted, resets on every upstream data chunk, and emits response.failed + [DONE] if no data arrives within the stream idle timeout.
  • This prevents a headers-only upstream Responses stream from hanging forever.

Tag update:

  • Force-updated v0.0.53 from 3a1fa04 to the latest PR head d1223be4eb12704974d5822b840e42dfa16d09aa, so the tag now matches the current PR commit.

Validation:

  • node --test tests/unit/openai-bridge-upstream-responses.test.mjs → 23 tests passed
  • npm run lint → passed for 220 files
  • npm run test:unit → 661 tests passed

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

@awsl233777 Sure! I'll kick off a review of the latest changes in d1223be — the idle timeout guard added after upstream /v1/responses accepts SSE headers, timer reset on each upstream data chunk, response.failed + [DONE] emission on idle expiry, and the new regression test (23 tests now passing).

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@ymkiux ymkiux merged commit c9fb5be into main Jun 18, 2026
12 checks passed
@ymkiux ymkiux deleted the fix/auto-selected-provider-config branch June 18, 2026 09:33
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.

2 participants