Skip to content

Commit 57fca87

Browse files
committed
fix(orchestrator): Stamp lastErrorAt on runtime-error release
A repeated process failure must get a new occurrence timestamp so a dismissed banner can reappear. Idle release still preserves the prior timestamp. The web banner key uses lastErrorAt only and no longer falls back to updatedAt.
1 parent 8a86255 commit 57fca87

4 files changed

Lines changed: 13 additions & 1 deletion

File tree

‎apps/server/src/orchestration-v2/ProviderSessionManager.test.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1844,6 +1844,7 @@ it("releasedProviderSession keeps lastError when the live process is reaped", ()
18441844
});
18451845
assert.equal(failed.status, "error");
18461846
assert.equal(failed.lastError, "process exited");
1847+
assert.deepStrictEqual(failed.lastErrorAt, later);
18471848
});
18481849

18491850
it.effect("ProviderSessionManagerV2 keeps a projected lastError across idle release", () =>

‎apps/server/src/orchestration-v2/ProviderSessionManager.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,7 @@ export function releasedProviderSession(input: {
228228
status: releaseStatusFor(input.reason),
229229
updatedAt: input.now,
230230
lastError: input.detail ?? "Provider runtime failed.",
231+
lastErrorAt: input.now,
231232
};
232233
}
233234
return {

‎apps/web/src/components/ChatView.logic.test.ts‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,16 @@ describe("threadRuntimeErrorDismissalKey", () => {
315315
}),
316316
).toBe('["2026-08-11T12:00:00Z","event stream stalled"]');
317317
});
318+
319+
it("does not invent an occurrence when the runtime has no error timestamp", () => {
320+
expect(
321+
threadRuntimeErrorDismissalKey({
322+
localError: null,
323+
runtimeError: "event stream stalled",
324+
runtimeErrorAt: null,
325+
}),
326+
).toBeNull();
327+
});
318328
});
319329

320330
describe("shouldShowComposerContextStrip", () => {

‎apps/web/src/components/ChatView.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1777,7 +1777,7 @@ function ChatViewContent(props: ChatViewProps) {
17771777
const runtimeErrorKey = threadRuntimeErrorDismissalKey({
17781778
localError: localServerError,
17791779
runtimeError,
1780-
runtimeErrorAt: serverRuntime?.lastErrorAt ?? serverRuntime?.updatedAt ?? null,
1780+
runtimeErrorAt: serverRuntime?.lastErrorAt ?? null,
17811781
});
17821782
const threadError = isServerThread
17831783
? resolveThreadErrorBannerMessage({

0 commit comments

Comments
 (0)