Grant-time presence notice renders as a quiet info line

This commit is contained in:
Rohit C Prasad
2026-08-23 01:24:58 -07:00
committed by Rohit P
parent efb10e0e26
commit f679853c64
2 changed files with 20 additions and 1 deletions
@@ -132,4 +132,19 @@ describe("itemsFromMessages mcp failure", () => {
] as any);
expect(items[0]).toEqual({ kind: "notice", tone: "warn", text: "something opaque went wrong" });
});
it("renders a project_presence notice as one quiet info line, never an error", () => {
const items = itemsFromMessages([
{
role: "notice",
kind: "project_presence",
text: "“notes” already has project memory (3 entries) — bind it by name or start a session there to use it.",
},
] as any);
expect(items[0]).toEqual({
kind: "notice",
tone: "info",
text: "“notes” already has project memory (3 entries) — bind it by name or start a session there to use it.",
});
});
});
+5 -1
View File
@@ -85,7 +85,11 @@ export function itemsFromMessages(messages: ConversationMessage[]): Item[] {
// the `server` field existed) recover the name from their own text, so old
// transcripts collapse too instead of keeping the wall of stderr.
mcpNoticeItem(m)
: { kind: "notice", tone: "warn", text: "Error: " + (m.text || "unknown"), retriable: true },
: m.kind === "project_presence"
? // Grant-time pointer (pass 20): the granted folder already has
// memory/board — informational, one quiet line.
{ kind: "notice", tone: "info", text: m.text || "" }
: { kind: "notice", tone: "warn", text: "Error: " + (m.text || "unknown"), retriable: true },
);
}
// system messages are omitted; tool-result messages are folded into the tool row above