implement-generalize-chat

Implement: generalize chat panes to arbitrary commands (B — runs after verify of A)

Metadata

Statusdone
Assignedagent-2113
Agent identityf51439356729d112a6c404803d88015d5b44832c6c584c62b96732b63c2b0c7e
Modelcodex:gpt-5.5
Created2026-05-03T21:31:05.642156748+00:00
Started2026-05-04T01:49:51.617995860+00:00
Completed2026-05-04T02:22:53.008323304+00:00
Tagsfix,architecture,chat,tui,generalize, eval-scheduled
Eval score0.86
└ blocking impact0.87
└ completeness0.88
└ constraint fidelity0.85
└ coordination overhead0.87
└ correctness0.87
└ downstream usability0.83
└ efficiency0.83
└ intent fidelity0.86
└ style adherence0.82

Description

Description

Generalize the chat-pane primitive from 'LLM-specific (claude/codex/nex)' to 'arbitrary command in a persistent tmux+PTY pane'. claude/codex/nex become preset shortcuts that fill in known command shapes; users can also launch bash, vim, tail -f, or anything else as a chat tab.

Conditional on verify-fix-nex-chat-mirror PASSING. If verify-A fails, do NOT start this task — fix A first.

User direct quote 2026-05-03: 'you should be able to run whatever in a chat lol. why not? that gives a persistent state for shells. this is... more.'

Spec

Schema change

Chat task metadata becomes (command_argv, working_dir, optional executor-preset-name) instead of (executor, model, endpoint).

  • Existing claude/codex/nex chat tasks: migrate to the new shape on first read; preset name preserves the 'this is a claude chat' display intent.
  • Per skip-back-compat-ceremony memory: hard schema change; in-place migration of existing chat tasks; no deprecation window.

CLI surface

  • wg chat new --exec <executor> — current preset path (claude/codex/nex). Builds the command_argv from the preset's known shape.
  • wg chat new --command '<command-line>' — NEW: arbitrary command. Just runs it in a tmux+PTY pane.
  • New-chat dialog gets a 'Custom Command' option that takes the command line directly.

Use cases this enables

  • Persistent dev shell: wg chat new --command 'bash' — survives TUI exit, reattach via TUI's chat tabs.
  • Log tail in a chat tab: wg chat new --command 'tail -f deploy.log' — always-on monitoring.
  • Vim session: wg chat new --command 'vim my-doc.md' — persistent edit session.

Implementation surface

  • src/tui/viz_viewer/state.rs — chat-spawn dispatch becomes generic; preset → command_argv
  • src/commands/chat_cmd.rs — new --command flag
  • src/tui/ — new 'Custom Command' option (composes with redesign-new-chat)
  • Schema migration code for existing chat tasks
  • Smoke scenarios covering the new use cases (bash chat, vim chat, etc.)

Validation

  • Failing tests written first
  • Schema migration: existing claude/codex/nex chats still work after the change (preset preserved, command_argv derived)
  • wg chat new --command 'bash' creates a chat task whose pane runs bash
  • Bash chat survives TUI exit + reattach
  • wg chat new --command 'tail -f /tmp/test.log' works
  • wg chat new --exec claude and --exec codex and --exec nex still work as before (preset shortcuts)
  • New-chat dialog has Custom Command option; freeform command-line input is accepted
  • No regression of A's verified behavior (nex chat in TUI still works post-B)
  • cargo build + cargo test pass
  • Permanent smoke scenarios added: bash-chat, custom-command-chat, preset-shortcuts-still-work
  • cargo install --path . was run before claiming done
  • Call wg done at completion

Depends on

Required by

Log