fix(chat): render resolved permission outcomes instead of generic Continued - #2132
fix(chat): render resolved permission outcomes instead of generic Continued#2132zhangmo8 wants to merge 5 commits into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (2)
📒 Files selected for processing (6)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughThe renderer now resolves granted and denied tool permission actions, associates them with matching tool calls, hides redundant resolved action blocks, and displays localized permission statuses in action and tool-call components. Tests cover resolved, pending, unmatched, denied, and read-only cases. ChangesPermission outcome rendering
Renderer test infrastructure
Estimated code review effort: 3 (Moderate) | ~25 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 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.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/renderer/src/components/message/MessageItemAssistant.vue`:
- Around line 92-96: Pass the resolved permission status from
permissionStatusByToolCallId to the MessageBlockToolCall invocation used for
mcp-app/app-only tool calls, matching the existing normal tool-call prop
behavior and using the tool-call ID lookup. Add a regression test covering a
resolved permission action paired with an app-only tool call and verify its
permission outcome renders.
In `@test/renderer/components/message/MessageItemAssistant.test.ts`:
- Around line 786-808: Add a regression case alongside the existing permission
outcome tests using two tool calls with distinct IDs and one resolved permission
action targeting one ID. Assert that only the matching tool-call stub receives
the expected permissionStatus, while the other remains unset, using the existing
mountWith, createPermissionActionBlock, and createToolCallBlock helpers.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: bc4b6b60-3eca-4e61-b3c4-82e7f0c26fc9
📒 Files selected for processing (28)
src/renderer/src/components/message/MessageBlockAction.vuesrc/renderer/src/components/message/MessageBlockActivityGroup.vuesrc/renderer/src/components/message/MessageBlockToolCall.vuesrc/renderer/src/components/message/MessageItemAssistant.vuesrc/renderer/src/features/chat-page/model/displayMessage.tssrc/renderer/src/i18n/da-DK/toolCall.jsonsrc/renderer/src/i18n/de-DE/toolCall.jsonsrc/renderer/src/i18n/en-US/toolCall.jsonsrc/renderer/src/i18n/es-ES/toolCall.jsonsrc/renderer/src/i18n/fa-IR/toolCall.jsonsrc/renderer/src/i18n/fr-FR/toolCall.jsonsrc/renderer/src/i18n/he-IL/toolCall.jsonsrc/renderer/src/i18n/id-ID/toolCall.jsonsrc/renderer/src/i18n/it-IT/toolCall.jsonsrc/renderer/src/i18n/ja-JP/toolCall.jsonsrc/renderer/src/i18n/ko-KR/toolCall.jsonsrc/renderer/src/i18n/ms-MY/toolCall.jsonsrc/renderer/src/i18n/pl-PL/toolCall.jsonsrc/renderer/src/i18n/pt-BR/toolCall.jsonsrc/renderer/src/i18n/ru-RU/toolCall.jsonsrc/renderer/src/i18n/tr-TR/toolCall.jsonsrc/renderer/src/i18n/vi-VN/toolCall.jsonsrc/renderer/src/i18n/zh-CN/toolCall.jsonsrc/renderer/src/i18n/zh-HK/toolCall.jsonsrc/renderer/src/i18n/zh-TW/toolCall.jsontest/renderer/components/message/MessageBlockBasics.test.tstest/renderer/components/message/MessageBlockToolCall.test.tstest/renderer/components/message/MessageItemAssistant.test.ts
zerob13
left a comment
There was a problem hiding this comment.
Reviewed the current head. Required GitHub checks are green, but I found one user-visible permission-history gap and one generated i18n contract drift; details are inline.
|
Heads-up on the extra |
Closes #2117
Summary
Resolved tool-permission action blocks previously rendered the generic checkmark + "Continued" label regardless of the persisted outcome, so a denial could look successful. The renderer now faithfully projects the broker-owned decision (
block.status = 'granted' | 'denied') and merges it into the associated tool card.displayMessage.ts: newgetResolvedPermissionStatus()andbuildResolvedPermissionStatusByToolCallId()helpers; the map only includes permission blocks whose tool card exists in the same message.MessageItemAssistant.vue: resolved permission action blocks with a matching tool card are no longer rendered as a separate card; their outcome is passed toMessageBlockToolCallvia the newpermissionStatusprop. Missing-tool-card cases fall back to a compact standalone label.MessageBlockToolCall.vue: renders anAllowed(emerald) /Denied(red) badge on the tool pill, styled like the existing RTK badge.MessageBlockActivityGroup.vue: forwards the permission map so tool cards inside collapsed activity groups show the badge too.MessageBlockAction.vue: fallback rendering uses shield-check "Permission granted" / shield-x "Permission denied" (existing i18n keys) instead of "Continued". Rate-limit, legacy needContinue and other action types keep their behavior.toolCall.badge.allowed/toolCall.badge.deniedto all 20 locales.Layout
Acceptance criteria
tool_call.id)Verification
vitest run test/renderer/components/message— 16 files, 151 tests passedpnpm run typecheck,pnpm run lint,pnpm run format,pnpm run i18nall passSummary by CodeRabbit
New Features
Localization
Tests