| 2026-07-11 |

Navi Code: force context compression via typed /compact control message
...
Forced /compact previously sent a chat message, which ran a full agent turn
that only produced summary text instead of running the real context compressor.
Worse, even when wired correctly, forced compact always reported "Nothing to
compact yet — the context is still small" regardless of context size: the typical
navi_code shape is a single long autonomous turn (1 user message + many tool
iterations = one turn), and partition_messages finds nothing to summarize when
turns <= keep_recent. The midturn auto-compress path already bypassed this via
keep_recent_messages (intra-turn split), but compact_stream passed
keep_recent_messages=None, so the fallback was disabled.
Changes:
- WS protocol: {"type":"compact"} control message (distinct from {"type":
"message"}); rejected while an agent turn is active to avoid racing the agent.
- Agent.compact_stream: forced compression that bypasses the token threshold
but still runs the real compressor; passes keep_recent_messages=max(12,
context_keep_recent*2) so a single long turn compresses via intra-turn split
(mirrors midturn auto-compress). Raises NothingToCompactError when context is
genuinely too small.
- Orchestrator.run_compact + clear_run: broadcast agent events to subscribers,
end with done marker, surface NothingToCompactError as an error event.
- Terminal client: ws_client.send accepts str|dict; CompactCommand enqueues
{"type":"compact"}; TUI distinguishes forced compact (no stream_start) from
in-turn auto-compress via the _streaming flag.
- Tests: compact_stream (incl. single-long-turn regression), WS handler
dispatch/rejection, run_compact event/error broadcasting, ws_client send,
compact command.
Co-Authored-By: Claude <noreply@anthropic.com>
Eugene Sukhodolskiy
committed
22 hours ago
|
Navi Code TUI: drop broken ctrl+x n / ctrl+x l session keybinds
...
Remove the non-working session-switching keybinds ctrl+x n (New) and
ctrl+x l (Sessions) and their action methods; /new and /sessions are still
reachable by typing them (with the inline hints) or via the palette. The
keybind field is cleared on both commands so hints/palette stop showing
them. ctrl+x q/c/t (quit/compact/thinking) are left intact.
Co-Authored-By: Claude <noreply@anthropic.com>
Eugene Sukhodolskiy
committed
1 day ago
|
Navi Code TUI: unify session commands on shared workers; /switch hybrid
...
Route /new, /sessions, and /switch through shared app-side logic instead of
each command reimplementing the switch path:
- _open_sessions_picker(): pushes SessionsPickerScreen and wires the select
callback to _switch_session_worker / _create_new_session_worker. Both
/sessions and /switch (no/ambiguous arg) use it.
- /new -> _create_new_session_worker (was: inline create + attach + clear).
- /switch <prefix>: resolve to a single navi_code session (exact id, then
prefix match) and switch directly via _switch_session_worker; no/ambiguous/
unknown arg opens the picker pre-filtered to what was typed. This removes
the latent clear()-after-attach bug from the old SwitchCommand (clear erased
the history that attach_session had just replayed).
- SessionsPickerScreen gains initial_query to open pre-filtered.
Co-Authored-By: Claude <noreply@anthropic.com>
Eugene Sukhodolskiy
committed
1 day ago
|
Navi Code TUI: sessions picker for /sessions (navi_code, full switch)
...
Replace the chat-printed session list with a modal picker:
- SessionsPickerScreen lists only navi_code-profile sessions (filtered by
settings.default_profile_id), with a filter input, a top "✚ New session"
row, and the current session marked. Up/Down + Enter to pick, Esc cancels.
- /sessions pushes the screen. Selecting an existing session runs
_switch_session_worker (persist via StateManager + attach_session, which
replays history and restarts the WS bridge — no chat_panel.clear() after,
since load_history already replaces the chat and clearing would erase the
replayed history). The "New session" row runs _create_new_session_worker.
Co-Authored-By: Claude <noreply@anthropic.com>
Eugene Sukhodolskiy
committed
1 day ago
|
Navi Code TUI: inline slash-command hints + Tab completion
...
Show a non-interactive list of matching commands above the input box while
the user types a '/'-command (no whitespace yet). Tab completes the prefix to
the canonical name of the top match. Enter already routed '/...' through
_run_command, so submitting a typed command executes it instead of sending
it to the agent — unchanged.
- CommandRegistry.match(prefix): case-insensitive prefix match on name and
aliases, exact match sorted first; empty prefix returns all.
- CommandHints(Static): purely visual, never takes focus, hidden by default.
- InputBox composes hints above the prompt and refreshes them on
TextArea.Changed.
Co-Authored-By: Claude <noreply@anthropic.com>
Eugene Sukhodolskiy
committed
1 day ago
|
Navi Code TUI: remove sessions table from right column
...
Drop the SessionsPanel widget and all dead code wired to it (handlers,
broadcast helper, session-list events, _refresh_sessions worker). The
/new, /sessions, /switch commands are preserved — they already operate
via app.attach_session / chat output rather than the panel.
Co-Authored-By: Claude <noreply@anthropic.com>
Eugene Sukhodolskiy
committed
1 day ago
|
| 2026-06-24 |
Navi Code TUI: review fixes for Phase 5
...
- Fix raw CLI session API fields (session_id/name/preview)
- Add --mouse/--no-mouse flags and persistent TUI settings coercion
- Make attach_session/apply_theme public, add ChatPanel.clear()
- Deduplicate session selection handlers and editor error handling
- Update docs and tests
Eugene Sukhodolskiy
committed
18 days ago
|
Navi Code TUI: Phase 5.2 — SessionsPanel, /export, integration tests
...
- Add right-side SessionsPanel widget (DataTable) listing server sessions.
- Wire SessionsPanel into TUI layout and session selection flow.
- Add SessionSelected / SessionListUpdated events and refresh logic.
- Implement /export slash command: markdown rendering + $EDITOR.
- Update /new, /sessions, /switch, /profile to use session_id/name/preview.
- Add integration tests for SessionsPanel and /export; update layout test.
- Update docs/navi_code_cli.md with new panel and command.
Co-Authored-By: Claude <noreply@anthropic.com>
Eugene Sukhodolskiy
committed
18 days ago
|
| 2026-06-23 |
Navi Code TUI: Phase 5.1 — config, mouse, themes, status
...
- Add TuiSettings persisted in ~/.navi_code/tui.json (theme, mouse, scroll_speed, diff_style, keybinds).
- TUI applies saved theme/mouse on startup; CLI gets --theme override.
- Add /themes picker with live preview and /mouse toggle command.
- Extend StatusPanel with backend URL, current theme, tokens/iter placeholders.
- Fix TuiContext.app() to use Textual active_app ContextVar.
- Add unit tests for settings, themes, and status panel.
513 passed, 1 skipped. Ruff clean.
Signed-off-by: Eugene Sukhodolskiy <eugene.sukhodolskiy@gmail.com>
Eugene Sukhodolskiy
committed
18 days ago
|
Navi Code: Phase 3 — Textual TUI skeleton (OpenCode-style)
...
- Add clients/terminal/tui package with micro-architecture:
- events, context, chat_model, ws_bridge, permissions engine.
- widgets: ChatPanel, StatusPanel, InputBox.
- renderers: user/assistant messages, thinking, tool calls, errors,
markdown, plain — registry-based and extensible.
- slash commands: /help, /new, /sessions, /switch, /profile, /thinking,
/compact, /quit — registry-based and extensible.
- Wire navi-code to launch TUI by default; keep click-CLI via --raw.
- Add textual>=0.70 dependency.
- Add TUI smoke tests via Textual Pilot.
- Add docs/plan_navi_code_tui.md with full Phase 4/5 roadmap.
Tests: 463 passed, 1 skipped (excluded unrelated websocket test).
Co-Authored-By: Claude <noreply@anthropic.com>
Eugene Sukhodolskiy
committed
19 days ago
|