Skip to content

v0.15.0 — Custom Commands, Hooks, Worktrees, Diagnostics, Speed Overhaul & DeepSeek Pro Fix

Latest

Choose a tag to compare

@github-actions github-actions released this 25 Nov 02:33
· 2 commits to main since this release

Release v0.15.0

Added

  • Custom Slash Commands (.corex/commands/*.md & ~/.corex/commands/*.md): drop any Markdown prompt template into .corex/commands/ (project) or ~/.corex/commands/ (global) with optional YAML description: frontmatter and $ARGUMENTS expansion to invoke it directly as /<name> inside the TUI, with live / popup autocomplete under the Custom group (project commands override global; built-ins keep precedence).
  • Session forking (/fork [tag]): clone the active conversation into an independent session with a fresh UUID while leaving the original session untouched on disk.
  • Terminal & desktop notifications: Corex now emits OSC 9 + BEL (and background notify-send on Linux / osascript on macOS) when pausing for tool approval or ask_user, or when finishing a turn that ran for ≥ 10 seconds (reporting "Turn failed" instead of "Turn completed" on errors, and staying silent on manual Esc cancellations). Enabled by default and toggleable in /settings ("notifications": false in settings.json) or via COREX_NOTIFY=0.
  • Global Lifecycle Hooks (PreToolUse, PostToolUse, OnStop): configure hooks in global ~/.corex/settings.json (never overridable by repository .corex/settings.json) to block or validate tool calls (PreToolUse non-zero exit), auto-format/lint after edits (PostToolUse), or trigger commands when a turn finishes (OnStop).
  • Headless CI/scripting upgrades (--output-format, --max-turns, and stdin pipe): cx -p now accepts --output-format text|json|stream-json (clean JSON / NDJSON output) and --max-turns <N>, and automatically reads piped stdin (git diff | cx -p "review" or cat error.log | cx, capped at 256 KB).
  • Isolated git worktree subagents & diagnostics tool: delegate_subagent now accepts isolated: true to run inside a detached temporary git worktree and return its unified diff without touching your working tree, and the new diagnostics tool auto-detects and runs native project type-checkers (cargo check, tsc --noEmit, pyright, go vet).
  • Live ⧉ copy buttons on completed code blocks during streaming: as soon as a fenced code block closes (```) while Corex is still generating the rest of a reply, safe_markdown_split_point commits it and renders its ⧉ copy button immediately—clickable (and reachable via Alt+Y) mid-stream—while keeping still-open code blocks buttonless until they finish so you never copy a half-written command.
  • Browser Bridge diagnostics and /browser command (/browser status, /browser repair): corex-browser now detects installed Chromium browsers (including Linux Flatpak paths), checks whether the Corex Browser Bridge extension (pgbencaoenigjeekljfindfeaolenaip) is actually installed in any browser profile and reads its version from manifest.json, verifies the Native Messaging manifest and launcher binary target, logs native host startup/errors to ~/.local/share/corex/browser-host.log, and fails fast (~1.5 s instead of hanging 25 s) with an exact diagnosis when the extension is missing, broken, or disconnected.
  • Turn MCP servers on or off (/mcp on, /mcp off, /mcp toggle): each McpServerConfig entry in ~/.corex/settings.json now supports "enabled": false (defaulting to true and omitted when true). /mcp off <name|all> (or /mcp disable) disables a server or all configured servers—unloading its tools and skipping subprocess spawn / remote connection on startup and /mcp reload while keeping its command, URL, headers and environment intact in settings.json. /mcp on <name|all> (or /mcp enable) turns it back on and reconnects its tools immediately, and /mcp toggle <name> flips its state. /mcp status and /mcp reload now display [ON] / [OFF] badges and active/disabled counts.
  • Multi-provider / multi-model exit summary: UsageMeter now tracks token usage, cache hits and costs per (Provider · Model) (ModelSpend), snapshotting the active provider and model at request time so switching models mid-stream never attributes a turn's tokens to the newly selected model. When more than one model is used during a session, the exit summary lists a Models breakdown with each model's input/output tokens, cache hit percentage and cost (or billed by the provider), followed by the session totals; if one model ran prompts and another was selected before quitting, the Model row shows UsedModel → ActiveModel.
  • /models alias for /model: typing /models now opens the model picker or switches models just like /model.
  • Command-not-found guard in TUI and CLI (thanks to @kbdd23): mistyped slash commands in the TUI (such as /modle, /helpp or /statss) and mistyped CLI subcommands or bare command words on the shell command line (such as cx updte, cx flet status, cx fleet stauts, cx /modle or cx model) now fail immediately with Command not found and a closest-command suggestion (Did you mean /model? / Did you mean 'cx update'?) instead of starting a session and sending the typo to the LLM as a prompt.

Changed

  • Cleaner ask_user interactive panel and history display: removed the redundant bottom border (Borders::TOP only, matching /settings, /model, /resume and /key) and dropped the duplicate › prefix from the question title so › is reserved exclusively for the option selector. ask_user tool calls in chat history, spinners and streaming previews now render ask <question> instead of raw ask_user [{"header":...}] JSON.
  • Enter in /settings confirms and closes the panel: ←/→ (and Space) change the selected setting (now saved asynchronously via spawn_blocking without stalling the UI thread), while Enter now closes /settings and returns to the chat instead of cycling the value (↑↓ select · ←→ change · enter done · esc close).
  • Honest subagent delegation rules and leaner per-request tool payloads: removed the outdated $0.00 cost claim and mandatory ALWAYS use scout rule from the system prompt so the model uses direct read_file, grep_search and glob calls for targeted lookups and reserves subagents for broad multi-directory work. The fleet tool schema is now omitted from requests when Fleet mode is closed and no nodes are configured, and the inline MCP schema threshold (INLINE_LIMIT) was lowered from 24 to 12 so larger MCP setups switch to on-demand mcp_search_tools / mcp_call_tool sooner.

Performance

  • Cloud provider TCP+TLS keep-alive pre-warming, off-thread prompt assembly and 0.10% idle CPU: LlmClient now silently pre-warms DNS, TCP and TLS 1.3 into its reqwest keep-alive pool at startup and on provider switches (saving ~100–350 ms of cold handshake latency on the first turn; skipped for local/unconfigured endpoints). App::start_stream_turn now runs PromptBuilder::build via tokio::task::spawn_blocking off the UI thread so periodic 60 s prompt-cache refreshes never stall Enter. The TUI event loop now blocks in kernel crossterm::event::poll(timeout) at 250 ms when idle instead of waking every 4 ms inside tokio::select!, dropping idle CPU from 1.60% back to 0.10% with instant keypress wakeup.
  • Zero-lag /model opening and tuning: refresh_providers_from_disk now calls Config::providers_from_disk() (one read of settings.json, zero keyring IPC) instead of a full Config::load_with_workspace (five disk reads plus a blocking D-Bus Secret Service round-trip on the UI thread). Changing models or tuning reasoning/temperature in /model now persists state.json, settings.json, flash_settings.json and pro_settings.json on tokio::task::spawn_blocking via save_preferences_with_workspace (reading settings.json once instead of three times and skipping keyring writes when credentials did not change). Slash commands other than /mcp no longer block waiting for background MCP startup handshakes to finish.
  • Immediate token rendering and 60 FPS stream coalescing in the TUI event loop: run_tui now drains event_rx before terminal.draw, wakes immediately via tokio::select! when stream deltas arrive instead of blocking the async runtime for 33–80 ms inside crossterm::event::poll, draws the first token delta after a pause with 0 ms delay, and coalesces high-frequency SSE token bursts into 16 ms (60 FPS) frames instead of redrawing the entire terminal on every individual TCP/SSE packet.
  • Cached local LLM health checks, in-memory keyring cache and off-thread forensic logging: LocalLlmClient::ensure_healthy caches successful /models probes for 15 s to avoid an extra HTTP round-trip before every local turn, Config::load_credentials caches OS keyring lookups in memory (read_keyring_cached, cutting repeated Config::load_with_workspace calls from ~117 ms of D-Bus Secret Service IPC to ~1.2 ms), ForensicLogger::redact_secrets uses fast ASCII byte-prefix dispatch and contiguous slice copying (~73x faster: 125 ms → 1.7 ms per 100 KB), and ForensicLogger::log_llm_request_bytes runs on spawn_blocking when enabled.
  • Multi-threaded grep_search and glob across all CPU cores: GrepTool and GlobTool now use ignore::WalkBuilder::build_parallel() across up to 12 hardware threads with atomic early termination when max_matches / GLOB_COLLECT_LIMIT is reached (~3.6x–5x faster workspace searches), and ReadManyFilesTool offloads its directory walk and file reads to tokio::task::spawn_blocking so it never starves Tokio async workers.
  • Batch MCP tool registration ($O(N)$), lock-free remote HTTP MCP calls and zero-freeze first prompt submission: ToolRegistry::register_many registers MCP tool batches and rebuilds the deferred MCP search/call index once at the end instead of on every tool (cutting registration of 274 MCP tools from 148 ms / 262 index rebuilds to <1 ms). HttpTransport now uses fine-grained RwLocks for session_id and protocol_version instead of holding a transport-wide tokio::sync::Mutex across network awaits so parallel tool calls to the same remote HTTP MCP server run concurrently. Pressing Enter on the first prompt now polls ready MCP tools non-blockingly (poll_mcp_tools), pre-warms PromptBuilder's skill/memory disk cache in the background at startup, and offloads HistoryStore::append to spawn_blocking, eliminating the 1–3 s UI freeze on the first message while slow MCP servers finish connecting in the background.
  • $O(1)$ per-token expanded Thought rendering, incremental markdown splitting and $O(1)$ streaming tool previews: ThinkingState now caches wrapped lines up to committed_len and only wraps newly completed lines plus the active trailing line when expanded (eliminating $O(N^2)$ full-buffer re-wrapping on reasoning streams). render_chat_ui scans safe_markdown_split_point incrementally from streaming_md_committed_len instead of byte 0, and build_streaming_tool_preview_lines extracts primary JSON fields from a bounded 2 KB window (extract_streaming_json_field) instead of running failing serde_json::from_str parses and full-string replacements across 50+ KB write_file/edit argument buffers on every token delta.
  • Zero-allocation pre-request pruning, $O(N)$ history capping, pinned SSE idle timers and non-blocking TUI saves: LlmClient::truncate_tool_outputs, spill_large_output, trim_with_spill, head_tail and prune_tool_results check byte length and markers on &str before allocating or counting UTF-8 characters and slice via single-pass char_indices(). cap_history_with_limit updates token counts incrementally ($O(N)$ instead of $O(N^2)$) and estimates extra_content JSON byte sizes without .to_string(). All four SSE stream loops (OpenAI/DeepSeek, Anthropic, Responses API, LocalLlmClient) reuse a single pinned tokio::time::Sleep via .reset(...) instead of allocating a new timer future on every SSE chunk. Session::save_async avoids double-cloning the session and deduplicates base64 image hashing across messages and history (externalize_pair), /resume previews load via text-only Session::load_preview_by_id without decoding .images/ from disk on the render thread, run_one_tool spills oversized tool outputs on the background worker task instead of the UI thread, and cancel_generation, deny_current_call, apply_rewind and Fleet mode transitions now use save_async().
  • Non-blocking, cancellable /compact, anti-thrashing hysteresis and incremental TUI cache preservation at 80%–100% context: /compact (and /compress) now runs asynchronously in the background with a live "Compacting context..." indicator (StreamEvent::Compacting in auto-compaction and CLI too), queuing submitted prompts safely and cancelling immediately on Esc or Ctrl+C (compact_messages_cancellable, bounded to 60 s Cloud / 25 s Local with automatic fallback to extractive summarization). prune_tool_results now accounts for non-message schema overhead, clears last_prompt, and requires ~12.5% headroom below the compaction threshold before skipping semantic summarization (avoiding back-to-back KV-cache invalidations on consecutive turns), while an anti-thrashing guard skips repeated auto-compactions when uncompactable anchors hold the window high and newly accumulated turns represent <10% of the threshold. App::apply_compaction preserves already-rendered cached_message_lines across compactions instead of re-parsing the entire Markdown history on the UI thread.
  • Compact system prompt, keyword-dense skill catalog, grouped subagent tool, and lock-free hook/forensic I/O: deduplicated CORE_ENGINEERING_MANDATES and CORE_TOOL_ENFORCEMENT against JSON tool schemas and compacted # AVAILABLE PROCEDURAL SKILLS index descriptions (retaining all domain and bilingual trigger keywords while loading full SKILL.md guides via activate_skill), unified delegate_subagent + manage_subagents into a single subagent tool (keeping legacy names and get_internal_docs as callable aliases), trimmed redundant prose and unused schema fields (tracker, browser, corex_settings, save_memory), cached load_global_hooks() in memory by (mtime, size) with a 2 s stat window, moved ForensicLogger secret redaction and disk writes to a dedicated background thread, overlapped MCP/prompt/fleet startup in cx -p while omitting fleet when no nodes are configured, and omitted hosted web_search on tool-less Azure Responses API calls.
  • Concurrent post-exit pipe draining and single-round-trip Fleet SSH connect: ShellTool drains stdout and stderr concurrently with tokio::join! when a child exits (halving the post-exit timeout from 1,000 ms to 500 ms when background grandchildren hold pipes open), and RemoteSession::connect in corex-fleet probes latency and initial working directory in a single pwd SSH invocation instead of two sequential ssh spawns (exit 0 + pwd).

Fixed

  • DeepSeek Pro (deepseek-v4-pro) rejected with HTTP 400 from Flash-only request features (#4, thanks to @KirilMT): title generation ({"enabled": true}), latest_reminder message insertion, and replayed server_tool_calls were sent for all DeepSeek models rather than strictly deepseek-flash, causing deepseek-v4-pro requests to fail with HTTP 400. All Flash-only request features are now gated strictly on api_model == "deepseek-flash", legacy -m deepseek-v4.1-flash-1017 normalizes to deepseek-flash as required by the API, the built-in DeepSeek Pro catalog entry uses the canonical deepseek-v4-pro ID and ["max", "high", "low"] effort levels (fixing /models window lookup and usage labels), and -m deepseek-v4-pro now applies pro_settings.json instead of inheriting Flash's reasoning level.
  • /directory add autocomplete hid home folders as soon as you typed their name: /directory add initially listed ~/ folders, but typing a bare name without ~/ (e.g. /directory add five) switched folder_matches to search only the current workspace and required a strict prefix match, making the folder disappear. Bare names now search both the workspace and ~/ (returning ~/…) and match both prefixes (first) and substrings (second).
  • Headless CLI StatusSpinner::stop() leaked ^[[2K ANSI escape sequences to non-TTY stdout: stopping an inactive spinner unconditionally wrote ^[[2K, polluting piped output and breaking json.loads on --output-format json / stream-json. StatusSpinner::stop() now clears the line only when the spinner was actually started on a TTY.
  • Parallel web_search calls rendered raw JSON (web "{"queries": [...]"): web_search accepts both "query": "..." and parallel "queries": ["...", ...], but the TUI settled view, streaming tool preview, spinner summary and headless CLI only extracted "query" and fell back to the raw JSON string. All four now extract and deduplicate both "query" and "queries" (including partial streaming JSON arrays) and render them cleanly as web "q1" · "q2" (with (+N) when collapsed and full list on Ctrl+O).
  • Slash-command search ranked hidden aliases ahead of primary command names: typing /w highlighted /balance (via its /wallet alias) above /web because prefix matches on aliases shared the same rank as prefix matches on primary names. match_commands now ranks primary-name prefix matches first (Rank 0), alias prefix matches second (Rank 1), primary-name substrings third (Rank 2) and alias substrings fourth (Rank 3), so /w puts /web first and /se puts /settings first.
  • Esc / Ctrl+C while a modal panel was open cancelled the active generation instead of closing the panel: early_key intercepted Esc and Ctrl+C when app.is_streaming was true before any modal handler ran, so pressing Esc in /settings, /model, /resume, /tasks, /key or /rewind while the agent worked cancelled the reply behind the panel and left the panel open. early_key now yields Esc and Ctrl+C to any open modal dialog first, so the first Esc closes the panel without interrupting the agent.
  • Pasted images ([Image #N]) wiped when queuing or steering a message while streaming: submit cleared input_buffer after pushing a message to message_queue or steer_messages, and record_prompt_edit immediately called self.images.clear() on seeing an empty composer, destroying the image bytes before the queued message was sent (leaving the model with plain [Image #1] text and causing it to search the filesystem for the image). prune_unreferenced_images now keeps any image still referenced by the composer, undo history, message_queue or steer_messages.
  • DeepSeek, Anthropic and Responses API KV prefix cache invalidation from synthetic or mid-session system messages: insert_latest_reminder now skips synthetic TASK_DONE| and SUBAGENT_DONE| messages as well as tool-image user messages and reads display_text() so multipart user messages carrying [Image #N] preserve the user's language without shifting latest_reminder mid-turn. In anthropic.rs and responses_api.rs, mid-session <CONTEXT_SUMMARY>, TASK_DONE|, SUBAGENT_DONE| and USER_SHELL| system messages are kept in chronological order inside the conversation timeline as <system-notification> turns instead of being hoisted into the top-level system / instructions field (which invalidated 100% of the root prompt cache and hid background task reports from the end of the timeline).
  • Local LLM streams cut off at 60 seconds and headless CLI missing TTFT spinner: LocalLlmClient used a 60 s total request .timeout(...) instead of .read_timeout(300s), abruptly terminating active local generations at the 60 s mark. In headless CLI mode (cx -p), StatusSpinner now starts before LlmClient::stream_chat awaits the first SSE event so the terminal shows "Thinking..." immediately during TTFT, auto-compaction and retries.
  • OpenAI, Azure AI Foundry, Gemini and OpenRouter cache hits and Local LLM streaming token usage: Usage now deserializes prompt_tokens_details.cached_tokens alongside DeepSeek's prompt_cache_hit_tokens, ForensicLogger no longer applies DeepSeek dollar rates to other cloud providers, and LocalLlmClient sends stream_options: { include_usage: true } and reads past finish_reason until [DONE] so local streaming token counts are captured.
  • Activity spinner stuck on the last tool name after tool completion: start_stream_turn mutated active_status directly without updating status_transition, leaving Reading file: ... frozen on screen while the model thought or loaded another file. It now calls set_status("Generating...").
  • Broader text-only model detection and image note tool name: can_see_images, is_image_rejection_error and the local LLM path now recognise text-only models across providers and local servers, and the note left for pruned older images now points to read_file instead of the unlisted read_image alias (while still restoring sessions saved with the old note).
  • 100% context-overflow recovery on smaller windows, post-compaction token tracking, and subagent compaction loop: compaction_transcript_limit now scales the summarization transcript down to fit smaller (32k–128k) model windows instead of sending up to 400k chars (~133k tokens) and triggering a second 400 context_length_exceeded error, and bounds local SLM compaction digests to 24k chars. Overflow recovery at 100% now runs asynchronously, compacts conversations as short as 5 messages (force = true), falls back to emergency tool-output truncation and cap_history_with_limit (70%) when giant anchors keep the payload >85% full, and records note_prompt_size using the post-compaction message count (sent_messages) so ctx % and LlmClient::context_tokens stay synchronized. Subagents (run_subagent_llm_loop_with) now apply StreamEvent::ContextCompacted instead of ignoring it and re-compacting on every remaining turn.
  • Fleet prompt tool name, Google Gemini tool schema compatibility, Azure DeepSeek anti-drift anchor, and workspace gpt-* routing: PromptBuilder::build_fleet now instructs the model to call the declared fleet tool (action: "run_command") instead of the hidden fleet_run_command alias; LlmClient::sanitize_tools_for_google strips additionalProperties and supplies "type": "string" on untyped properties (with primitive string coercion in corex_settings) so Google Gemini's OpenAI adapter does not drop tool connections; DeepSeek deployments on Azure/OpenRouter now receive apply_recency_anchor against CJK language drift; and Config::external_provider routes unlisted gpt-* and o1/o3/o4 models by prefix when active_provider is unset.

Canonical Release Checksums (SHA-256)

Platform Archive File SHA-256 Checksum
macOS Apple Silicon corex-v0.15.0-aarch64-apple-darwin.tar.gz 47094a7224859ca3529039315c016b67f29f1dfce33385485083b66bb906efa7
Android Termux corex-v0.15.0-aarch64-linux-android.tar.gz 4b39c90ac8a84e6f4104144bbd40bab0a0ac5f305e5403c35fb035e7cb00a9d9
Linux ARM64 corex-v0.15.0-aarch64-unknown-linux-gnu.tar.gz 69d0fb1b92f651789e9d78a42bd53ce58236720fac9d63c9369fda2161b6a95b
macOS Intel corex-v0.15.0-x86_64-apple-darwin.tar.gz ead47c4b54e2b5a0621631c82952e5e5112c17d3c2fa9b25721b114dbe15a532
Windows x86_64 corex-v0.15.0-x86_64-pc-windows-msvc.zip 86695d23811dddcbb163cb4c9a42e2022415cafea51059fd26b49c6d81799ff2
Linux x86_64 corex-v0.15.0-x86_64-unknown-linux-gnu.tar.gz f15864808cfca061774bc9f7b8ba42fec951457333b6f2d70f5a165c6f4f3aa5

Installation & Upgrade

Via In-Place Self-Updater

cx update

Via npm

npm install -g @sluisr/corex
# or run directly:
npx @sluisr/corex

Pre-compiled Binary (Linux, macOS, Android Termux)

curl -fsSL https://raw.githubusercontent.com/sluisr/corex/main/install.sh | bash

From Source via Cargo / Crates.io

cargo install corex-cli --locked

Via Nix Flake

nix run github:sluisr/corex