Skip to content

Codex app-server protocol detection fails: sends session/list instead of thread/list #33

@sldx

Description

@sldx

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

  1. Start the bridge:
    npx -y @rebornix/stdio-to-ws --persist --grace-period 604800 "codex app-server" --port 9000
    
  2. Expose via TLS (e.g. tailscale serve --bg 9000)
  3. Connect from Agmente iOS using wss://<host>
  4. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions