feat(integration): codex reviewer on DeepSeek-v4-pro via Moon Bridge#811
Conversation
… Bridge codex (OpenAI CLI) speaks ONLY the OpenAI Responses API, and the OpenAI account quota for gpt-5.5 is exhausted. Per deepseek-ai/awesome-deepseek-agent docs/codex.md, route codex to DeepSeek-v4-pro through Moon Bridge — a local proxy that exposes a Responses-compatible endpoint and forwards to DeepSeek's /anthropic surface. VALIDATED END-TO-END LOCALLY: codex exec on model `moonbridge` -> deepseek-v4-pro returns a parseable verdict (the bridge log confirms the upstream deepseek-v4-pro call; codex exit 0, "Verdict: mergeable"). - setup_codex_deepseek_bridge.sh: install Go, build + background-start Moon Bridge with the DeepSeek key, generate codex's config.toml (wire_api=responses, model=moonbridge) into ~/.codex, strip the unused deepwiki MCP server. - moonbridge-config.yml: the bridge config template (DEEPSEEK_API_KEY_PLACEHOLDER substituted at runtime; no key committed). - L3 + L2 review-pack: a "Set up codex DeepSeek bridge" step before the codex step (continue-on-error so a bridge failure still reaches codex's fail-closed verdict); CODEX_MODEL=moonbridge, CODEX_REASONING_EFFORT=xhigh. Follow-up: pin the moon-bridge clone to a commit (currently --depth 1 default HEAD).
Greptile SummaryThis PR routes the L3/L2 codex equivalence reviewer from OpenAI (quota exhausted) to DeepSeek-v4-pro by introducing Moon Bridge — a locally-built reverse proxy that translates codex's OpenAI Responses API calls to DeepSeek's Anthropic surface. The core mechanism is a new shell script that installs Go, clones and builds the bridge from a third-party GitHub repo, starts it in the background, and writes a
Confidence Score: 1/5Not safe to merge as-is: the bridge script clones and executes an unreviewed, unpinned third-party binary that holds a live API key. The core of this change is a CI script that downloads, compiles, and runs code from a third-party GitHub repository at an unspecified HEAD commit, while that process holds the
|
| Filename | Overview |
|---|---|
| .github/scripts/setup_codex_deepseek_bridge.sh | New script that installs Go, clones and builds an unpinned third-party binary (moon-bridge), starts it as a background reverse proxy, and writes a codex config pointing at it — the unpinned clone is a supply chain risk and the sed-based key substitution can break for keys containing the delimiter character |
| .github/integration/moonbridge-config.yml | New Moon Bridge config template routing the moonbridge alias to deepseek-v4-pro via DeepSeek's Anthropic surface; key is a placeholder substituted at runtime and never committed |
| .github/workflows/integration-final-review.yml | Adds a continue-on-error bridge-setup step before the fail-closed L3 codex gate and switches CODEX_MODEL from gpt-5.5 to moonbridge; a silent bridge failure leaves the codex step in an ambiguous broken state with no clear diagnostic |
| .github/workflows/integration-scope.yml | Mirrors the same bridge-setup + model-switch pattern for the advisory L2 codex reviewer; lower risk because codex is not fail-closed here |
Sequence Diagram
%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
participant GHA as GitHub Actions Runner
participant GH as github.com/ZhiYi-R/moon-bridge
participant MB as Moon Bridge (localhost:38440)
participant Codex as codex CLI
participant DS as api.deepseek.com/anthropic
GHA->>GH: git clone --depth 1 HEAD (unpinned)
GHA->>GHA: go build -o /tmp/moonbridge
GHA->>GHA: sed DEEPSEEK_API_KEY into /tmp/mb_config.yml
GHA->>MB: nohup /tmp/moonbridge -config /tmp/mb_config.yml
GHA->>MB: poll /console/ until healthy
GHA->>GHA: moonbridge -print-codex-config → ~/.codex/config.toml
GHA->>Codex: "codex exec (CODEX_MODEL=moonbridge)"
Codex->>MB: OpenAI Responses API request
MB->>DS: Translated Anthropic API request + DEEPSEEK_API_KEY
DS-->>MB: DeepSeek-v4-pro response
MB-->>Codex: OpenAI Responses API response
Codex-->>GHA: Verdict (mergeable / not mergeable)
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
participant GHA as GitHub Actions Runner
participant GH as github.com/ZhiYi-R/moon-bridge
participant MB as Moon Bridge (localhost:38440)
participant Codex as codex CLI
participant DS as api.deepseek.com/anthropic
GHA->>GH: git clone --depth 1 HEAD (unpinned)
GHA->>GHA: go build -o /tmp/moonbridge
GHA->>GHA: sed DEEPSEEK_API_KEY into /tmp/mb_config.yml
GHA->>MB: nohup /tmp/moonbridge -config /tmp/mb_config.yml
GHA->>MB: poll /console/ until healthy
GHA->>GHA: moonbridge -print-codex-config → ~/.codex/config.toml
GHA->>Codex: "codex exec (CODEX_MODEL=moonbridge)"
Codex->>MB: OpenAI Responses API request
MB->>DS: Translated Anthropic API request + DEEPSEEK_API_KEY
DS-->>MB: DeepSeek-v4-pro response
MB-->>Codex: OpenAI Responses API response
Codex-->>GHA: Verdict (mergeable / not mergeable)
Reviews (1): Last reviewed commit: "feat(integration): run the codex reviewe..." | Re-trigger Greptile
Per your doc (deepseek-ai/awesome-deepseek-agent codex.md), route the L3 codex equivalence reviewer to DeepSeek-v4-pro through Moon Bridge — a local proxy that exposes an OpenAI-Responses endpoint and forwards to DeepSeek's
/anthropicsurface. This sidesteps the OpenAI quota (gpt-5.5 + xhigh hitQuota exceeded).Validated end-to-end LOCALLY
Installed Go + Moon Bridge, started the bridge with the DeepSeek key, generated codex's config, and ran
codex exec --model moonbridge:Verdict: mergeable流式请求完成 ... actual_model=deepseek-v4-pro provider=deepseek input_total=12555 output_tokens=26— confirmed the upstream DeepSeek call.(First attempt failed only because
CODEX_HOMEwas under/tmp, which made codex refuse to create helper binaries — a local artifact; CI uses~/.codex.)Changes
setup_codex_deepseek_bridge.sh— install Go, build + background-start Moon Bridge with$DEEPSEEK_API_KEY, generate codexconfig.toml(wire_api=responses,model=moonbridge) into~/.codex, drop the unused deepwiki MCP.moonbridge-config.yml— bridge config template (key placeholder substituted at runtime).CODEX_MODEL=moonbridge,CODEX_REASONING_EFFORT=xhigh.Notes
Test plan