Skip to content

feat(deeptide-rs): multi-protocol backends, themed TUI, reasoning display, local engines - #134

Merged
feizhenhua merged 1 commit into
mainfrom
feat/deeptide-rs-multiprotocol-tui
Jun 3, 2026
Merged

feat(deeptide-rs): multi-protocol backends, themed TUI, reasoning display, local engines#134
feizhenhua merged 1 commit into
mainfrom
feat/deeptide-rs-multiprotocol-tui

Conversation

@feizhenhua

Copy link
Copy Markdown
Contributor

Broadens the Rust deeptide CLI toward zero-cli parity and beyond — across protocols, TUI rendering, headless mode, KV-cache, and local-model UX. Default behaviour is unchanged (the dark theme reproduces the prior hard-coded colours, so every existing snapshot stays green).

Protocols & models

  • OpenAI (/v1/chat/completions) + Gemini (generateContent/SSE) backends behind the protocol-agnostic AgentBackend trait, alongside Anthropic — the agent loop, tools, and TUI are unchanged across protocols.
  • Reasoning display across all three protocols (StreamingEvent::ThinkingDelta): OpenAI reasoning_content (+reasoning alias / DeepSeek-reasoner), Gemini thought:true parts, Anthropic thinking_delta. Surfaced live (dim "💭 thinking"), kept out of the answer text and not echoed back next turn.
  • 11 local-inference presets (OpenAI-protocol, keyless): ollama, lmstudio, vllm/llama.cpp/llama, mlx/omlx, llamafile, koboldcpp, localai, jan, oobabooga, gpt4all — each at its documented default port. --list-providers lists them.

TUI rendering

  • Markdown italic, dependency-free code-fence syntax highlighting (syntax.rs), OSC-8 hyperlinks + bare-URL autolinking, word-level diff highlighting (word_diff.rs).
  • Theme system (theme.rs): dark/light/high-contrast via --theme, covering syntax highlight + diff preview + markdown accents.
  • Live spinner shows dynamic ↑/↓ token transfer (prompt vs output) plus a tok/s throughput pulse.
  • CJK/wide-char display-width handling (width.rs); strip_ansi now also strips OSC sequences.

Agent KV-cache

  • Rolling Anthropic prompt-cache breakpoint on the conversation tail (3 of 4 breakpoints: tools + system + conversation) so each turn reads the prior prefix from cache. Cached-token cost double-count fixed for OpenAI/Gemini.

Headless mode

  • json/stream-json exit-code contract (non-zero on failure, envelope still printed); stream-json tool/thinking events; permission_request emission + pre-queued permission_response handling.

Verification

cargo build / test / clippy --all-targets / fmt --check all green — 1269 tests, 0 warnings.

Known follow-ups (need live-API e2e, out of scope here)

  • Gemini request-side thinkingConfig enablement; Gemini cachedContent provisioning.
  • Anthropic thinking-block + signature round-trip for multi-turn thinking+tools (pre-existing).
  • Headless true bidirectional interactive permission (needs a background stdin-reader thread; this PR ships the pre-queue model).

🤖 Generated with Claude Code

…cal engines

Broaden the Rust deeptide CLI toward zero-cli parity and beyond, across
protocols, TUI rendering, headless mode, KV-cache, and local-model UX.

Protocols & models
- OpenAI (`/v1/chat/completions`) and Gemini (`generateContent`/SSE) backends
  behind the protocol-agnostic AgentBackend trait, alongside Anthropic; the
  agent loop / tools / TUI are unchanged across protocols.
- Reasoning display across all three protocols (StreamingEvent::ThinkingDelta):
  OpenAI `reasoning_content` (+`reasoning` alias / DeepSeek-reasoner), Gemini
  `thought:true` parts, Anthropic `thinking_delta`; surfaced live, kept out of
  the answer text.
- 11 local-inference presets (OpenAI-protocol, keyless): ollama, lmstudio,
  vllm/llama.cpp/llama, mlx/omlx, llamafile, koboldcpp, localai, jan,
  oobabooga, gpt4all — each at its documented default port.

TUI rendering
- Markdown italic, dependency-free code-fence syntax highlighting (syntax.rs),
  OSC-8 hyperlinks + bare-URL autolinking, word-level diff highlighting
  (word_diff.rs).
- Theme system (theme.rs): dark/light/high-contrast via `--theme`, covering
  syntax highlight + diff preview + markdown accents. `dark` reproduces the
  prior hard-coded SGR so all snapshots are unchanged.
- Live spinner shows dynamic up/down token transfer (↑ prompt / ↓ output) plus
  a tok/s throughput pulse.
- CJK/wide-char display-width handling via width.rs; strip_ansi now also strips
  OSC sequences.

Agent KV-cache
- Rolling Anthropic prompt-cache breakpoint on the conversation tail (3 of 4
  breakpoints: tools + system + conversation), so each turn reads the prior
  prefix from cache. Cached-token cost double-count fixed for OpenAI/Gemini.

Headless mode
- json/stream-json exit-code contract (non-zero on failure, envelope still
  printed); stream-json tool/thinking events; permission_request emission +
  pre-queued permission_response handling.

Verified: cargo build/test/clippy(--all-targets)/fmt all green (1269 tests).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@feizhenhua
feizhenhua merged commit c171c89 into main Jun 3, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants