Skip to content

[WRONG BRANCH] fix(minimax): keep MMX bridge traffic on loopback - #294

Closed
luvs01 wants to merge 1 commit into
mainfrom
codex/fix-mmx-bridge-proxy-vulnerability
Closed

[WRONG BRANCH] fix(minimax): keep MMX bridge traffic on loopback#294
luvs01 wants to merge 1 commit into
mainfrom
codex/fix-mmx-bridge-proxy-vulnerability

Conversation

@luvs01

@luvs01 luvs01 commented Aug 16, 2026

Copy link
Copy Markdown
Owner

Motivation

  • A new MMX text bridge forwarded requests using the parent process global fetch, which can honor HTTP_PROXY/HTTPS_PROXY/ALL_PROXY and route intended loopback traffic off-machine.
  • The bridge must never send prompt or response bodies to an external proxy because that leaks confidentiality and allows forged responses.
  • The change preserves the bridge's existing streaming, cancellation, and error-handling semantics while eliminating proxy-induced network egress.

Description

  • In startMmxTextBridge the bridge now constructs an explicit Request for the upstream and calls fetch(upstreamRequest, { proxy: { url: upstreamOrigin } }) to force the hop to the chosen loopback OpenCodex listener instead of relying on the parent process global fetch behavior.
  • This pins the upstream transport to the bridge's loopback origin so Bun's proxy environment variables in the parent cannot route the request off-machine.
  • Added a subprocess fixture tests/fixtures/minimax-bridge-direct.ts that runs a bridge, an upstream, and a simulated attacker proxy and records upstream body and proxy hits.
  • Added a regression test in tests/minimax-clients.test.ts that spawns the fixture with proxy environment variables set and asserts the bridge reaches only the local upstream and that the external proxy receives no requests.

Testing

  • Ran the focused test node_modules/.bin/bun test tests/minimax-clients.test.ts and the new regression passed.
  • Ran bun run typecheck (bun x tsc --noEmit) and it succeeded.
  • Ran bun run privacy:scan and it succeeded.
  • Attempted a full bun run test run; focused checks and static checks passed but a full-suite run experienced unrelated timing-sensitive failures/timeouts in other tests and was not used as the gate for this focused change.

Codex Task

Summary by CodeRabbit

  • Bug Fixes

    • MiniMax bridge requests now reliably connect through the configured local proxy, avoiding unintended routing through inherited network proxy settings.
    • Improved connection reliability when HTTP, HTTPS, or SOCKS proxy variables are present.
  • Tests

    • Added integration coverage confirming requests reach the expected upstream service without passing through unintended proxies.

@coderabbitai

coderabbitai Bot commented Aug 16, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 20124e6a-8d58-4862-b354-af179b8ce7d6

📥 Commits

Reviewing files that changed from the base of the PR and between 2a1604e and f565539.

📒 Files selected for processing (3)
  • src/cli/minimax.ts
  • tests/fixtures/minimax-bridge-direct.ts
  • tests/minimax-clients.test.ts

Included review availability: Your plan includes up to 3 reviews per rolling hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The MiniMax text bridge now forces requests through the configured loopback upstream origin instead of inherited proxy settings. Integration coverage verifies direct routing when HTTP, HTTPS, and SOCKS proxy variables are present.

Changes

MiniMax proxy isolation

Layer / File(s) Summary
Pin bridge requests to the upstream origin
src/cli/minimax.ts
At lines 193–204, startMmxTextBridge passes Bun’s proxy option to fetch while preserving request construction, timeout, and error handling.
Validate direct routing under proxy settings
tests/fixtures/minimax-bridge-direct.ts, tests/minimax-clients.test.ts
The fixture records upstream and proxy traffic. The integration test configures HTTP, HTTPS, and SOCKS proxy variables, then verifies the expected upstream payload and zero proxy requests.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: ⚪ Minimal · up to f5655

The bridge now keeps upstream traffic on the selected loopback listener, with regression coverage for proxy-related egress and successful focused checks; no actionable merge-blocking risk remains beyond normal review.

Suggested labels: bug

Suggested reviewers: hylouis233, ingwannu

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: keeping MMX bridge traffic on the loopback upstream.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/fix-mmx-bridge-proxy-vulnerability

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

@github-actions

Copy link
Copy Markdown

Deterministic PR hygiene checks passed.

@github-actions github-actions Bot added the bug Something isn't working label Aug 16, 2026
@github-actions github-actions Bot changed the title fix(minimax): keep MMX bridge traffic on loopback [WRONG BRANCH] fix(minimax): keep MMX bridge traffic on loopback Aug 16, 2026
@github-actions

github-actions Bot commented Aug 16, 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 marked this pull request as draft August 16, 2026 03:53

luvs01 commented Aug 16, 2026

Copy link
Copy Markdown
Owner Author

Superseded by lidge-jun#1845, which ports this fix onto current dev and includes lowercase proxy-variable regression coverage. Closing this stale wrong-branch draft.

@luvs01 luvs01 closed this Aug 16, 2026
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