Skip to content
Source
Sign inSign up
pingdotgg/t3code

Windows: Codex cannot decode MCP initialize responses #48116

OpenMrWrecks(GitHub profile, opens in a new tab) opened this issue 5 comments

On T3 Code 0.1.13 with Codex 0.169.0, a fresh Codex turn after a restart reproduced failures for both t3-code and t3-code-direct. T3 logged six successful authenticated initialize requests over localhost, all HTTP 200. Codex failed to decode the response body on every attempt and never reached tools/list. The model still returned its text reply. Can you recommend a diagnostic that compares response headers and body completion on both sides without logging credentials or message content?

  1. tanstack-source added labelsbug

  2. We couldn't reproduce this. On a clean Windows machine with Codex 0.169.0 and current main, both t3-code and t3-code-direct finish initialize over localhost. So something between the two processes on your machine is the likely cause. These checks don't log credentials or message content:

    1. Codex side, the exact error. Quit T3 Code. Start it from a PowerShell window where you have run $env:RUST_LOG = "codex_rmcp_client=debug,rmcp=debug", so the Codex it launches gets that variable. Start a Codex turn. Then read the lines whose target starts with rmcp or codex_rmcp_client from %USERPROFILE%\.codex\logs_2.sqlite, in the logs table, column feedback_log_body. The full decode error says which part broke: content type, SSE framing, an early end of stream, or a compressed body. Remove any Bearer … value before you share a line.
    2. Proxies (only the names matter). Run Get-ChildItem env: | ? Name -match 'proxy' and netsh winhttp show proxy. If HTTP_PROXY, HTTPS_PROXY or ALL_PROXY is set and NO_PROXY does not include localhost,127.0.0.1, Codex sends localhost traffic through the proxy. The proxy can then hand back a body Codex cannot read, even though T3 still logs a 200. Also check for antivirus or endpoint software that inspects local HTTP.
    3. Wire side, headers only. Copy the port from the MCP URL T3 gives Codex and run curl.exe -sS -D - -o NUL -X POST http://127.0.0.1:<port>/mcp -H "Content-Type: application/json" -H "Accept: application/json, text/event-stream" --data "{}". Without a token this returns 401 and needs no credentials. Compare Content-Type, Content-Encoding, Transfer-Encoding and Content-Length with what Codex's debug log says it received. Run it once with the proxy variables set and once with them cleared ($env:HTTP_PROXY=$null and so on). If the headers differ between the two runs, something in between is rewriting the response.

    Please reply with the rmcp error line, which proxy variables are set (names only), and the two sets of headers.

  3. juliusmarminge added labelsneeds more info

  4. Thanks for checking on a clean Windows machine. I ran those checks on my T3 Code 0.1.13 install, which has local UI customizations.

    After relaunching T3 with the suggested RUST_LOG setting, both t3-code and t3-code-direct still failed during initialization. The error I found in the rmcp::transport::worker logs was error decoding response body. I didn’t find a more specific cause in the matching log entries.

    None of HTTP_PROXY, HTTPS_PROXY, ALL_PROXY, or NO_PROXY was set in the shell I tested, and WinHTTP reported direct access. Both unauthenticated curl runs against localhost /mcp returned the same headers:

    HTTP/1.1 401 Unauthorized
    Content-Type: application/json
    Transfer-Encoding: chunked

    Neither response included Content-Length or Content-Encoding. Both runs ended with curl: (56) chunk hex-length char not a hex digit: 0x7b. That shows what curl received on the 401; I haven’t confirmed whether the authenticated 200 has the same problem.

    Is there a way to check whether T3 emits that framing before the response reaches curl, without capturing the token or body?

  5. juliusmarminge removed labelsneeds more info

  6. @MrWrecks Main's own server answers your unauthenticated curl with content-length: 90 and a www-authenticate: Bearer resource_metadata=... header, and curl exits cleanly. Your response had neither header and was marked Transfer-Encoding: chunked. If you run a stock, unmodified T3 Code 0.1.13 (or the latest nightly) with your local customizations removed, does the same curl.exe -sS -D - -o NUL -X POST http://127.0.0.1:<port>/mcp ... still show Transfer-Encoding: chunked without www-authenticate, and does Codex then initialize?

  7. juliusmarminge added labelsneeds more info

  8. Thanks for checking. I haven’t tried a stock build yet, but I was able to reproduce a difference without changing the T3 install. I ran the same unauthenticated localhost POST on my customized 0.1.13 build three times:

    • AVG Web Shield on: 401, Transfer-Encoding: chunked, curl exit 56 (chunk hex-length char not a hex digit: 0x7b).
    • Web Shield paused: 401, Content-Length: 90, curl exit 0.
    • Web Shield back on: the original framing error returned, with curl exit 56.

    In a separate Codex turn with Web Shield briefly paused, both t3-code and t3-code-direct reached ready. The subsequent tool call stopped at an approval prompt, so I can confirm initialization but not a completed call. My header capture didn’t include WWW-Authenticate, so I can’t say whether it was present.

    Web Shield is back on. I have an AVG update pending a restart and will retest after it applies.

  9. juliusmarminge removed labelsneeds more info

  10. Thanks for narrowing this down. Your test with Web Shield on, paused, then on again points to the cause. Unchanged, T3 Code answers that request with Content-Length: 90, and curl exits cleanly. With AVG Web Shield on, the response arrives marked Transfer-Encoding: chunked, and the body starts with { (0x7b) where a chunk size should be. That means something between the two processes rewrote the response headers but left the body as it was. T3 still logs a 200 because its own response was fine. Codex's error decoding response body comes from the rewritten framing. Since pausing Web Shield lets both t3-code and t3-code-direct reach ready, AVG is causing this, not T3 or Codex.

    To keep Web Shield on, add an exception so it stops scanning local traffic to T3. In AVG, go to Menu → Settings → Protection → Core Shields → Web Shield, and either add 127.0.0.1 and localhost (or the exact http://127.0.0.1:<port>/mcp URLs) to the URL exceptions, or add the T3 Code and Codex executables to the excluded processes. If your AVG version has the "Enable HTTPS scanning" or "scan local traffic" options, turning off local scanning also fixes it. After your AVG update applies, run the same curl.exe -sS -D - -o NUL -X POST http://127.0.0.1:<port>/mcp ... check again. If it shows Content-Length and curl exits 0 with Web Shield on, Codex should initialize. If it still shows Transfer-Encoding: chunked and exit 56, the exception has not taken effect yet.

  11. juliusmarminge added labelsneeds more info

Sign in to join this conversation.