fix(tools): preserve shell command headline details#2387
Open
Pluviobyte wants to merge 1 commit into
Open
Conversation
Shell tool headlines previously reused the generic key argument shortening, so long commands hid important paths and flags behind a middle ellipsis. Keep Shell command arguments intact while leaving other tool headlines on the existing compact display. Fixes MoonshotAI#2142 Co-authored-by: Cursor <cursoragent@cursor.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.
Related Issue
Resolve #2142
Description
This addresses the CLI/UI part of #2142: long
Used Shell (...)headlines currently go through the genericshorten_middle(..., width=50)path, so the terminal often shows commands like:That hides the exact path and arguments users need when debugging repeated, failed, or suspicious shell calls.
Fix
Shellkey arguments untruncated so the full command string is available in the headline.ReadFile,WriteFile, etc. remain compact.Scope
This PR intentionally does not attempt to solve the agent-loop/hard-cap part of #2142. It only fixes the user-visible command truncation regression.
Checklist
CHANGELOG.md(manual Unreleased entry, following the existing one-line-per-bullet style;make gen-changelognot run because this is a focused bug fix).make gen-docsnot run — N/A: no user-facing docs/config change.Test plan
UV_PYTHON=3.12 uv run ruff check src/kimi_cli/tools/__init__.py tests/tools/test_extract_key_argument.py→ cleanUV_PYTHON=3.12 uv run ruff format --check src/kimi_cli/tools/__init__.py tests/tools/test_extract_key_argument.py→ cleanUV_PYTHON=3.12 uv run pytest tests/tools/test_extract_key_argument.py -q→11 passedProof of fix
New tests cover both sides:
test_shell_long_command_keeps_path_and_argumentsasserts Shell headlines retain the full long command and contain no....test_readfile_long_path_still_shortensasserts non-Shell tools still use the existing truncation behavior.Made with Cursor