Fix windows login focus flicker#1321
Fix windows login focus flicker#1321paramount-t wants to merge 23 commits intoHmbown:fix/windows-update-revocationfrom
Conversation
Pre-tag fix for v0.8.23. Resolves Windows users hitting CRYPT_E_NO_REVOCATION_CHECK on `deepseek update`.
Extend load_user_commands() to scan workspace-local command directories in addition to the global ~/.deepseek/commands/. Precedence model mirrors skills_directories(): project-local shadows global by name. Scanned directories (in precedence order): 1. <workspace>/.deepseek/commands/ 2. <workspace>/.claude/commands/ (Claude Code interop) 3. <workspace>/.cursor/commands/ (Cursor interop) 4. ~/.deepseek/commands/ (user-global fallback) Workspace context threaded through: - try_dispatch_user_command (has App reference) - user_commands_matching (new workspace parameter) - all_command_names_matching (new workspace parameter) - slash_completion_hints (new workspace parameter) Closes Hmbown#1259
Files inside .deepseek/, .cursor/, .claude/, and .agents/ were invisible to @-mention Tab-completion when those directories were listed in .gitignore (the common case). The walk_for_completions and build_file_index paths now walk these directories separately with gitignore disabled, merging results into the main candidate list. Also excludes .deepseek/snapshots/ from the dot-dir walk so the snapshot side repo (which can reach hundreds of GB, see Hmbown#1112) is never indexed. The fix applies to: - @-mention Tab-completion (walk_for_completions) - Fuzzy file resolution (build_file_index) - Ctrl+P file picker (collect_candidates)
…mbown#1250, Hmbown#1256) MCP servers are allowed by spec to paginate list responses. The old implementation made a single request and stopped, silently dropping subsequent pages. Servers that paginate at fewer items than their total tool count (e.g. gbrain at 5 per page) would appear to expose only those first few tools. All four discovery methods now follow nextCursor until the server signals no more pages, accumulating results across all pages: - discover_tools - discover_resources - discover_resource_templates - discover_prompts Thanks to Liu-Vince for the original diagnosis and fix (PR Hmbown#1256).
Adds a disk-space guard before each snapshot: if the snapshot directory exceeds MAX_SNAPSHOT_SIZE_MB (500 MB), the oldest snapshots are pruned aggressively to stay under PRUNE_TARGET_MB (400 MB). If pruning cannot get under the limit, the history is wiped so the next snapshot starts fresh. The guard runs in snapshot() before git add/write-tree/commit-tree so disk pressure is relieved BEFORE taking another snapshot. Includes dir_size_mb() helper and regression tests. Thanks to Giggitycountless for the original max_size_mb proposal (PR Hmbown#1131).
Hmbown#1118, Hmbown#1129) Adds a directive to the ## Language section telling the model that project context (AGENTS.md, auto-generated instructions, file trees, skill descriptions) is NOT a language signal. Chinese filenames in a repo should not bias the model toward Chinese replies when the user writes in English.
Previously clear_todos() only cleared the plan_state — the SharedTodoList was never touched. Now it clears both: the todo list (via try_lock on self.todos) and the plan state. The caller in commands/core.rs already called clear_todos() on /clear; it just had nothing to clear.
Version bump: 0.8.23 → 0.8.24 in workspace Cargo.toml. CHANGELOG entries for: - Workspace-local slash commands (Hmbown#1259) - @-completion for gitignored dot-dirs - MCP paginated discovery via nextCursor (Hmbown#1250, Hmbown#1256, credit Liu-Vince) - Snapshot disk-space cap at 500 MB (Hmbown#1112, credit Giggitycountless) - /clear resets Todos sidebar (Hmbown#1258) - Language directive strengthened against project-context bias - Known issue: Windows flicker (Hmbown#1260, Hmbown#1251) — viewport-reset escape sequence on Windows conhost, investigation in progress
…tion (Hmbown#1196) Merge of PR Hmbown#1196 by wplll. Adds: Cache-aware prompt layering: - PromptBuilder struct separates prompt construction from inspection - System prompt split into named layers with stability classification - Layers classified as static/history/dynamic for cache debugging /cache inspect command: - SHA-256 hashes of each rendered prompt layer - Base static prefix hash vs full request prefix hash - Static prefix stability status across turns - First-divergence tracking from previous request Wire payload optimization: - Tool result budget: large outputs compacted before API request - Tool result dedup: repeated outputs replaced by compact refs - Turn metadata dedup: repeated <turn_meta> blocks deduplicated - Wire-only: local session messages remain unchanged Project context pack: - Deterministic workspace summary injected into stable prefix - Configurable via [context] project_pack = false Cache warmup and improved footer cache display. Thanks to wplll for the contribution.
中止 implies a temporary pause that can be resumed; 终止 means a
definitive end, which matches the English "Abort the turn" / "abort"
semantics of this action.
Update both the option label ("终止本轮") and the Esc key footer hint
("Esc:终止") in the approval/elevation widget.
Fixes Hmbown#1273
Pre-existing gap exposed during v0.8.24 testing: when the user clicks away (Cmd+Tab, opens the screenshot tool, etc.) and clicks back, some terminals drop the application's mouse-tracking mode. The \`FocusGained\` handler at \`ui.rs::1599\` already re-pushed keyboard enhancement flags to recover IME state — extend the same recovery to \`EnableMouseCapture\` so wheel scroll keeps working after a focus round-trip. Gated on \`app.use_mouse_capture\` so explicit \`--no-mouse-capture\` users aren't re-enabled against their will.
…fault CHANGELOG additions: - Top-line credit summary: wplll, Liu-Vince, Giggitycountless, SamhandsomeLee, barjatiyasaurabh, tyculw, hongyuatcufe, ljlbit. - New "Added" section properly documenting Hmbown#1196 (cache-aware diagnostics, /cache inspect, /cache warmup, payload optimization, Project Context Pack). Calls out that the Pack is default-on, adds ~1–10 KB to every prompt, and how to opt out via [context] project_pack = false. - Per-item issue reporter credits across the Fixed section. - Removed Hmbown#1129 from the i18n entry — that's a separate bug we did not actually fix (wrong env var name in HTTP system prompt). README updates: rewrote the "What's New" section in both README.md and README.zh-CN.md to v0.8.24 with all the same credits and the project_pack opt-out note.
Bugfix + community PR release. See CHANGELOG.md for full notes.
Size the config key column from the available setting keys so long keys like paste_burst_detection remain fully visible without pushing the value and scope columns out of alignment. Add a regression test covering long config keys and scope column alignment.
Add direct POST-based MCP transport for Streamable HTTP servers while keeping the existing SSE endpoint-discovery path as a fallback. Parse both JSON and text/event-stream responses so servers like DeepWiki can be validated and used.
…mbown#1290) Closes Hmbown#1288. Long setting keys like `paste_burst_detection` were pushing Value and Scope columns out of alignment because the layout used a fixed 19-char minimum. Now the key column width is computed from the actual rows (with 19 as a floor) and shared between the header and each row. Header divider widens accordingly. Tests added. Thanks @reidliu41.
Closes Hmbown#1273. 中止 implies a temporarily-stoppable action; 终止 is the definitive 'end the turn' semantics that matches the English 'Abort the turn'. Updates two strings in the approval dialog (`option_abort` and the footer controls hint). Thanks @Liu-Vince.
Closes Hmbown#1278. The docs page sets per-section `scroll-mt-32` (8rem) on each anchor section to clear the sticky nav, but the global `[id] { scroll-margin-top: 5rem }` rule loaded later with the same specificity, so 5rem won. Wrapping the global rule in `:where(...)` drops its specificity to 0, letting the page-level Tailwind utility win while still providing a fallback for anchors elsewhere on the site. Thanks @Wenjunyun123.
…mbown#1300) Closes Hmbown#1266 (DeepWiki at https://mcp.deepwiki.com/mcp). URL-based MCP servers now try the modern Streamable HTTP transport first — POST JSON-RPC to the base URL with `Accept: application/json, text/event-stream`, accept either JSON or SSE response — and fall back to the older SSE endpoint-discovery flow on incompatible status codes (404/405/406/415/501). Existing SSE servers keep working via the fallback. Single-file change in `crates/tui/src/mcp.rs` with a tokio-based end-to-end test that exercises the full handshake. Thanks @reidliu41.
There was a problem hiding this comment.
Code Review
This pull request implements the v0.8.24 release, introducing cache-aware prompt diagnostics, workspace-local slash commands, and paginated MCP discovery. It also adds a disk-space cap for snapshots and fixes TUI focus and mouse-tracking issues. Feedback focuses on performance optimizations, specifically caching tool result hashes and configuration view layout widths to reduce redundant calculations. Improvements were also suggested for the snapshot pruning efficiency and the platform-gating logic for focus events to maintain compatibility across non-Windows systems.
| seen_tool_results: &mut HashMap<String, SeenToolResult>, | ||
| ) -> WireToolResult { | ||
| let original_chars = content.chars().count(); | ||
| let sha = sha256_hex(content.as_bytes()); |
There was a problem hiding this comment.
Calculating the SHA256 hash of the full tool result content on every turn is a potential performance bottleneck. Since the conversation history is re-processed into wire messages for every request, large tool results in the history will be hashed repeatedly. For a long session with multiple large tool outputs, this can lead to significant latency. Consider computing the hash once when the tool result is first received and caching it within the message structure.
| for _ in 0..10 { | ||
| let _ = self.prune_older_than(age); | ||
| if let Ok(new_size) = dir_size_mb(&self.git_dir) | ||
| && new_size <= PRUNE_TARGET_MB | ||
| { | ||
| tracing::info!( | ||
| target: "snapshot", | ||
| new_size_mb = new_size, | ||
| "pruned snapshot storage back under limit" | ||
| ); | ||
| break; | ||
| } | ||
| age = age.saturating_sub(Duration::from_millis(100)); | ||
| } |
There was a problem hiding this comment.
The pruning logic is inefficient. dir_size_mb is an expensive O(N) operation that recursively walks the directory and performs metadata syscalls for every file. Calling it up to 10 times within a loop on every snapshot can cause noticeable UI lag. Additionally, if the side repo is a git repository, deleting refs (via prune_older_than) does not immediately reduce the disk usage of the .git directory until a garbage collection or prune operation is performed. The current logic only calls prune_unreachable_objects in the fallback case. Consider pruning once and then checking the size, or performing a GC operation if the size must be verified immediately.
| } | ||
|
|
||
| fn should_enable_focus_change_events() -> bool { | ||
| cfg!(target_os = "macos") |
There was a problem hiding this comment.
Gating focus change events exclusively to macOS may cause regressions on Linux. Many Linux terminal emulators support focus events, and they are often used for IME handling and other focus-aware features. Since the goal is to fix a Windows-specific flicker issue, it would be safer to gate this as !cfg!(target_os = "windows") or specifically target Windows for exclusion.
| cfg!(target_os = "macos") | |
| !cfg!(target_os = "windows") |
| fn key_column_width(&self) -> usize { | ||
| self.rows | ||
| .iter() | ||
| .map(|row| row.key.chars().count()) | ||
| .max() | ||
| .unwrap_or(CONFIG_MIN_KEY_COLUMN_WIDTH) | ||
| .max(CONFIG_MIN_KEY_COLUMN_WIDTH) | ||
| } |
There was a problem hiding this comment.
key_column_width is calculated by iterating over all rows on every call to render. Since render is called for every frame and the configuration keys are static for the duration of the view, this calculation is redundant. It should be computed once during initialization and stored in the ConfigView struct.
No description provided.