Skip to content

fix(ai): pass system proxy and valid reasoning effort to Codex CLI#3463

Open
koco-co wants to merge 2 commits into
t8y2:mainfrom
koco-co:agent/fix-codex-proxy-reasoning
Open

fix(ai): pass system proxy and valid reasoning effort to Codex CLI#3463
koco-co wants to merge 2 commits into
t8y2:mainfrom
koco-co:agent/fix-codex-proxy-reasoning

Conversation

@koco-co

@koco-co koco-co commented Jul 14, 2026

Copy link
Copy Markdown

Summary

  • map DBX's minimal reasoning setting to Codex CLI's supported low effort
  • automatically pass the operating system proxy to Codex CLI when no explicit proxy environment is configured
  • preserve explicit codexCliEnv proxy values, including lowercase environment keys
  • revert the earlier retry-event workaround because it did not address the reproduced failure

Root cause

Two independent configuration mismatches affected GUI-launched Codex CLI requests:

  1. DBX passed model_reasoning_effort="minimal", while the selected Codex model rejects that value and accepts low, medium, high, and related supported levels.
  2. A Codex child launched from the macOS GUI did not receive the shell's proxy environment. Requests only worked after manually entering proxy variables in DBX.

Implementation

  • AiReasoningLevel::Minimal now serializes as low for Codex CLI.
  • Codex process setup uses DBX's existing platform system-proxy resolver and fills HTTP_PROXY and HTTPS_PROXY only when equivalent keys are absent.
  • User-provided proxy environment values take precedence, matched case-insensitively.
  • The same process environment path is shared by model listing, connection testing, and agent execution.

Verification

Rust checks

  • cargo fmt --all -- --check && git diff --check && CARGO_TARGET_DIR=/tmp/dbx-cargo-target cargo test -p dbx-core --lib — exit 0; 2000 declared: 1994 passed, 0 failed, 6 ignored, 0 filtered. The six ignored cases require external live databases.
  • CARGO_TARGET_DIR=/tmp/dbx-cargo-target cargo clippy -p dbx-core --locked --all-targets — exit 0; existing warnings remain (73 library, 80 test-target warnings).

Tauri development UI flow

  • Isolated configuration: provider codex-cli, model gpt-5.6-luna, reasoning minimal, empty codexCliEnv.
  • Launched the parent process with HTTP_PROXY, HTTPS_PROXY, lowercase variants, and ALL_PROXY explicitly removed.
  • Sent 只回复 E2E_PROXY_REASONING_OK through the AI panel at http://localhost:1420.
  • Received exactly E2E_PROXY_REASONING_OK from Codex CLI / gpt-5.6-luna.

Packaged macOS debug app flow

  • pnpm tauri build --debug --bundles app --config /tmp/dbx-e2e-3457/tauri.e2e.conf.json -- --no-default-features — exit 0.
  • Launched DBX E2E 3457.app with the same isolated configuration and all parent proxy variables removed.
  • Sent 只回复 PACKAGED_PROXY_REASONING_OK through the packaged tauri://localhost UI.
  • Received exactly PACKAGED_PROXY_REASONING_OK from Codex CLI / gpt-5.6-luna.

The UI verification covers the reproduced macOS development and packaged-debug flows. It does not claim signed/notarized release validation or a Windows UI run.

@koco-co
koco-co marked this pull request as ready for review July 14, 2026 12:52

@t8y2 t8y2 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Maintainer patch applied in f856fd3 to preserve inherited proxy environment settings and prevent the detected system proxy from overriding an existing lowercase proxy variable. The focused Codex CLI tests pass with the added regression coverage.

I'm still requesting changes for the reasoning-effort behavior. Mapping Minimal to low globally changes the requested reasoning level for models that do support minimal. Codex CLI accepts minimal; support is model-specific. Please handle the fallback based on the selected model's supported reasoning efforts rather than aliasing the setting for every Codex model.

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