fix(access-key): 收敛模型页只读展示 - #453
Conversation
|
Caution CodeRabbit couldn't update its existing comment. The review summary may be out of date. Check that CodeRabbit still has permission to update comments. Error details |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d7ddfa3986
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Pull request overview
This PR adds an AccessKey-scoped “cost formula / pricing calculation” display for request log details while keeping sensitive routing/pricing internals redacted, and adjusts the model tree UI for read-only (AccessKey) views by hiding the price status column and removing the channel tooltip.
Changes:
- Expose a new
pricing_calculationpayload (line items only) on AccessKey-scoped request log detail responses and render it in the log detail drawer. - Hide the model price status column and remove channel tooltip behavior when the model tree is in
readOnlymode, while still showing the channel icon. - Add projection/types for
pricing_calculationon the web client and extend backend tests to assert redaction plus calculation field presence.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| web/src/features/monitor/LogDetailDrawer.vue | Uses pricing_calculation for self-scoped (AccessKey) log cost formula display while preserving existing receipt-based behavior for non-scoped views. |
| web/src/features/models/ModelTree.vue | Hides status column and removes channel tooltip in readOnly mode; keeps channel icon visible. |
| web/src/app/resources/request-logs.ts | Adds DTO + projector for pricing_calculation and reuses shared line-item projection logic. |
| internal/control/request_logs.go | Adds pricing_calculation response struct and mapping for AccessKey detail endpoint; adjusts sanitization flow accordingly. |
| internal/control/request_logs_test.go | Extends AccessKey redaction test to validate pricing_calculation includes only expected public line-item fields. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
Note
Quiet mode is enabled, so only the most important comments were posted inline. Other review comments are grouped below.
🟡 Other comments (1)
web/src/features/models/ModelTree.vue-137-142 (1)
137-142: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win为只读渠道图标取消
help光标。只读分支已移除
AppTooltip,但仍使用.model-tree__channel-icon。该类在 Line 388 设置cursor: help。因此用户悬停时仍会看到帮助光标,但页面不会显示渠道提示。为只读分支增加装饰性修饰类,并将光标改为
default。非只读分支继续保留help光标。建议修改
- <span v-else class="model-tree__channel-icon" aria-hidden="true"> + <span + v-else + class="model-tree__channel-icon model-tree__channel-icon--decorative" + aria-hidden="true" + >+.model-tree__channel-icon--decorative { + cursor: default; +}
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: QUIET
Plan: Pro Plus
Run ID: 95ee39df-5ece-4805-8f0b-d1bc24266bc6
📒 Files selected for processing (5)
internal/control/request_logs.gointernal/control/request_logs_test.goweb/src/app/resources/request-logs.tsweb/src/features/models/ModelTree.vueweb/src/features/monitor/LogDetailDrawer.vue
Included review availability: Your plan provides up to 8 included reviews per hour; 6 remain after this review.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: QUIET Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 8 included reviews per hour; 6 remain after this review. 📝 WalkthroughWalkthrough模型树在只读模式下隐藏状态列表头、状态单元格和状态网格列。上游渠道图标在只读模式下作为带 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches✨ Simplify code
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 |
关联 Issue / Related Issue
无 / None
变更内容 / Change Content
Bug 修复 / Bug fix
新功能 / New feature
其他改动 / Other changes
AccessKey 模型页隐藏价格状态列,保留上游模型与渠道图标。
只读渠道图标不再提供渠道 Tooltip、键盘焦点或帮助光标。
自查清单 / Checklist
make check,或在说明中写明无法运行的原因和未验证范围。 / I ranmake check, or documented why it could not run and what remains unverified.Summary by CodeRabbit