thin-wrapper-impl

thin-wrapper-impl-codex

Metadata

Statusdone
Assignedagent-187
Agent identityf51439356729d112a6c404803d88015d5b44832c6c584c62b96732b63c2b0c7e
Created2026-04-26T17:29:32.008025729+00:00
Started2026-04-27T00:28:22.506159685+00:00
Completed2026-04-27T00:38:05.925097160+00:00
Tagseval-scheduled
Tokens2165805 in / 12522 out
Eval score0.88
└ blocking impact0.90
└ completeness1.00
└ constraint fidelity0.55
└ coordination overhead0.85
└ correctness0.95
└ downstream usability0.90
└ efficiency0.90
└ intent fidelity0.80
└ style adherence0.90

Description

Description

Harden the existing codex executor (src/commands/codex_handler.rs) so it works reliably against custom OAI-compatible endpoints — specifically the user's repro target https://lambda01.tail334fe6.ts.net:30000 running model qwen3-coder.

Per Phase 1 research (docs/research/thin-wrapper-executors-2026-04.md), the right architecture is already in place: per-turn codex exec spawn with replayed conversation history. The remaining gap is configuration plumbing — wg session config (model + endpoint + api key) must flow through into codex's model_providers config so codex talks to the user's endpoint instead of api.openai.com.

File scope (no overlap with siblings)

  • src/commands/codex_handler.rs (primary)
  • src/commands/init.rs / src/commands/setup.rs (only the codex-route writer pieces, if needed)
  • src/service/executor.rs (only if codex executor env var passing needs adjustment)
  • tests/codex_handler_oai_compat.rs (new file)

Implementation guidance

  1. Read WG_MODEL and WG_ENDPOINT (and api key from existing session config) on handler startup.
  2. Write a per-session ~/.codex/config.toml overlay (or use codex exec --config model_provider=...,base_url=...) so the spawned codex CLI talks to the configured endpoint.
  3. Verify api_key is passed via env to the spawned codex process (do not log it).
  4. Match claude_handler's error surface: any spawn/exit-code error becomes a clear handler.log line + outbox error reply.

Validation

  • Failing test written first: tests/codex_handler_oai_compat.rs::test_codex_handler_uses_custom_base_url — spawn codex_handler against a stub HTTP server (wiremock or hyper-based), verify request actually hits the stub URL not api.openai.com, replay 5 turns.
  • Implementation makes the test pass.
  • cargo build + cargo test pass with no regressions.
  • codex_handler successfully spawns codex CLI binary in a real run with WG_MODEL=qwen3-coder + custom WG_ENDPOINT (gated on codex CLI being installed; emit clear SKIP if not).

Implement directly — do not decompose further.

Depends on

Required by

Log