Closed
Conversation
… init timeout Three root causes fixed: - SetProgram modified wrong copy (value type): moved router/bridge setup to main.go where program reference is available directly - 'n' key didn't check client.Running(), causing broken pipe on disconnected client - Init() used context.Background() with no timeout, hanging silently if app-server didn't respond; now uses 10s timeout
client.Running() reflects Start() was called, not that the process is alive. When the app-server dies after Start(), Running() still returns true and CreateThread writes to a dead pipe. Fix: track connected bool in AppModel, set only on AppServerConnectedMsg. Check synchronously in handleRune before spawning any async command. No race condition possible since Update runs single-threaded.
Status bar now shows three states: - "Connecting to app-server..." (amber) while Init handshake runs - "Connected" (green) after successful handshake - "Disconnected — requires codex CLI (codex app-server)" (red) on failure Canvas shows "Waiting for app-server connection..." instead of "Press 'n' to create one" when not connected. Pressing 'n' while disconnected shows "waiting for app-server — is codex CLI installed?"
The Codex App Server wire format omits "jsonrpc":"2.0" from all
messages, uses different method names (thread/start, thread/archive,
turn/start), different response shapes (nested thread object), and
different notification names (item/started, item/agentMessage/delta,
turn/started, turn/completed). The initialized notification also
requires params: {}. Fixed default args to remove unnecessary
--listen stdio:// flag.
The real Codex CLI uses `codex proto` (not `codex app-server`) and
speaks a Submission Queue / Event Queue protocol over JSONL, not
JSON-RPC 2.0.
- Submissions: {"id":"<string>","op":{"type":"<op_type>",...}}
- Events: {"id":"<string>","msg":{"type":"<event_type>",...}}
- No handshake — server sends session_configured on startup
- Op types: user_turn, interrupt, exec_approval, shutdown
- Event types: session_configured, task_started, task_complete,
agent_message_delta, exec_command_begin/output_delta/end, error
- Default args changed from ["app-server"] to ["proto"]
- Simplified client (removed Call, pending, Dispatch, Initialize)
- EventRouter routes by msg.type instead of JSON-RPC method
- Bridge maps SQ/EQ events to Bubble Tea messages
- App auto-creates thread on session_configured, no handshake needed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
nkey handler to create new threads via app-server JSON-RPCclient.Stop()cleanupTest Plan
-raceflaggo build ./cmd/dj)-tags=integration./djlaunches, connects to app-server, status bar shows "Connected"nto create thread, verify card appearsCtrl+Cexits cleanly without zombie processes