Repository navigation
Description
Client or integration
Other
Area
Other
Summary
The existing tests/codex-integration/native-codex-toggle.test.ts regression test turning Codex off > the status read follows an off-then-on round trip against the same stale server config fails on clean dev commit e6c6e13a22e465812f509a423990e9f09e32b1d0 (2.82.0 development version).
It expects the Codex status row to report state: "current", desiredEnabled: true after OFF then ON, but gets state: "absent", desiredEnabled: true. The run logs a service-home ownership refusal during enable. This report is about a reproducible test failure; it does not establish that the production ownership check is wrong. The fixture or host isolation may need correction rather than relaxing the ownership boundary.
The same failure occurs while reviewing an unrelated /v1/messages response-header change and in a separate pristine git archive HEAD copy without that source change. Each focused run reports 12 pass / 1 fail.
Reproduction
- Use a checkout of dev at
e6c6e13a22e465812f509a423990e9f09e32b1d0with dependencies installed. - Start Bun with a fresh fake HOME (mandatory due to the separately tracked test-home hazard [Bug]: bare
bun testprunes the real ~/.claude/agents/ocx-*.md (Bun homedir() ignores the preload's HOME sandbox) #6775):
FH=$(mktemp -d)
mkdir -p "$FH/.claude"
env -u HTTPS_PROXY -u NODE_EXTRA_CA_CERTS HOME="$FH" CLAUDE_CONFIG_DIR="$FH/.claude" \
"$BUN_BIN" test --cwd "$CHECKOUT" tests/codex-integration/native-codex-toggle.test.tsHere BUN_BIN is the absolute Bun executable path and CHECKOUT is the clean repository directory.
- Observe the failure at line 167. The test creates synthetic OPENCODEX_HOME and CODEX_HOME fixtures plus a matching v2
service-state.json, dispatches OFF and ON to/api/native-integrations/codex, then reads/api/native-integrationsagainst the original in-memory config. - To rule out an uncommitted patch, repeat from a pristine
git archive HEADextraction with the same installed dependencies. This independently reproduces the same 12 pass / 1 fail result.
No real user configuration or live service was modified for these reproductions. No provider calls are needed.
Version
2.82.0-dev, commit e6c6e13
Operating system
Linux x86_64, kernel 7.0.0-38-generic; Bun 1.4.0 (34cbb9a40)
Provider and model
Not provider-specific; local integration fixture only.
Logs or error output
[opencodex] Codex write refused (service-home): this proxy could not prove it owns the installed service homes, so catalog sync and Codex config injection were skipped. POST /api/sync returns the specific reason.
167 | expect(body.clients.find(client => client.clientId === "codex")).toMatchObject({
error: expect(received).toMatchObject(expected)
{
"desiredEnabled": true,
- "state": "current",
+ "state": "absent",
}
(fail) turning Codex off > the status read follows an off-then-on round trip against the same stale server config
12 pass
1 fail
Ran 13 tests across 1 file.
Screenshots and supporting files
No screenshots. The reproduction uses the existing committed test and no additional fixture files.
Redacted configuration
{
"port": 10100,
"providers": {
"openai": {
"adapter": "openai-responses",
"baseUrl": "https://chatgpt.com/backend-api/codex",
"authMode": "forward"
}
},
"defaultProvider": "openai"
}Checks
- I searched existing issues and documentation.
- I removed secrets, tokens, account details, request credentials, and personal data.
Activity
fix(test): keep test processes out of the real Claude config directory (
lidge-jun commentedon Oct 9, 2026
Fixed on
devby #6834 (merge commit c4baa30).The fixture's
service-state.jsonwas read correctly. The refusal came frominspectServiceManagerInstallation, which asks the real service manager (launchctlon macOS,systemctl --useron Linux), something HOME cannot redirect. On a machine with a registered opencodex service, that live registration made ownership unprovable. The test now stubs the manager probe toabsentand asserts it is still consulted during enable. The production ownership boundary is unchanged. Thanks for keeping the report to what the evidence showed.docs(devlog): close the N3 test-infra unit (#6840)