5f223adea6
Adds a structured rlm_query tool for parallel/batched LLM fan-out. The model calls it with one prompt or up to 16 concurrent prompts; children dispatch via tokio::join_all against the existing DeepSeek client. Default child model is deepseek-v4-flash; override per-call via the model field. Available in Plan / Agent / YOLO. Cost folds into the session's running total automatically. Fixes scroll-stuck regression (#56): TranscriptScroll::resolve_top and scrolled_by now use a three-level fallback chain (same line → same cell line 0 → nearest cell at-or-before) instead of teleporting to ToBottom when an anchor cell vanishes. Loosens command-safety chains (#57): cargo build && cargo test and similar chains of known-safe commands now escalate to RequiresApproval instead of being hard-blocked as Dangerous. Chains containing unknown commands still block. Suppresses the GettingCrowded footer chip — context-percent header already covers conversation pressure. Refactors: - Extracts file_mention parsing/completion/expansion (~450 LOC) from the 5,500-line ui.rs into crates/tui/src/tui/file_mention.rs. - Deletes truly unused helpers (write_bytes, timestamped_filename, extension_from_url, output_path, has_project_doc, primary_doc_path). Tests: 853 pass. cargo clippy --workspace -D warnings clean. cargo fmt --all -- --check clean. Closes #46 #47 #48 #49 #50 #53 #54 #55 #56 #57 #58.
2.0 KiB
2.0 KiB
Project Instructions
This file provides context for AI assistants working on this project.
Project Type: Rust
Commands
- Build:
cargo build - Test:
cargo test --workspace --all-features - Lint:
cargo clippy --workspace --all-targets --all-features - Format:
cargo fmt --all - Run:
cargo run -p deepseek-tui
Build Dependencies
- Rust 1.85+ (for the workspace)
Documentation
See README.md for project overview, docs/ARCHITECTURE.md for internals.
DeepSeek-Specific Notes
- Thinking Tokens: DeepSeek models output thinking blocks (
ContentBlock::Thinking) before final answers. The TUI streams and displays these with visual distinction. - Reasoning Models:
deepseek-v4-proanddeepseek-v4-flashare the documented V4 model IDs. Legacydeepseek-chatanddeepseek-reasonerare compatibility aliases fordeepseek-v4-flash. - Large Context Window: DeepSeek V4 models have 1M-token context windows. Use search tools to navigate efficiently.
- API: OpenAI-compatible Chat Completions (
/chat/completions) is the documented DeepSeek API path. Base URL configurable for global (api.deepseek.com) or China (api.deepseeki.com);/v1is accepted for OpenAI SDK compatibility, and/betais only needed for beta features such as strict tool mode, chat prefix completion, and FIM completion. - Thinking + Tool Calls: In V4 thinking mode, assistant messages that contain tool calls must replay their
reasoning_contentin all subsequent requests or the API returns HTTP 400.
Important Notes
- Token/cost tracking inaccuracies: Token counting and cost estimation may be inflated due to thinking token accounting bugs. Use
/compactto manage context, and treat cost estimates as approximate. - Modes: Three modes — Plan (read-only investigation), Agent (tool use with approval), YOLO (auto-approved). See
docs/MODES.mdfor details. All three modes can call therlm_querytool for parallel/batched LLM fan-out (crates/tui/src/tools/rlm_query.rs).