mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-10-24 18:19:05 +02:00
fix(ui): explain connection pool quota waits
Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
1 parent
9dc3049257
commit
c998a57b42
2 files changed
+25
No files matched your search
@@ -158,6 +158,21 @@ describe("IssueMonitorBanner / IssueMonitorComposerStrip rendering", () => {
|
||||
flushSync(() => root.unmount());
|
||||
});
|
||||
|
||||
it("explains pool exhaustion and retained account affinity on both waiting surfaces", () => {
|
||||
const issue = {
|
||||
status: "in_progress", scheduledRetry: { status: "scheduled_retry", scheduledRetryReason: "ai_connection_pool_wait", scheduledRetryAt: new Date(NOW.getTime() + 60_000).toISOString(), scheduledRetryAttempt: 1 },
|
||||
} as Issue;
|
||||
const root = createRoot(container);
|
||||
flushSync(() => root.render(<><IssueMonitorBanner issue={issue} onCheckNow={vi.fn()} /><IssueMonitorComposerStrip issue={issue} onCheckNow={vi.fn()} /></>));
|
||||
expect(container.textContent).toContain("Pool exhausted");
|
||||
expect(container.textContent).toContain("Usage recheck in 1m");
|
||||
expect(container.textContent).toContain("This task keeps its account");
|
||||
expect(container.textContent).toContain("The selected account stays pinned.");
|
||||
expect(container.textContent).not.toContain("Attempt 1");
|
||||
expect(container.querySelector("button")).not.toBeNull();
|
||||
flushSync(() => root.unmount());
|
||||
});
|
||||
|
||||
it("renders the banner with a working Check now button while waiting", () => {
|
||||
const onCheckNow = vi.fn();
|
||||
expect(hasVisibleMonitorSurface(issueWithMonitor(new Date(NOW.getTime() + 2 * 60 * 60_000).toISOString()))).toBe(true);
|
||||
|
||||
@@ -81,6 +81,16 @@ export function buildMonitorSurfaceCopy(
|
||||
|
||||
const eta = formatMonitorEta(derived.nextCheckAt, now); // "in 2h 12m" | "due now" | "overdue by 18m"
|
||||
const absolute = formatMonitorAbsolute(derived.nextCheckAt, {}, now); // local time, e.g. "Today, 4:08 PM"
|
||||
if (derived.source === "scheduled-retry" && scheduledRetryReason === "ai_connection_pool_wait") {
|
||||
return {
|
||||
bannerTitle: "Pool exhausted",
|
||||
stripTitle: "Pool exhausted",
|
||||
bannerMeta: [`Usage recheck ${eta} · ${absolute} (your time)`, "This task keeps its account and resumes when usage permits."],
|
||||
stripMeta: [`Usage recheck ${eta} · ${absolute}`, "The selected account stays pinned."],
|
||||
tone: "info",
|
||||
};
|
||||
}
|
||||
|
||||
const isScheduledRetryOnly = derived.source === "scheduled-retry";
|
||||
|
||||
let bannerTitle: string;
|
||||
|
||||
Reference in new issue
Block a user