Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(web): a later thread error with the same text shows its banner again #37419

Mergedshivamhwp(GitHub profile, opens in a new tab)merged 20 commits intomain fromrefs/pull/37419/headmerged by shivamhwp(GitHub profile, opens in a new tab) View on GitHub

Showing 9 changed files with 60 additions and 2 deletions (loading 6).

x
0 of 9 viewed, 9 left
17 additions and 0 deletionsapps/web/src/components/chat/ThreadErrorBanner.test.tsxModified
View file
@@ -42,4 +42,21 @@
),
).toBe(true);
});
+​
+ it("reappears when a later run fails with the same error on the same thread", () => {
+ const error = "Turn failed";
+ const dismissedKey = getThreadErrorBannerKey("env:thread-c", error, "run-a");
+ dismissThreadErrorBannerForSession(dismissedKey);
+ const laterRunKey = getThreadErrorBannerKey("env:thread-c", error, "run-b");
+​
+ expect(isThreadErrorBannerDismissedForSession(dismissedKey)).toBe(true);
+ expect(isThreadErrorBannerDismissedForSession(laterRunKey)).toBe(false);
+ expect(
+ shouldShowThreadErrorBanner(
+ "env:thread-c",
+ error,
+ isThreadErrorBannerDismissedForSession(laterRunKey),
+ ),
+ ).toBe(true);
+ });
});
6 additions and 2 deletionsapps/web/src/components/chat/ThreadErrorBanner.tsxModified
View file
@@ -51,8 +51,12 @@
: error;
​
-export function getThreadErrorBannerKey(threadKey: string, error: string | null): string | null {