headroom/tests/test_cli
JerrettDavis bf1e31b27c fix(codex): inject openai_base_url in init and persistent-install paths
Bug 3 fix is now consistent across all three Codex entry points.
Subscription (ChatGPT plan) users will always have their traffic routed
through headroom regardless of whether they reached Codex config via
`headroom wrap codex`, `headroom init codex`, or the persistent-install
provider scope — all three now write `openai_base_url` at the TOML
top-level (outside any `[model_providers.*]` block) so Codex's built-in
openai provider is intercepted even when subscription auth bypasses the
`model_provider = "headroom"` selection.

Changes:
- headroom/cli/init.py: add `openai_base_url` line to `_ensure_codex_provider`
  block; add `_strip_codex_init_block` helper with orphan-key cleanup
  (mirrors `_strip_codex_headroom_blocks` in wrap.py)
- headroom/providers/codex/install.py: add `openai_base_url` line to
  `apply_provider_scope` section; add orphan-cleanup regexes and apply
  them in `revert_provider_scope` to handle crash-recovery scenarios
- tests/test_install/test_providers.py: add
  `test_apply_provider_scope_writes_openai_base_url`,
  `test_persistent_install_strip_removes_openai_base_url`
- tests/test_cli/test_init_cli.py: add
  `test_init_codex_writes_openai_base_url`,
  `test_init_codex_strip_removes_openai_base_url`

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-06 11:32:12 -05:00
..
test_init_cli.py fix(codex): inject openai_base_url in init and persistent-install paths 2026-05-06 11:32:12 -05:00
test_install_cli.py test: expand persistent install coverage 2026-04-11 18:24:15 -05:00
test_main_help_version.py feat(cli): add Docker-native install flow and parity docs 2026-04-10 23:27:24 -05:00
test_mcp.py Enhanced MCP server with compress/stats tools, fix proxy torch crash 2026-03-16 22:56:30 -07:00
test_wrap_aider.py chore: normalize provider slice line endings 2026-04-21 23:54:28 -05:00
test_wrap_bridge.py feat(cli): support OpenClaw in Docker-native installs 2026-04-11 00:04:15 -05:00
test_wrap_codex.py fix: preserve Codex OAuth proxy delivery 2026-05-05 21:03:42 -05:00
test_wrap_copilot.py fix: B1 — retire ICM, RollingWindow, scoring, relevance + dependents 2026-05-02 12:23:17 -07:00
test_wrap_openclaw.py feat(cli): support OpenClaw in Docker-native installs 2026-04-11 00:04:15 -05:00
test_wrap_persistent.py fix: stabilize cli test isolation 2026-04-22 11:28:30 +00:00