[fix] Show short agent-run errors in full instead of clamping them away - #5395
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughFailed-run error rendering now uses a shared size heuristic to clamp large errors and conditionally show expansion controls. Expanded errors render in a scrollable preformatted block, and the related inline comment was updated. ChangesError rendering
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
web/oss/src/components/AgentChatSlice/components/AgentMessage.tsx (1)
181-185: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueShorten comments to a single line.
As per coding guidelines, in-code comments must be kept to at most one short line unless describing genuinely surprising constraints.
web/oss/src/components/AgentChatSlice/components/AgentMessage.tsx#L181-L185: condense the JSDoc component description into a single line (e.g.,/** Failed-run body: everyday reasons show in full; big ones collapse behind a "Show more" block. */).web/oss/src/components/AgentChatSlice/components/AgentMessage.tsx#L532-L533: combine the inline explanation into a single line (e.g.,// Failed run: the bubble reads as an inline error; everyday reasons show in full, big ones collapse.).Source: Coding guidelines
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 2e30829c-3c61-42af-8450-6ad06abee66e
📒 Files selected for processing (1)
web/oss/src/components/AgentChatSlice/components/AgentMessage.tsx
Railway Preview Environment
|
Context
When an agent run failed, the error reason in the chat could get cut off with no way to read the rest. The clamp and the "Show more" toggle used two different rules, so they could disagree: a short reason that happened to wrap past three lines got
line-clamp-3, but the toggle only appeared for text over 220 chars or containing a newline. A wrapped-but-short message was clamped with no button to expand it, so part of the error was simply hidden (#5350). Multi-line reasons also lost their line breaks, since the default text block didn't preserve whitespace.Changes
There's now one rule,
isBigError, that decides everything:whitespace-pre-wrapso its line breaks survive. No clamp, no toggle.<pre>block as before.Because the clamp, the toggle, and the expanded view all key off the same
isBigErrorcheck, they can't disagree and strand text off-screen.Before:
isLong = text.length > 220 || text.includes("\n")gated the toggle.line-clamp-3was applied to every non-expanded reason regardless ofisLong.After:
isBigErrorcheck drives the clamp, the toggle, and the expanded block.Tests / notes
What to QA