mirror of
https://github.com/andrewyng/openworker.git
synced 2026-09-04 07:20:10 +00:00
Grant-time presence notice renders as a quiet info line
This commit is contained in:
@@ -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.",
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user