Accept set_route as model switch alias#296
Open
1jehuang wants to merge 11 commits into
Open
Conversation
Add a native macOS menu bar (NSStatusItem) indicator launched via `jcode menubar` that shows live counts of running jcode sessions and how many are actively streaming a model response, e.g. "⚡2 · 5 sessions". - Extend the active_pids registry with per-session streaming markers and a StreamingGuard RAII type; wire it into both streaming turn loops so the marker is set/cleared on every exit path. - Add session::session_counts() which scans active_pids/ and streaming_pids/, skipping stale entries whose owning PID is dead. - Implement `jcode menubar` (objc2/AppKit NSStatusItem with a 1s refresh timer); `--once`/`--json` print counts for scripting and non-macOS. - Tests for counting logic, stale-pid handling, the guard, and title/summary formatting.
…n macOS - Change the menu bar title format to the literal 'N streaming M sessions' - Auto-spawn a singleton background 'jcode menubar' helper on macOS session startup so the indicator shows up for every macOS user without running the command manually (opt out via JCODE_NO_MENUBAR)
OpenAI's is_retryable_error maintained its own narrower allowlist that omitted TLS-level transport failures (received fatal alert: BadRecordMac, connection aborted, DNS errors, etc.). Unlike Anthropic/Claude/Copilot/ OpenRouter, which all delegate to the shared is_transient_transport_error, OpenAI surfaced these transient failures to the user immediately (attempt=1, will_retry=false) instead of retrying. Delegate to the shared classifier and add regression test coverage.
…ation layer Split default keybindings into two explicit per-platform lists (macOS vs Windows/Linux) instead of one shared list plus runtime translation. Each default now records how it was chosen: - Dev: a developer explicitly chose it for the platform - Ai: an AI agent chose it - Automatic: derived programmatically (e.g. auto-translated) Add a check layer (validate_keybinding_defaults) that warns when the two lists drift apart: bound on one platform but missing on the other, or an auto-translated default whose counterpart was an explicit choice (so it can be confirmed or fixed). Warnings are logged once at startup. KeybindingsConfig::default() now resolves each field from the registry for the current platform.
Cmd+K / Cmd+J (vim-style) now jump between previous/next user prompts on macOS terminals that forward Command as Super/Meta, instead of falling through to line scrolling. The scroll fallbacks are cleared by default so the keys are free for prompt navigation, and Cmd/Super+Backspace now deletes the previous word rather than the whole input line. Updates tips, help overlay text, and tests accordingly.
On macOS, Cmd+Right is reported by some terminals as Ctrl+E (end-of-line), which unexpectedly opened $EDITOR (vi) over the TUI. Drop the external editor feature and restore the standard readline Ctrl+E behavior (move cursor to end of input).
Adds a SleepGuard RAII wrapper around an IOKit PreventUserIdleSystemSleep power assertion (same mechanism as caffeinate -i). The TUI run loops (local and remote) sync the guard with is_processing(), so the machine stays awake while jcode is streaming and the assertion is released as soon as the turn finishes. Opt out with JCODE_DISABLE_SLEEP_GUARD=1. Validated by a unit test that checks pmset -g assertions while the guard is held and after drop.
9db7980 to
1252aaf
Compare
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
set_routerequests as an alias forset_modelset_modelset_routedeserializationFixes #295
Test plan
cargo test -p jcode-protocol test_set_route_deserializes_as_set_model_compat_aliasrustfmt --check crates/jcode-protocol/src/wire.rs crates/jcode-protocol/src/protocol_tests/misc_events.rsselfdev build/scripts/dev_cargo.sh build --profile selfdev -p jcode --bin jcode