Replace the line-based REPL with a full-screen Bubble Tea TUI in
interactive mode (non-TTY still falls back to the line editor).
Layout (deveco-code inspired, no emoji):
- Top status bar: HomeAgent brand + connection dot + mode + addr
- Scrollable chat viewport with role-based rendering:
You (purple) user messages
小宅 (orange) agent responses
· reasoning dim gray italic, streaming-merged
[ok]/[fail] tool calls with status + truncated result
[sys] builtin command output
[err] errors
- Rounded-border input box with placeholder
- Bottom status bar: spinner while busy / hints + connection state
Key design points:
- reader generation counter prevents stale errors from the old
reader being mistaken for the new one after reconnect
- handleSubmit always returns waitServer when reader is alive,
so server responses to builtin commands like /status are received
- History stored as *History (was copying sync.Mutex by value)
- Chinese CJK wide-char aware word wrap with hanging indent
- /clear /exit /quit handled in TUI; other /cmds still go through
handleBuiltin with output captured to message area
Verified via tmux PTY: /help, /status, /clear, real chat with LLM
(reasoning -> tool_call -> response chain all render correctly).
The local llmsproxy AUTO chain tries 6+ slots across 3 tiers sequentially.
Each failed tier incurs busyWait (2s) + upstream timeout, so a full chain
exhaustion can exceed 120s. The llmsproxy logs showed 143 'context canceled'
errors for the homeagent key — the client gave up before the chain finished.
180s gives the chain enough room to complete before the client timeout fires.
Also remove stale backup files under /usr/local/bin/.
rawmode_linux.go only cleared ICANON|ECHO but left ISIG enabled,
so the terminal driver caught Ctrl+C and generated SIGINT.
signal.Notify caught the SIGINT but no goroutine consumed the
channel, effectively swallowing the signal.
Fix: also clear ISIG so Ctrl+C is delivered as byte 0x03,
which the line editor handles with os.Exit(130). Also set
VMIN=1, VTIME=0 for proper blocking read behavior.
editor.go read bytes one at a time; byte >= 0x20 was treated as
a single rune, so multi-byte UTF-8 chars (Chinese, emoji, etc.)
became garbled. Add decodeRune to reassemble multi-byte sequences
from the raw byte stream.
- Prune context BEFORE processing (LSTM forget gate pattern)
so LLM only sees relevant context, instead of pruning after the fact
- Fix ensureTrained() to recompute all event vectors after retraining
vectorizer, fixing feature-space mismatch between stored vectors and
query vector that made relevance scoring effectively random
- Add read lock to knowledge BuildTree() (data race fix)
- Log writeIndex() errors instead of discarding them
- Fix TOCTOU race in document ContextToDoc() dedup
- Fix healthcheck timing (measure elapsed before cleanup)
- Refactor waiter CLI into separate files (state, conn, config, editor,
history, builtin) for maintainability
- Add CLI plugin API key authentication
- Add explicit -chat flag for blocking one-shot requests
- Keep -say as deprecated alias for compatibility
- Preserve existing interactive mode for upcoming TUI rewrite
- Add structured CLI commands for status/kernel/settings/plugins/memory/knowledge/agents
- Inject core dependencies directly into CLI plugin for non-HTTP operator workflows
- Add plugin management panel and API proxy endpoints to WebUI
- Let cmd_run inherit default workdir from core.agent.workdir
- Use fixed loopback address for pluginmgr API
- Remove stale MaxToolTurns config usage from homed wiring