The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 21, 16:00 UTC
fix(pi): info notifications no longer render as warnings (#23506)
Co-authored-by: maria-rcks <maria@kuuro.net> Co-authored-by: Julius Marminge <julius0216@outlook.com>
Alexander Skula committed
Nov 14, 2026 at 03:01 UTC
33372a25a2d265d4fc95d9b3dffacd8819c0d80a
8 files changed
+101
-21
apps/mobile/src/lib/threadActivity.test.ts
+17
@@ -39,6 +39,23 @@ const threadId = ThreadId.make("thread-1");
39
const sourceThreadId = ThreadId.make("thread-source");
40
const runId = RunId.make("run-1");
41
42
+it.each(["info", "warning", "error", undefined] as const)(
43
+ "renders %s system notice severity",
44
+ (level) => {
45
+ const item = {
46
+ ...base("notice", "2026-08-29T00:00:00.000Z", 1),
47
+ type: "system_notice" as const,
48
+ message: "Extension notice",
49
+ ...(level === undefined ? {} : { level }),
50
+ };
51
+ const activity = buildThreadFeed([projected(item, 0)]).flatMap((entry) =>
52
+ entry.type === "activity-group" ? entry.activities : [],
53
+ )[0];
54
+ expect(activity?.icon).toBe(level === "info" ? "zap" : "warning");
55
+ expect(activity?.summary).toBe(item.message);
56
+ },
57
+);
58
+
59
it("shows a captured MCP app for a failed deferred write", () => {
60
const mcpApp = {
61
attachmentId: "deferred-app-html",
apps/mobile/src/lib/threadActivity.ts
+2
-2
@@ -565,11 +565,11 @@ function itemIcon(item: OrchestrationV2TurnItem): ThreadFeedActivity["icon"] {
565
return isJavaScriptReplTool(item.toolName) ? "code" : "wrench";
566
case "subagent":
567
return "hammer";
568
+ case "system_notice":
569
+ return item.level === "info" ? "zap" : "warning";
570
case "run_interrupt_request":
571
case "run_interrupt_result":
572
return "stop";
571
- case "system_notice":
572
- return "warning";
573
case "error":
574
return item.failure.class === "usage_limit"
575
? item.status === "completed"
apps/web/src/components/chat/MessagesTimeline.logic.test.ts
+44
@@ -36,6 +36,7 @@ import {
36
type MessagesTimelineRow,
37
workEntryDisplayLabel,
38
} from "./MessagesTimeline.logic";
39
+import { workEntryIconName } from "./TimelineWorkEntryRow.logic";
40
41
describe("resolveAssistantMessageCopyState", () => {
42
it("copies the rendered representation of Codex directives", () => {
@@ -515,6 +516,49 @@ describe("deriveMessagesTimelineRows", () => {
516
},
517
);
518
519
+ it.each(["info", "warning", "error", undefined] as const)(
520
+ "renders %s notices with compatible severity",
521
+ (level) => {
522
+ const fixture = makeStreamingTimelineFixture();
523
+ const message = "TPS 227.1 tok/s · TTFT 3.4s";
524
+ const id = TurnItemId.make("info-notice");
525
+ const [notice] = deriveTimelineEntriesFromVisibleTurnItems({
526
+ visibleTurnItems: [
527
+ {
528
+ ...fixture.visibleTurnItems[0]!,
529
+ sourceItemId: id,
530
+ item: {
531
+ id,
532
+ threadId: fixture.threadId,
533
+ runId: fixture.runId,
534
+ nodeId: null,
535
+ providerThreadId: null,
536
+ providerTurnId: null,
537
+ nativeItemRef: null,
538
+ parentItemId: null,
539
+ ordinal: 1,
540
+ startedAt: DateTime.makeUnsafe(fixture.time(1)),
541
+ completedAt: DateTime.makeUnsafe(fixture.time(1)),
542
+ updatedAt: DateTime.makeUnsafe(fixture.time(1)),
543
+ type: "system_notice",
544
+ message,
545
+ ...(level === undefined ? {} : { level }),
546
+ title: message,
547
+ status: "completed",
548
+ },
549
+ },
550
+ ],
551
+ optimisticMessages: [],
552
+ });
553
+ if (notice?.kind !== "work") throw new Error("Expected a notice work entry");
554
+ expect(notice.entry.sourceActivityKind).toBe(
555
+ level === "info" ? undefined : "runtime.warning",
556
+ );
557
+ expect(workEntryIconName(notice.entry)).toBe(level === "info" ? "zap" : "circle-alert");
558
+ expect(workEntryDisplayLabel(notice.entry, undefined)).toBe(message);
559
+ },
560
+ );
561
+
562
it.each([false, true])(
563
"gives live compaction the activity slot and restores Thinking (runless: %s)",
564
(runless) => {
apps/web/src/components/chat/TimelineWorkEntryRow.logic.ts
+6
@@ -167,6 +167,12 @@ export function workEntryIconName(workEntry: TimelineWorkEntry): WorkEntryIconNa
167
return "zap";
168
}
169
}
170
+ if (workEntry.itemType === "system_notice") {
171
+ return workEntry.structuredPayload?.type === "system_notice" &&
172
+ workEntry.structuredPayload.level === "info"
173
+ ? "zap"
174
+ : "circle-alert";
175
+ }
176
if (workEntry.itemType === "user_input_request" || workEntry.itemType === "approval_request") {
177
return "message-circle";
178
}
apps/web/src/session-logic.ts
+1
-1
@@ -426,7 +426,7 @@ function projectedWorkEntry(row: OrchestrationV2ProjectedTurnItem): WorkLogEntry
426
return {
427
...common,
428
label: item.message,
429
- sourceActivityKind: "runtime.warning",
429
+ ...(item.level === "info" ? {} : { sourceActivityKind: "runtime.warning" }),
430
};
431
case "error": {
432
const presentation = providerErrorPresentation(item);
packages/contracts/src/orchestrationV2.ts
+5
@@ -1569,6 +1569,9 @@ export const OrchestrationV2UserMessageInputIntent = Schema.Literals([
1569
export type OrchestrationV2UserMessageInputIntent =
1570
typeof OrchestrationV2UserMessageInputIntent.Type;
1571
1572
+/** Notices without a level predate it and are warnings. */
1573
+const OrchestrationV2SystemNoticeLevel = Schema.Literals(["info", "warning", "error"]);
1574
+
1575
/** A same-harness model or effort change that took effect with this message. */
1576
export const OrchestrationV2ModelSwitch = Schema.Struct({
1577
from: ModelSelection,
@@ -1817,6 +1820,7 @@ export const OrchestrationV2TurnItem = Schema.Union([
1820
...OrchestrationV2TurnItemBaseFields,
1821
type: Schema.Literal("system_notice"),
1822
message: Schema.String,
1823
+ level: Schema.optional(OrchestrationV2SystemNoticeLevel),
1824
}),
1825
Schema.Struct({
1826
...OrchestrationV2TurnItemBaseFields,
@@ -2697,6 +2701,7 @@ export const OrchestrationV2TurnItemJson = Schema.Union([
2701
...OrchestrationV2TurnItemJsonBaseFields,
2702
type: Schema.Literal("system_notice"),
2703
message: Schema.String,
2704
+ level: Schema.optional(OrchestrationV2SystemNoticeLevel),
2705
}),
2706
Schema.Struct({
2707
...OrchestrationV2TurnItemJsonBaseFields,
packages/provider-pi/src/server/adapter.test.ts
+22
-18
@@ -3887,24 +3887,28 @@ describe("PiAdapterV2", () => {
3887
);
3888
yield* fake.takeRequest("get_state");
3889
}
3890
- yield* fake.emit({
3891
- type: "extension_ui_request",
3892
- id: "ui-cmd",
3893
- method: "notify",
3894
- message: "Command finished\nwith details",
3895
- notifyType: "info",
3896
- });
3897
- const notice = yield* takeEvent(
3898
- (event) =>
3899
- (event.type === "turn_item.updated" && event.turnItem.type === "system_notice") ||
3900
- event.type === "turn.terminal",
3901
- );
3902
- assert.isTrue(
3903
- notice.type === "turn_item.updated" &&
3904
- notice.turnItem.type === "system_notice" &&
3905
- notice.turnItem.status === "completed" &&
3906
- notice.turnItem.message === "Command finished\nwith details",
3907
- );
3890
+ for (const notifyType of ["info", "warning", "error", undefined, "unknown"] as const) {
3891
+ yield* fake.emit({
3892
+ type: "extension_ui_request",
3893
+ id: "ui-cmd",
3894
+ method: "notify",
3895
+ message: "Command finished\nwith details",
3896
+ ...(notifyType === undefined ? {} : { notifyType }),
3897
+ });
3898
+ const notice = yield* takeEvent(
3899
+ (event) =>
3900
+ (event.type === "turn_item.updated" && event.turnItem.type === "system_notice") ||
3901
+ event.type === "turn.terminal",
3902
+ );
3903
+ assert.isTrue(
3904
+ notice.type === "turn_item.updated" &&
3905
+ notice.turnItem.type === "system_notice" &&
3906
+ notice.turnItem.status === "completed" &&
3907
+ notice.turnItem.level ===
3908
+ (notifyType === "warning" || notifyType === "error" ? notifyType : "info") &&
3909
+ notice.turnItem.message === "Command finished\nwith details",
3910
+ );
3911
+ }
3912
assert.equal(runtime.providerSession.status, "running");
3913
yield* fake.emit({ type: "response", command: "prompt", success: true, data });
3914
const terminal = yield* takeEvent((event) => event.type === "turn.terminal");
packages/provider-pi/src/server/adapter.ts
+4
@@ -1471,6 +1471,7 @@ export const makePiAdapterV2 = Effect.fn("makePiAdapterV2")(function* (
1471
turn: ActivePiTurn,
1472
nativeItemId: string,
1473
message: string,
1474
+ level?: "info" | "warning" | "error",
1475
) {
1476
const emittedAt = yield* DateTime.now;
1477
yield* emitItemNode(turn, nativeItemId, "system", "completed", emittedAt, emittedAt);
@@ -1484,6 +1485,7 @@ export const makePiAdapterV2 = Effect.fn("makePiAdapterV2")(function* (
1485
title: message,
1486
type: "system_notice",
1487
message,
1488
+ ...(level === undefined ? {} : { level }),
1489
},
1490
});
1491
});
@@ -1529,10 +1531,12 @@ export const makePiAdapterV2 = Effect.fn("makePiAdapterV2")(function* (
1531
const turn = state?.activeTurn ?? null;
1532
const message = recordString(event, "message") ?? "";
1533
if (turn === null || message.length === 0) return;
1534
+ const notifyType = recordString(event, "notifyType");
1535
yield* emitSystemNotice(
1536
turn,
1537
`notify:${turn.providerTurn.id}:${turn.nextItemOrdinal}`,
1538
message,
1539
+ notifyType === "warning" || notifyType === "error" ? notifyType : "info",
1540
);
1541
return;
1542
}