fix: show fallback description for [read] and [apply_patch] tool lines#363
fix: show fallback description for [read] and [apply_patch] tool lines#363thunter009 wants to merge 2 commits intosubsy:mainfrom
Conversation
Tool call display showed bare [read] and [apply_patch] with no arguments when input field names didn't match the hardcoded set. Add fallback that extracts the first useful string value from input, prioritizing paths. Also check event.part.input as fallback in OpenCode parser. Closes subsy#362 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
@thunter009 is attempting to deploy a commit to the plgeek Team on Vercel. A member of the Team first needs to authorize it. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
WalkthroughUpdate adds input-source fallback in the OpenCode JSONL parser and implements a display fallback that extracts a short, path‑preferential string from unknown tool input fields; tests and exports added to cover the new formatting fallback behaviour. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #363 +/- ##
==========================================
+ Coverage 47.35% 47.38% +0.03%
==========================================
Files 111 111
Lines 36446 36488 +42
==========================================
+ Hits 17258 17289 +31
- Misses 19188 19199 +11
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/plugins/agents/output-formatting.ts`:
- Around line 154-172: The loop in src/plugins/agents/output-formatting.ts
currently drops any string value longer than 200 chars which causes long patch
bodies (e.g., apply_patch) to be discarded and no fallback shown; remove the
hard skip (the if (value.length > 200) continue;) and instead accept long values
into the selection logic (so bestPath / bestShort can be set from them) and rely
on the existing truncation step (result.length > 120 ? result.slice(0,120) +
'...' : result) to shorten the final output.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 871392ca-c99e-4426-a0ae-b6483835ed40
⛔ Files ignored due to path filters (1)
bun.lockis excluded by!**/*.lock
📒 Files selected for processing (3)
src/plugins/agents/builtin/opencode.tssrc/plugins/agents/output-formatting.test.tssrc/plugins/agents/output-formatting.ts
The length guard prevented long string values (e.g. apply_patch bodies) from being considered for fallback display, causing blank output. The existing 120-char truncation already keeps output short. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Summary
[read]and[apply_patch]displayed with no arguments when input field names didn't match the hardcoded formatter set (file_path,command,pattern, etc.)extractFallbackDisplay()that kicks in when no known fields match — scans input values for the first useful short string, prioritizing path-like valuesevent.part?.inputwhenevent.part?.state?.inputis missingCloses #362
Test plan
[read]and[apply_patch]lines now show their arguments🤖 Generated with Claude Code
Summary by CodeRabbit
Improvements
Tests