fix: critical bugs in map cache, exec pipeline, and MCP install#5
Draft
cursor[bot] wants to merge 1 commit into
Draft
fix: critical bugs in map cache, exec pipeline, and MCP install#5cursor[bot] wants to merge 1 commit into
cursor[bot] wants to merge 1 commit into
Conversation
- git_commit_key: include porcelain status for dirty repos (fixes stale ctx map cache) - truncate_lines: respect UTF-8 char boundaries (prevents panic in git blame/aws logs) - insert_mcp_server: skip overwrite when user-owned mcpServers.ctx exists - run_proxy_capture: suppress on_empty fallback when exit code != 0 Co-authored-by: Jaime Basso <JaimeJunr@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Weekly critical bug investigation found 4 high-severity correctness issues in recent code. All have concrete trigger scenarios and minimal fixes with tests.
Bugs fixed
1. Stale
ctx mapcache on dirty working trees (data correctness)ctx mapreturned cached output after uncommitted file edits, serving stale/wrong repo maps to LLMs.git_commit_key()hashed only directory paths for dirty repos, ignoring working tree state.git status --porcelainhash in dirty key:dirty-<HEAD>-<wt_hash>.2. Panic in
truncate_lineson UTF-8 boundaries (crash)ctx exec git blame(and other filters withtruncate_lines_at) could panic when a line exceeded the width limit at a multi-byte UTF-8 character.&line[..width]without checkingis_char_boundary.3. MCP config overwrite on
ctx install(data loss)ctx installsilently replaced a user-configuredmcpServers.ctxentry.insert_mcp_serveronly skipped overwrite for entries marked_installer: ctx.4. Failed commands masked as success via
on_empty(user-facing breakage)on_emptymessages like"ok"were returned, hiding failures from agents.run_proxy_capturealways applied stage 8 (on_empty) regardless of exit code.on_emptywhenexit_code != 0.Validation
cargo fmt --checkpasses locally