Repository navigation
Open
Labels
CLIIssues related to the Codex CLIapp-serverIssues involving app server protocol or interfacesbugSomething isn't workingwindows-osIssues related to Codex on Windows systems
Description
codex app-server 0.159.2: turn fails with "workspace routing discovery failed" while native codex exec succeeds
Environment
- OS: Windows 10.0.26200 x86_64
- CLI:
codex-cli 0.159.2, binary SHA-256cbafb6422bca005b94c12d105b1a16a0474219e24ea4893f85846409c464f5a1(pinned; schema dump locked to the same binary) - Entry: stdio app-server (
codex app-server, NDJSON over stdin/stdout) - Auth: the CLI's own ChatGPT login state; default provider (no token injection, no
-coverrides, no provider switch) - Workspace: synthetic, empty (README + two tiny text files), existing absolute path, pure ASCII, short/shallow — and separately a deep pytest-shaped path (see controls)
- Model / approval policy / sandbox policy: not specified (server defaults)
- No tool calls anywhere in any transcript
Minimal protocol sequence
- spawn
codex app-server - →
initialize{clientInfo:{name,version}}; ← success response - →
initializednotification - →
thread/start{cwd: <existing absolute dir>}; ←result.thread.id - →
turn/start{threadId, input:[{type:"text", text:"Reply exactly <TOKEN>. Do not use tools or modify files."}]} - observe notifications until terminal state
Expected
- agent message deltas and final text
turn/completedwithturn.status = "completed"
Actual (4/4 product-path attempts on 2026-10-01)
thread/startandturn/startare accepted (valid ids returned)- mid-turn error notifications:
message: "workspace routing discovery failed"codexErrorInfo: "other",additionalDetails: null,misalignment: null- terminal
willRetry: false - in one run the server first emitted 9 ×
willRetry: truenotifications, then the same terminal error
- no agent message, no file or tool side effects; the app-server exits cleanly on stdin EOF (exit code 0)
- failure time: ~13-15s after
turn/start, regardless of workspace path shape
Controls
- Same binary, same contract, earlier date (2026-09-30): an app-server turn over the identical protocol sequence (including
initialized) completed successfully in ~6.6s withstatus=completed. The client contract therefore has a success precedent on 0.159.2. - Different entry, same day as failures: native
codex execwith the same prompt and login succeeded (PROBE_OK). This only proves the exec entry works — it does not prove app-server routing health. - Path shape ruled out: a shallow stable path and a deep pytest-shaped path fail with the byte-identical error; the failing client's outbound
thread/start.cwdwas verified character-exact against the existing directory. initializedruled out as sufficient cause: after the client fixed its handshake to sendinitialized(per official docs), the turn still failed with the identical routing error (after 9 retries).- Clean lifecycle: every failing app-server instance exits with code 0 on stdin EOF; no orphan processes.
Requests to upstream
- What preconditions does
"workspace routing discovery failed"(codexErrorInfo=other) indicate, and which side is expected to satisfy them? - Is default provider + Codex CLI login state a supported combination for app-server
turn/start? - Are there undocumented workspace registration / routing / trust requirements for app-server turns (beyond
thread/start.cwdpointing at an existing directory)? - Is there a structured error code or diagnostic field beyond
codexErrorInfo=otherthat clients can read to disambiguate this failure? - Is this a service-side state issue, an account-routing issue, or a known 0.159.2 CLI regression?
- What client-side recovery/retry policy do you recommend for this error?
Reproduction data
minimal-transcript.jsonl— minimal protocol with placeholders (no tokens, no real paths, no usernames)evidence-ledger.json— per-attempt ledger computed from committed evidence (totals: 11 product turn/start sent, 1 completed, 1 auxiliary native invocation)evidence-matrix.md— per-evidence completeness (CAPTURED / DERIVED_FROM_CODE / MISSING / NOT_APPLICABLE)normalized-diff.json— semantic diff between the successful and failing request sets (client-side differences declared)redaction-report.txt— redaction method and checks
Attachments
| file | sha256 |
|---|---|
minimal-transcript.jsonl |
9dccf617c65c8834655a72a24d0e7f74403f63b282fa00aa2f6ec1f6e3b85953 |
evidence-ledger.json |
a413565e0d74c8f45379ec200869708b002f85ba4da61f56a3c40eaa99426f44 |
normalized-diff.json |
add4808498b25f1fa746771df1f74820e0cd99ac525b7820a36ebe4ffd44bf55 |
evidence-ledger.json |
5d70420ff93ff99b168bd76b99b8aada45dda9d30d1d8d88ceedbbf8072f4fc9 |
normalized-diff.json |
ba5388ff3492cfb0b20b66eaa534a3e3c5436ba45a63f52989b4b54df47c732d |
Attached evidence
Raw-file uploads are not available through the API surface used to create this issue; the three evidence files are embedded below in full, with SHA-256 digests so they can be re-materialized verbatim.
| file | sha256 |
|---|---|
minimal-transcript.jsonl |
9dccf617c65c8834655a72a24d0e7f74403f63b282fa00aa2f6ec1f6e3b85953 |
evidence-ledger.json |
5d70420ff93ff99b168bd76b99b8aada45dda9d30d1d8d88ceedbbf8072f4fc9 |
normalized-diff.json |
8afc908b644f303c520d2d6d6cea1b82455566640d37c982d235b2e852c7bc0a |
minimal-transcript.jsonl
sha256 b14fb1634b01e843460ea68d555271f87c993df7f02c3c6e23895fda2d3206e9
{"direction":"out","frame":{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"clientInfo":{"name":"<CLIENT_NAME>","version":"0.1.0a1"}}}}
{"direction":"in","frame":{"jsonrpc":"2.0","id":1,"result":{"userAgent":"<UA>","codexHome":"<CODEX_HOME>","platformOs":"windows","version":"codex-cli 0.159.2"}}}
{"direction":"out","frame":{"jsonrpc":"2.0","method":"initialized"}}
{"direction":"out","frame":{"jsonrpc":"2.0","id":2,"method":"thread/start","params":{"cwd":"<CWD>"}}}
{"direction":"in","frame":{"jsonrpc":"2.0","id":2,"result":{"thread":{"id":"<THREAD_ID>","status":null}}}}
{"direction":"out","frame":{"jsonrpc":"2.0","id":3,"method":"turn/start","params":{"threadId":"<THREAD_ID>","input":[{"type":"text","text":"Reply exactly PING_OK. Do not use tools or modify files."}]}}}
{"direction":"in","frame":{"jsonrpc":"2.0","id":3,"result":{"turn":{"id":"<TURN_ID>","status":"inProgress"}}}}
{"direction":"in","frame":{"jsonrpc":"2.0","method":"thread/started","params":{"thread":{"id":"<THREAD_ID>"}}}}
{"direction":"in","frame":{"jsonrpc":"2.0","method":"turn/started","params":{"threadId":"<THREAD_ID>","turn":{"id":"<TURN_ID>"}}}}
{"direction":"in","frame":{"jsonrpc":"2.0","method":"error","params":{"error":{"message":"workspace routing discovery failed","codexErrorInfo":"other","additionalDetails":null,"misalignment":null},"willRetry":false,"threadId":"<THREAD_ID>","turnId":"<TURN_ID>"}}}
evidence-ledger.json
sha256 d3f9d179c41d9dee4c85fb6f61072900e57e94cdd53d5cb555273b6763f6df44
{
"built_from": "reporter's archived run records; per-entry excerpts in this ledger",
"entries": [
{
"date": "2026-09-30",
"task": "successful_control",
"entry": "app-server (stdio)",
"codex_version": "codex-cli 0.159.2",
"binary_sha256_short": "cbafb6422bca",
"product_turn_start_sent": 1,
"product_turn_completed_success": 1,
"auxiliary_model_invocations": 0,
"terminal": "turn/completed status=completed",
"error": null,
"willRetry_count": 0,
"tools_approvals_side_effects": 0,
"process_recycle": "clean (exit 0; report.md)",
"elapsed_s": 6.61,
"evidence": "archived by reporter"
},
{
"date": "2026-10-01",
"task": "dispatch_batch_1 (4 dispatches, no per-round capture)",
"entry": "app-server (stdio)",
"codex_version": "codex-cli 0.159.2",
"binary_sha256_short": "cbafb6422bca",
"product_turn_start_sent": 4,
"product_turn_completed_success": 0,
"auxiliary_model_invocations": 0,
"terminal": "UNKNOWN (per-round detail not captured; documented execution deviation)",
"error": "UNKNOWN",
"willRetry_count": "UNKNOWN",
"tools_approvals_side_effects": 0,
"process_recycle": "clean (lifecycle rounds PASS; R8/R10)",
"elapsed_s": "UNKNOWN",
"evidence": "archived by reporter"
},
{
"date": "2026-10-01",
"task": "failed_batch_2 (3 dispatches)",
"entry": "app-server (stdio)",
"codex_version": "codex-cli 0.159.2",
"binary_sha256_short": "cbafb6422bca",
"product_turn_start_sent": 3,
"product_turn_completed_success": 0,
"auxiliary_model_invocations": 1,
"terminal": "UNKNOWN (per-round detail lost; evidence-persistence defect documented)",
"error": "UNKNOWN (all three failed ~15s; root cause later identified via )",
"willRetry_count": "UNKNOWN",
"tools_approvals_side_effects": 0,
"process_recycle": "clean (F1 state machine; baseline intact)",
"elapsed_s": "UNKNOWN (~15s per round recorded)",
"evidence": "archived by reporter"
},
{
"date": "2026-10-01",
"task": "failed_run_1 (single diagnostic)",
"entry": "app-server (stdio)",
"codex_version": "codex-cli 0.159.2",
"binary_sha256_short": "cbafb6422bca",
"product_turn_start_sent": 1,
"product_turn_completed_success": 0,
"auxiliary_model_invocations": 0,
"terminal": "error notification willRetry=False",
"error": "workspace routing discovery failed",
"codexErrorInfo": "other",
"willRetry_count": 0,
"tools_approvals_side_effects": 0,
"process_recycle": "clean (graceful-exit rc=0; zero descendants; ws unchanged)",
"elapsed_s": 13.43,
"evidence": "archived by reporter"
},
{
"date": "2026-10-01",
"task": "failed_run_2 (shallow path; deep withheld by design)",
"entry": "app-server (stdio)",
"codex_version": "codex-cli 0.159.2",
"binary_sha256_short": "cbafb6422bca",
"product_turn_start_sent": 1,
"product_turn_completed_success": 0,
"auxiliary_model_invocations": 0,
"terminal": "error notification willRetry=false",
"error": "workspace routing discovery failed",
"codexErrorInfo": "other",
"willRetry_count": "UNKNOWN (per-entry detail not in exception-path evidence)",
"tools_approvals_side_effects": 0,
"process_recycle": "clean (graceful close; zero descendants; ws unchanged)",
"elapsed_s": 12.83,
"evidence": "archived by reporter"
},
{
"date": "2026-10-01",
"task": "failed_run_3 (post-handshake-fix validation)",
"entry": "app-server (stdio)",
"codex_version": "codex-cli 0.159.2",
"binary_sha256_short": "cbafb6422bca",
"product_turn_start_sent": 1,
"product_turn_completed_success": 0,
"auxiliary_model_invocations": 0,
"terminal": "error notification willRetry=False",
"error": "workspace routing discovery failed",
"codexErrorInfo": "other",
"willRetry_count": 9,
"tools_approvals_side_effects": 0,
"process_recycle": "clean (graceful-exit rc=0; zero descendants; ws unchanged)",
"elapsed_s": 14.58,
"note": "initialized notification verifiably sent exactly once on the wire",
"evidence": "archived by reporter"
}
],
"totals": {
"product_turn_start_sent": 11,
"product_turn_completed_success": 1,
"auxiliary_model_invocations": 1
}
}```
</details>
<details>
<summary><code>normalized-diff.json</code>
sha256 <code>c4a78f1656f94a183b97ea898375b2df60ce26d22116ab1b3d2f7e0d47617ab0</code></summary>
```json
{
"comparison": "successful control (earlier date, captured timeline) vs failed runs (2026-10-01; request params derived from code, verified character-exact for cwd in the path-shape comparison)",
"normalization": "dynamic only: req id/thread/turn/item ids/pid/timestamps/reply tokens; paths kept as shape class; null-vs-absent, model, provider, approval, sandbox, capabilities, clientInfo, config, auth, proxy presence, argv, method order, array order NOT normalized",
"differences": [
{
"field": "argv",
"detail": [
"$.argv: list length 4 vs 2 (order preserved)"
]
},
{
"field": "initialize",
"detail": [
"$.initialize.clientInfo.name: \"<CLIENT_NAME_VARIANT_A>\" vs \"<CLIENT_NAME_VARIANT_B>\""
]
},
{
"field": "initialized_notification",
"detail": [
"$.initialized_notification: true vs false"
]
},
{
"field": "turn_start",
"detail": [
"$.turn_start.input[0].text: \"Reply exactly <REPLY_TOKEN>. Do not use tools, execute commands, or modify file vs \"Reply exactly <REPLY_TOKEN>. Do not use tools or modify files.\""
]
}
],
"equivalences": [
{
"field": "thread_start",
"detail": []
},
{
"field": "model",
"detail": []
},
{
"field": "approval_policy",
"detail": []
},
{
"field": "sandbox_policy",
"detail": []
}
],
"schema_validation": {
"successful_control": {
"initialize": [],
"thread/start": [],
"turn/start": []
},
"product": {
"initialize": [],
"thread/start": [],
"turn/start": []
}
},
"schema_note": "线格式全部合法(含 product 的 initialized 缺失——Schema 未强制、官方顺序要求)。Schema 通过≠服务端业务路由接受。",
"classification": "LOCAL_PROTOCOL_DEFECT_FOUND",
"primary_candidate": "product omitted the officially-required 'initialized' notification (fixed offline in offline analysis; unverified against live server this batch)",
"secondary_candidates": [
"clientInfo.name: '<CLIENT_NAME_VARIANT_B>' vs '<CLIENT_NAME_VARIANT_A>' (client identity may participate in routing)",
"argv: missing '--listen stdio://' (documented equivalent; untested on server)"
]
}```
</details>Metadata
Metadata
Assignees
Labels
CLIIssues related to the Codex CLIapp-serverIssues involving app server protocol or interfacesbugSomething isn't workingwindows-osIssues related to Codex on Windows systems
Activity
github-actions commentedon Oct 1, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
sheson1105 commentedon Oct 1, 2026
Update: this failure appears intermittent on a timescale of hours with the same Codex CLI binary, client configuration, and workspace shape.
Observed sequence:
workspace routing discovery failederror after about 13–15 seconds.responseStreamDisconnectedreconnect attempts.During a successful window, A/B checks of
clientInfo.nameand explicit--listen stdio://produced successful turns in both variants. Shallow and deeper workspace paths have also produced the same failure. These tested client-side variables therefore have not explained the success/failure difference.This evidence is consistent with an intermittent failure at the app-server/backend routing boundary, but it does not establish the upstream internal cause. Please let us know which sanitized request, thread, turn, timestamp, account-region, or other correlation identifiers would be most useful for investigation. We can run a small, explicitly bounded probe during a requested diagnostic window if needed.
4Liberty commentedon Oct 1, 2026
Additional measured context for this failure class, from a desktop-heavy Windows workload with many concurrent threads. Same symptom family you and the related reports describe, plus a negative control that narrows where the time goes.
Mechanism (from current source)
codex-rs/app-server/src/request_processors/account_processor/workspace_routing.rswraps the wholeread_accountrouting read in a hardtokio::time::timeout(Duration::from_secs(15), read); expiry maps to theDiscoveryTimeoutvariant, i.e. the "workspace routing discovery timed out" text. Inside that one 15 s budget sit:ConfigManager::load_latest_config), which serialize process-wide behind the single-permitnetwork_policy_reloadsemaphore and can include a cloud-config-bundle snapshot stage with its own 20 s fetch timeout,GET {chatgpt_base_url}/wham/accounts/checkcall,So a 15 s failure is not necessarily a network failure: any slow stage (config path, lock wait, refresh) consumes the same budget, and all waiters that started within the window fail together.
Symptom shape observed
stream disconnected - retrying sampling requestwithsampling_error=workspace routing discovery timed out, burning ~90 s per turn before the turn is failed for good.account/readfail the same way in the same windows.Negative control
Outside the windows, the exact call answers
200 OKin 0.3–0.5 s when probed directly with the same account and the same custom CA bundle the client uses, with no proxy configured. The credential state is also stable (no relogin around the failures). That rules out a permanently broken endpoint or credential for this workload, and points at something intermittent inside the 15 s read on the client side of the boundary.Correlated signal
In the same windows, non-routing app-server requests that share the config/network-policy load path also stall: the desktop requested
config/read/configRequirements/readand loggedApp server request expired while queuedafter 30 s. That is consistent with the stage eating the 15 s being on the config/policy-load path (or generic app-server contention under load), but current logs carry no phase timing for the routing read, so the exact stage cannot be identified from the outside.Suggested improvements
DiscoveryTimeoutas a retryable stream disconnect — 5 retries of a deterministic 15 s failure is ~90 s of dead time per turn.Related open reports that look like the same class: #48894 (the timed-out variant in sign-in/extension paths), and the intermittent app-server windows already described here.
VasiliyBorisenok commentedon Oct 2, 2026
I am experiencing a reproducible
workspace routing discovery failedissue with Codex CLI 0.159.3 on Arch Linux (running inside Distrobox).My network connection is routed through Psiphon Tunnel Core. Codex is configured to use the local Psiphon HTTP proxy at
127.0.0.1:8081.Environment:
127.0.0.1:8081codex login statusreports:Logged in using ChatGPTThe problem is reproducible with the normal Codex startup:
However, if I explicitly specify the log directory:
Codex starts successfully.
After exiting Codex, running plain
codexagain reproduces the same error.So the behavior is consistently:
No other configuration is changed between these two tests.
I initially suspected the proxy/network connection, but changing the network route did not change the behavior. The explicit
log_dirsetting is the only difference that consistently makes Codex start successfully.This may indicate that the log directory configuration is somehow affecting the workspace-routing/bootstrap process.
yshoegazer-cmd commentedon Oct 9, 2026
I have a closely related Windows stdio app-server failure, with both
account/readand a minimal inference turn affected. I submitted desktop feedback separately; feedback ID01a08a12-eea2-7f32-b3ef-d9d4730594cb(not a support ticket number).Environment: Windows; officially signed
codex-cli 0.158.0-alpha.2.1, binary SHA-2568F0554EDE25BBC5450921897C468B2E84635AA513C5017457997AF0954581F49; stdio app-server; existing ChatGPT sign-in in an app-specific Codex state directory. No injected token, account switch, raw CAD, or business tools.initializesucceeded and the client sentinitializedbefore other requests.On 2026-10-09 around 06:34 UTC, one
account/readwithrefreshToken=falsereturned JSON-RPCerror.code=-32603; its message exactly matchedworkspace routing discovery failed. This account response had noadditionalDetails, HTTP status, or provider trace/request ID available to the client.In the same task-owned process, a single trivial text-only
gpt-6-astra/medium turn was accepted bythread/startandturn/startbut emitted nineerrornotifications withcodexErrorInfo=responseStreamDisconnected, then a finalother;turn/completed.status=failed, with no answer. To inspect details that an earlier audit had discarded, a second task-owned app-server was started around 06:37 UTC for one inference turn only (no repeatedaccount/read). The nine disconnected notifications hadadditionalDetailsexactlyworkspace routing discovery failed; the finalotherevent had null details and the same message. No HTTP status, system errno, or provider correlation ID was provided. Both processes exited cleanly. The two paths share surface text, but I cannot establish that they share an underlying cause.The client-side audit now separates official fields from local interpretations. An earlier local label suggesting a credential-store failure was triggered only by the word
keyringin stderr and has been withdrawn. Restoring a local loopback proxy listener and separately removing inherited proxy environment variables from this task process did not resolve the observed account failure; this does not rule out all network or proxy causes.model/listalone is not evidence that an inference turn works.Could maintainers clarify (1) the underlying HTTP/transport/parse category behind
get_accounts_check()for the 06:34 UTC account failure, (2) whether the inference stream's identical detail is propagated from the same workspace-discovery operation or is independent, and (3) a supported, credential-preserving recovery path or a structured diagnostic field? I do not want to infer authentication, proxy, capacity, or service root cause from-32603alone.