Summary
When connecting Agmente iOS to a Codex app-server via stdio-to-ws, Agmente falls back to ACP mode and sends session/list instead of thread/list, causing Codex to reject the request.
Environment
- Agmente iOS: 0.1.0
- Codex CLI: 0.116.0 (
codex app-server)
- stdio-to-ws: 0.2.0 (via
npx @rebornix/stdio-to-ws)
- macOS: 15.7.3 (arm64)
- Transport: Tailscale serve (TLS) → ws://localhost:9000
Steps to Reproduce
- Start the bridge:
npx -y @rebornix/stdio-to-ws --persist --grace-period 604800 "codex app-server" --port 9000
- Expose via TLS (e.g.
tailscale serve --bg 9000)
- Connect from Agmente iOS using
wss://<host>
- Send any message → "initialize needed" error on the phone
Observed Behavior
The initialize handshake succeeds, but the userAgent in the response does not start with codex/:
userAgent: 'Agmente iOS/0.116.0 (Mac OS 15.7.3; arm64) unknown (Agmente iOS; 0.1.0)'
After initialize, Agmente sends session/list (ACP protocol) instead of thread/list (Codex protocol). Codex rejects it:
Error:
{"error":{"code":-32600,"message":"Invalid request: unknown variant session/list, expected one of initialize, thread/start, thread/resume, ..."}}
Expected Behavior
Agmente should detect the Codex app-server and use thread/* methods instead of session/*.
Possible Cause
Protocol detection appears to look for codex/ in the userAgent field of the initialize response. The current Codex 0.116.0 app-server does not seem to include a matching userAgent string, so Agmente defaults to ACP mode.
Summary
When connecting Agmente iOS to a Codex app-server via
stdio-to-ws, Agmente falls back to ACP mode and sendssession/listinstead ofthread/list, causing Codex to reject the request.Environment
codex app-server)npx @rebornix/stdio-to-ws)Steps to Reproduce
tailscale serve --bg 9000)wss://<host>Observed Behavior
The
initializehandshake succeeds, but theuserAgentin the response does not start withcodex/:After initialize, Agmente sends
session/list(ACP protocol) instead ofthread/list(Codex protocol). Codex rejects it:Error:
{"error":{"code":-32600,"message":"Invalid request: unknown variant
session/list, expected one ofinitialize,thread/start,thread/resume, ..."}}Expected Behavior
Agmente should detect the Codex app-server and use
thread/*methods instead ofsession/*.Possible Cause
Protocol detection appears to look for
codex/in theuserAgentfield of theinitializeresponse. The current Codex 0.116.0app-serverdoes not seem to include a matching userAgent string, so Agmente defaults to ACP mode.