diff --git a/server/src/routes/file-resources.ts b/server/src/routes/file-resources.ts index f691de5fe38..847d351ed99 100644 --- a/server/src/routes/file-resources.ts +++ b/server/src/routes/file-resources.ts @@ -35,6 +35,9 @@ export function createFileResourceLimiter(opts: { return { acquire(key: string) { const now = Date.now(); + for (const [windowKey, existing] of windowsByKey) { + if (now - existing.startedAt >= windowMs) windowsByKey.delete(windowKey); + } const window = windowsByKey.get(key); if (!window || now - window.startedAt >= windowMs) { windowsByKey.set(key, { startedAt: now, count: 1 }); diff --git a/ui/src/components/ArtifactFileChip.tsx b/ui/src/components/ArtifactFileChip.tsx index e5fe34d902a..8012eb6f39f 100644 --- a/ui/src/components/ArtifactFileChip.tsx +++ b/ui/src/components/ArtifactFileChip.tsx @@ -36,13 +36,23 @@ export function ArtifactFileChip({ ? `Open ${workspaceFileRef.displayPath}${lineSuffix} in the file viewer` : `Workspace file ${workspaceFileRef.displayPath}${lineSuffix}`); - const handleClick = (event: MouseEvent) => { + const classNames = cn( + "paperclip-artifact-file-chip inline-flex items-center gap-1 rounded-sm border border-border bg-muted/60 px-1.5 py-0.5 font-mono text-xs leading-tight text-foreground/90 align-baseline no-underline hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1", + canOpen ? "cursor-pointer" : null, + className, + ); + const content = ( + <> + {showIcon ?