fix(ui): label system-injected maintenance prompts as System#26469
Open
pdonizete wants to merge 6 commits intoopenclaw:mainfrom
Open
fix(ui): label system-injected maintenance prompts as System#26469pdonizete wants to merge 6 commits intoopenclaw:mainfrom
pdonizete wants to merge 6 commits intoopenclaw:mainfrom
Conversation
Comment on lines
+5
to
+17
| describe("resolveSenderLabel", () => { | ||
| it("labels user role as You", () => { | ||
| expect(resolveSenderLabel("user", "Assistant")).toBe("You"); | ||
| }); | ||
|
|
||
| it("labels assistant role with assistant name", () => { | ||
| expect(resolveSenderLabel("assistant", "Codex")).toBe("Codex"); | ||
| }); | ||
|
|
||
| it("labels system role as System", () => { | ||
| expect(resolveSenderLabel("system", "Assistant")).toBe("System"); | ||
| }); | ||
| }); |
Contributor
There was a problem hiding this comment.
missing test coverage for tool role
Suggested change
| describe("resolveSenderLabel", () => { | |
| it("labels user role as You", () => { | |
| expect(resolveSenderLabel("user", "Assistant")).toBe("You"); | |
| }); | |
| it("labels assistant role with assistant name", () => { | |
| expect(resolveSenderLabel("assistant", "Codex")).toBe("Codex"); | |
| }); | |
| it("labels system role as System", () => { | |
| expect(resolveSenderLabel("system", "Assistant")).toBe("System"); | |
| }); | |
| }); | |
| describe("resolveSenderLabel", () => { | |
| it("labels user role as You", () => { | |
| expect(resolveSenderLabel("user", "Assistant")).toBe("You"); | |
| }); | |
| it("labels assistant role with assistant name", () => { | |
| expect(resolveSenderLabel("assistant", "Codex")).toBe("Codex"); | |
| }); | |
| it("labels system role as System", () => { | |
| expect(resolveSenderLabel("system", "Assistant")).toBe("System"); | |
| }); | |
| it("labels tool role as Tool", () => { | |
| expect(resolveSenderLabel("tool", "Assistant")).toBe("Tool"); | |
| }); | |
| }); |
Prompt To Fix With AI
This is a comment left during a code review.
Path: ui/src/ui/chat/grouped-render.test.ts
Line: 5-17
Comment:
missing test coverage for `tool` role
```suggestion
describe("resolveSenderLabel", () => {
it("labels user role as You", () => {
expect(resolveSenderLabel("user", "Assistant")).toBe("You");
});
it("labels assistant role with assistant name", () => {
expect(resolveSenderLabel("assistant", "Codex")).toBe("Codex");
});
it("labels system role as System", () => {
expect(resolveSenderLabel("system", "Assistant")).toBe("System");
});
it("labels tool role as Tool", () => {
expect(resolveSenderLabel("tool", "Assistant")).toBe("Tool");
});
});
```
How can I resolve this? If you propose a fix, please make it concise.
Author
|
Thanks for the review — addressed in follow-up commit 993bf0e:
|
Author
|
All feedback addressed (tool label test + formatting). Ready for maintainer review. |
|
This pull request has been automatically marked as stale due to inactivity. |
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.
Summary
Fixes Gateway Chat UI labeling for system-injected maintenance prompts that were shown as "You".
What changed
usertosystemfor UI rendering.systemrenders as System.Why
Issue #26461 reports that users mistake system-injected messages for real user messages, causing false security alarms.
Scope
UI normalization/rendering + tests only.
Fixes #26461.
Greptile Summary
Reclassified system-injected maintenance prompts (heartbeat and post-compaction audit messages) from
usertosystemrole for correct UI rendering with System label.message-normalizer.tsfor heartbeat prompts viaProviderfield and text prefix patternsresolveSenderLabelhelper to map roles to display labels (system→ "System")Confidence Score: 4/5
resolveSenderLabel. The fix is UI-only with no runtime behavior changes.ui/src/ui/chat/grouped-render.test.tsLast reviewed commit: b60269a
(3/5) Reply to the agent's comments like "Can you suggest a fix for this @greptileai?" or ask follow-up questions!