Skip to content

Releases: sluisr/deepseek-cli

v1.3.0 — Reactive Autonomous Agents, Background Task Management & Routing Controls

Choose a tag to compare

@sluisr sluisr released this 19 Aug 17:29

DeepSeek CLI v1.3.0 — Comprehensive Release Notes

DeepSeek CLI v1.3.0 is a feature release introducing 24 optimizations, autonomous reactive execution, advanced background task management, non-interactive sudo elevation, network resilience, and enhanced UI controls.


1. Background Task Management & Reactive Agent Awakening

  1. 10-Second Auto-Backgrounding: Long commands exceeding 10s are automatically transitioned to background tasks (is_background: true), releasing the terminal immediately without freezing the UI.
  2. Reactive Agent Awakening (Zero Polling): Upon background process exit, output is captured and injected into DeepSeek when Idle. DeepSeek synthesizes and displays the final report proactively.
  3. Native Agent Tools (kill_background_process & write_background_input): Provides safe PID-based process termination and interactive stdin streaming for background commands.
  4. Mandatory Backgrounding Policy: System Prompt enforces is_background: true for scans (nmap), full-test runs, and heavy compilation tasks with immediate PID feedback.
  5. Strict sleep Ban: Prohibits active polling loops (sleep 30) to prevent LLM token waste and zombie subshells.
  6. Proactive Background Result Delivery: Instructs the model to check output files on state inquiries and report completed results immediately.
  7. Continuous Initial Execution: Sequences discovery (nmap -sn) directly into deep vulnerability scans without redundant conversational pauses.

2. Autonomous Permission System: $auto & $sudo

  1. One-Turn Autonomous Mode ($auto <prompt>): Promotes execution to ApprovalMode.YOLO for that turn, executing tools without confirmation prompts.
  2. Multi-Tool Cycle Persistence: Maintains YOLO approval across all tool steps within the user's turn until returning to Idle.
  3. Continuation Context Inheritance: Follow-up prompts ("continue", "proceed", "go ahead") automatically inherit $auto authorization.
  4. Inline Sudo Password Elevation ($sudo:PASSWORD): Memory-only session RAM password storage paired with askpass.cjs for 0ms silent root command execution (nmap -sS, systemctl). Password is never sent to the LLM API.
  5. Safe Command Auto-Approval (read-only.toml): Diagnostic commands (ping, curl, date, whoami, git status, cat) auto-approved by default.

3. Model Routing, Shortcuts & UI Controls

  1. Strict Model Selection Priority: Reordered OverrideStrategy in modelRouterService to guarantee explicit user selections (flash or pro) are never mutated by the complexity classifier.
  2. Direct Switch Commands (/model pro & /model flash): Instant model toggling with alias support.
  3. Dynamic Footer Reasoning Effort Badge: Real-time indicator for DeepSeek-V4-Pro (r:low, r:medium, r:high, r:max).
  4. Footer Task Indicator: Real-time badge in cyan displaying active background tasks (tasks (X running)).

4. Network Resilience, Search & Shell Flexibility

  1. Exponential Backoff Retry (fetchWithRetry): Automatic retry with exponential backoff and jitter upon HTTP 429 (Rate Limit) and 503 (Service Unavailable).
  2. Idle Stream Timeout (60s): Cancels stalled SSE connections if no bytes arrive within 60 seconds.
  3. Optimized Native Web Search: Native server-side search via deepseek-chat with dynamic timeouts tailored to reasoning levels.
  4. Unrestricted Shell Command Substitution: Enabled bash $() and backticks for compound terminal operations.

5. Packaging, Stabilization & Metadata

  1. Hanging Sockets & AbortSignal Fix: Complete AbortSignal propagation in fetch and SSE streams to eliminate zombie TCP sockets.
  2. Clean Manual Update UX: Replaced brittle global background updates with an informative update banner.
  3. Guaranteed Bundle Assets: Enforced automatic copying of README.md and LICENSE into bundle/ for NPM packages.
  4. SEO Keywords & Author Attribution: Enriched NPM metadata and official author info (sluisr <contact@sluisr.com> (https://sluisr.com/)).

DeepSeek CLI v1.2.0 — Agentic AI Terminal & Performance Edition

Choose a tag to compare

@sluisr sluisr released this 17 Aug 10:54

DeepSeek CLI v1.2.0 — Release Notes

DeepSeek CLI v1.2.0 is an extensive architecture upgrade and feature release, introducing native slash commands, atomic unified diff patching, server-side web search with configurable reasoning, dynamic temperature tuning for Flash models, zero-latency system authentication, and comprehensive multi-turn stability fixes for DeepSeek V4.


1. DeepSeek V4 Architecture & Reasoning Engine

Multi-Turn Chain-of-Thought (CoT) Preservation

  • The Problem in Previous Versions: During multi-turn conversations involving tool calls, intermediate reasoning content (reasoning_content) generated by DeepSeek models was dropped by upstream conversion layers. On subsequent turns, the DeepSeek API rejected the message sequence with HTTP Error 400 (Invalid tool response sequence).
  • The Solution in v1.2.0: Implemented _deepseekReasoning smuggling throughout tool execution turns and persistent disk caching in ~/.deepseek/reasoning_cache.json. Reasoning context is seamlessly preserved across complex tool execution cycles.

Strict Tool Sequence Sanitization (sanitizeToolCallSequences)

  • Eliminates orphaned tool response messages that lack a preceding assistant message with a matching tool_call_id.
  • Automatically synthesizes cancellation responses (Tool call was cancelled by the user.) when tool executions are aborted, ensuring DeepSeek API compliance at all times.

Dynamic Reasoning Effort Injection

  • Integrated dynamic payload injection for reasoning_effort (low, medium, high, max) and thinking: { type: 'enabled' }.
  • DeepSeek-V4-Pro dynamically adjusts its internal chain-of-thought token budget per request.

Streaming KV Cache Telemetry (Prompt Cache Hits)

  • Added stream_options: { include_usage: true } to streaming completions.
  • Handled standalone usage chunks emitted at the end of SSE streams to capture prompt_cache_hit_tokens and prompt_cache_miss_tokens.
  • Accurately tracks DeepSeek's 90% prompt cache discount in /stats and session summaries.

2. New Slash Commands

/fim <file> [<line> | <FIM_HOLE>] — Fill-in-the-Middle Code Completion

  • Directly leverages the official DeepSeek Beta completions endpoint (https://api.deepseek.com/beta/completions).
  • Supports marker-based completion (<FIM_HOLE>) as well as line-number-based insertion.
  • Slices target files into prefix and suffix buffers, sends them to the model, and atomically updates the file with the generated code.

/prefix <text> — Chat Prefix Completion

  • Routes chat requests to https://api.deepseek.com/beta/chat/completions with { role: 'assistant', content: prefix, prefix: true }.
  • Forces DeepSeek to continue directly from a specified prefix string (e.g. ````json\n{orexport async function`), eliminating conversational fluff and ensuring deterministic JSON or TypeScript output.
  • Subcommands and aliases: /prefix clear, /prefill, /continue-from.

/balance — Live Account Balance & Credit Lookup

  • Directly calls GET https://api.deepseek.com/user/balance.
  • Displays real-time account status (Active / Exhausted), available funds, topped-up balance, and promotional credits in USD or CNY without redundant metrics.
  • Aliases: /wallet, /credits.

/info — Author & Community Links

  • Displays author attribution for sluisr, version information, and official community links:
    • Website: https://sluisr.com/
    • GitHub: https://github.com/sluisr
    • YouTube: https://www.youtube.com/@sluisr_
  • Aliases: /author, /credits, /links.

3. Native Agent Tools & Performance

apply_patch — Atomic Unified Diff Patching

  • Introduces an atomic diff-based patching tool (packages/core/src/tools/apply-patch.ts).
  • Instead of rewriting entire source code files (which consumes thousands of output tokens and causes latency), DeepSeek outputs compact unified diff blocks (*** begin patch, --- a/file, +++ b/file).
  • Reduces token consumption by up to 80% per modification and eliminates file corruption risks.

web_search — Server-Side Search with Deep Reasoning Control

  • Migrated from client-side scraping to the native DeepSeek Responses API (tools: [{ type: 'web_search' }]).
  • Configurable Search Reasoning Effort: DeepSeek's server-side search engine can be configured with search_reasoning: low | medium | high | max, instructing the model to perform multi-step reasoning and cross-verification across crawled sources before synthesizing responses.
  • Generates structured grounding citations and source attribution links.
  • Seamless fallback keychain key resolution via loadDeepSeekApiKey().

Silent Zero-Latency AskPass for sudo, ssh, and git

  • Created packages/core/src/utils/askpass.ts, reading raw input directly from /dev/tty without echo or delay.
  • Injects SUDO_ASKPASS, SSH_ASKPASS, and GIT_ASKPASS into all spawned shell sub-processes.
  • Embedded custom sudo() wrapper inside BASH_SHOPT_GUARD to guarantee non-blocking root operations.

4. User Interface & Configuration

Interactive /model Dialog & Temperature Tuning

  • Flash Model Temperature & Creativity Control: Dynamic real-time temperature tuning for deepseek-v4-flash (e.g. 0.0 for deterministic syntax and strict coding, or higher values for creative drafting), hot-reloaded in memory without restarting the session.
  • Pro Model Reasoning Configuration: Interactive selector for Reasoning Effort (LOW, MEDIUM, HIGH, MAX).
  • Persistent Storage: Choose whether to save settings permanently to ~/.deepseek/pro_settings.json and ~/.deepseek/flash_settings.json, or apply them only for the active session.

Session Summary & Resume

  • Corrected session resume instructions on exit (/quit):
    To resume this session: deepseek --resume <session_id>
    

Automatic Update Notifications

  • Integrated background version checker against npm package @sluisr/deepseek-cli.
  • Detects the active package manager (npm, pnpm, yarn, bun) and outputs exact update instructions.

5. Summary of Differences (v1.1.1 vs v1.2.0)

Area Feature v1.1.1 v1.2.0
Commands /fim (Fill-in-the-Middle code completion) No Yes
Commands /prefix (Chat prefix completion) No Yes
Commands /balance (Live account balance) No Yes
Commands /info (Author credits and community links) No Yes
Tools apply_patch (Unified diff code patching) No Yes
Tools web_search (Native server-side Responses API) No Yes
Tools web_search reasoning depth control (low - max) No Yes
System Silent 0ms AskPass (sudo, ssh, git) No Yes
Core Multi-Turn CoT transport (_deepseekReasoning) No Yes
Core Tool call sequence sanitization (Error 400 fix) No Yes
Core KV Cache streaming usage metadata capture No Yes
UI Flash model dynamic temperature tuning No Yes
UI Interactive /model Pro & Flash configuration No Yes
Config Hot-reloading & persistence under ~/.deepseek/ No Yes
Branding Corrected deepseek --resume <id> summary No Yes

6. Installation & Upgrade

Install Globally

npm install -g @sluisr/deepseek-cli

Upgrade to Latest

npm install -g @sluisr/deepseek-cli@latest

7. Author & Community

DeepSeek CLI v1.1.1 — Robust Thinking Mode & Stability Refinements

Choose a tag to compare

@sluisr sluisr released this 01 May 20:14

Release Notes - DeepSeek CLI v1.1.1

Bug Fixes

  • Thinking Mode Stabilization (reasoning_content):
    • Issue: In "Thinking" (reasoning) mode, the DeepSeek V4 API requires that all assistant turns include the reasoning_content field, even when the model chooses not to emit reasoning tokens for a specific turn. Previously, if the reasoning was empty, the CLI omitted it, causing the API to reject the request with an HTTP 400 error (Bad Request - The reasoning_content in the thinking mode must be passed back to the API).
    • Solution: Session state tracking logic has been implemented. Once a conversation activates reasoning mode, the CLI ensures that the reasoning_content field is always present in outgoing payloads. If a particular turn lacks reasoning from the model, an empty string ("") is safely injected as reasoning_content. This ensures strict compliance with the DeepSeek v4 API contract and prevents the chat history from being corrupted and abruptly cutting off the work of multi-tool agents.

Under the Hood

  • Robust Intermediate Chunk Handling: Improvements to processStreamResponse to prevent premature discarding of hidden (smuggled) reasoning blocks when interleaved with tool calls and mixed content.
  • Synchronized Versioning: Full update to v1.1.1 across core and cli packages, as well as the main manifest.

Developed to maintain the stability of autonomous agents during long programming tasks.

feat: DeepSeek API v4 stabilization — release v1.1.0

Choose a tag to compare

@sluisr sluisr released this 29 Apr 15:40

DeepSeek CLI v1.1.0 — DeepSeek API v4 Stabilization

Released: 2026-04-29

This release stabilizes the native DeepSeek API v4 integration (thinking mode +
reasoning_content), adds cost/latency optimizations to the model router, fixes
the exit_plan_mode workflow, and completes the user-facing rebrand from
gemini to deepseek.

Highlights

  • DeepSeek v4 thinking mode is now stable. The HTTP 400 errors caused by
    missing reasoning_content between turns are fixed at the root.
  • Lower cost per session. Classifier no longer uses thinking mode and routes
    more tasks to the cheaper flash model. Tools are sent in stable order to
    improve DeepSeek's prompt cache hit rate.
  • exit_plan_mode works without a pre-existing plan file. Models can pass
    the plan inline via plan_content and the tool will materialize it before
    validating.
  • Consistent branding. All user-facing CLI commands now read deepseek
    instead of gemini (deepseek --resume, deepseek mcp, deepseek extensions update, etc.).

What's Changed

Fixed

  • DeepSeek v4 HTTP 400 — missing reasoning_content. The server requires
    every assistant turn that used thinking mode to be replayed with its
    reasoning_content on the following request. Two bugs caused this to fail:

    • getMessageKey produced different keys for tool_calls: undefined and
      tool_calls: [], so cached reasoning_content was looked up under the
      wrong key on the next turn and dropped.
    • The Gemini-style history filter stripped any non-text fields on assistant
      turns, removing the cached reasoning even when the lookup succeeded.

    Fix: cache key normalization + smuggling reasoning_content inside a hidden
    Part on the assistant message so it survives history filtering and is
    reattached when the message is mapped back to the DeepSeek request.

    Files: packages/core/src/core/deepseekContentGenerator.ts,
    packages/core/src/core/deepseekContentGenerator.test.ts (new).

  • exit_plan_mode "Invalid plan" error. When the model proposed a plan
    without first writing it to disk, approval failed because the validator could
    not find the plan file. The tool now accepts an optional plan_content
    argument; when provided it writes the plan inside the validated plans
    directory before approval.

    Files: packages/core/src/tools/exit-plan-mode.ts,
    packages/core/src/tools/definitions/dynamic-declaration-helpers.ts.

  • Branding inconsistencies. All user-visible references to gemini in CLI
    output, error messages, resume hints and tests are now deepseek.

    Files: packages/cli/src/ui/components/SessionSummaryDisplay.tsx (+ test &
    snapshot), packages/cli/src/commands/extensions/{update,new}.ts,
    packages/cli/src/commands/extensions/update.test.ts,
    packages/cli/src/commands/mcp/enableDisable.ts,
    packages/cli/src/config/extension-manager.ts,
    packages/cli/src/config/mcp/mcpServerEnablement.ts,
    packages/cli/src/acp/commands/extensions.ts.

Added

  • plan_content parameter on the exit_plan_mode tool declaration. When
    set, the tool writes the plan to the plans directory before validation,
    letting the model exit plan mode in a single step.
  • stream_options.include_usage: true on streaming requests, so the final
    SSE chunk carries the real token usage (no more zero-token rows in
    /stats).
  • prompt_cache_hit_tokens mapping. DeepSeek's cache-hit counter is now
    surfaced as cachedContentTokenCount in the Gemini-shaped usage metadata,
    with a debug log line on every hit.
  • DEEPSEEK_DEBUG environment variable. When set to a truthy value, the
    generator logs request/response shapes, cache hits/misses, and reasoning
    recovery decisions to stderr.
  • State directory ~/.deepseek/. The reasoning cache and debug logs now
    live under the user's home directory, independent of the working directory
    and any GEMINI_CLI_HOME overrides.
  • Regression test for getMessageKey cache key normalization
    (packages/core/src/core/deepseekContentGenerator.test.ts).

Changed

  • Classifier complexity threshold raised from 50 to 70. More tasks now
    route to deepseek-v4-flash instead of deepseek-v4-pro, reducing cost
    without observable quality regression on the eval set.
  • Classifier no longer uses thinking mode. Classification is a structured
    JSON output task and does not benefit from chain-of-thought; disabling
    reasoning saves both tokens and a full extra round-trip of latency.
    File: packages/core/src/routing/strategies/deepseekClassifierStrategy.ts.
  • Tools sent to the API in alphabetical order. Stable ordering improves
    DeepSeek's prompt-prefix cache hit rate across turns.

Upgrade notes

  • No configuration migration is required. Existing ~/.gemini/ settings are
    still read; only the runtime cache and debug logs move to ~/.deepseek/.
  • If you set GEMINI_CLI_HOME to work around earlier path issues, you can
    unset it — the duplication bug it caused has been removed upstream.
  • If you scripted around the old gemini --resume resume hint, switch to
    deepseek --resume.

Verification

# Smoke test
DEEPSEEK_API_KEY=sk-... deepseek --prompt "ping"

# With debug logging
DEEPSEEK_API_KEY=sk-... DEEPSEEK_DEBUG=1 deepseek --prompt "design a small REST API"

Tests: npx vitest run packages/cli/src/ui/components/SessionSummaryDisplay.test.tsx packages/cli/src/commands/extensions/update.test.ts
(16/16 passing) and npx tsc --noEmit -p packages/cli/tsconfig.json (clean).