implement-nex-chat

Implement: nex chat — mirror claude/codex tmux-wrap path (fix A)

Metadata

Statusdone
Assignedagent-2080
Agent identityf51439356729d112a6c404803d88015d5b44832c6c584c62b96732b63c2b0c7e
Modelcodex:gpt-5.5
Created2026-05-03T21:30:33.394511133+00:00
Started2026-05-03T21:42:43.862830280+00:00
Completed2026-05-03T21:58:31.600946930+00:00
Tagspriority-critical,fix,nex,chat,tmux, eval-scheduled
Eval score0.78
└ blocking impact0.80
└ completeness0.75
└ constraint fidelity0.55
└ coordination overhead0.60
└ correctness0.80
└ downstream usability0.80
└ efficiency0.85
└ intent fidelity0.75
└ style adherence0.80

Description

Description

Implement the narrow fix from diagnose-nex-chat (path A): rewrite the nex/native branch in the chat-spawn dispatch to mirror claude/codex EXACTLY. Same tmux-wrap. Same persistent stderr file. Same resume semantics. Only difference: invokes wg nex -m <model> -e <endpoint> instead of claude or codex.

Read diagnose-nex-chat's log via wg show diagnose-nex-chat for the file:line spec of the divergence the diagnose identified.

Scope (STRICT)

Per the diagnose's recommendation: this is a narrow fix, NOT a generalize-to-arbitrary-commands refactor. ~50 LOC max.

Files likely touched:

  • src/tui/viz_viewer/state.rs — chat-spawn dispatch (the per-executor branch where the divergence lives)
  • src/tui/pty_pane.rs — possibly (only if spawn_via_tmux needs adjustment for nex args; should not be needed if the diagnose's spec is right)
  • A new build_nex_chat_pty_args (or similar helper) mirroring build_codex_chat_pty_args from fix-pass-no

DO NOT touch:

  • src/dispatch/handler_for_model.rs (handler resolution logic) — already fixed by integrate-nex-chat-end-to-end
  • Any config/schema changes
  • Any html / docs / unrelated areas
  • Any 'while I'm here' refactors

Final git diff main --stat should show only chat-spawn-dispatch files. If broader, that's path B (generalize) — out of scope for this task.

Validation

  • Failing test or repro: open TUI, create nex chat with model + endpoint, message arrives + reply received within reasonable time. Pre-fix: silent fail. Post-fix: works.
  • Live smoke against lambda01/qwen3-coder-30b (user's confirmed-working endpoint): message → reply round-trip succeeds
  • Tmux session for the new nex chat exists (verify with tmux list-sessions | grep wg-chat — should show wg-chat--chat-N for the nex chat, just like for claude/codex chats)
  • Per-chat stderr file exists and shows the nex output (matching claude/codex stderr-file pattern)
  • Resume after TUI exit: kill TUI, restart, reattach to the same nex chat. Conversation history preserved.
  • No regression of claude or codex chats
  • cargo build + cargo test pass
  • Permanent smoke scenario added: tests/smoke/scenarios/nex_chat_in_tui_via_tmux.sh — exercises the new path
  • cargo install --path . was run before claiming done
  • Call wg done at completion (NOT relying on failed-pending-eval rescue)

Depends on

Required by

Log