Skip to content

Commit 812384e

Browse files
npub1223z34hd7vtwc6qj4s7flsxkj644nlre2nthu7lrrmkumhu3xddsrx9r6wtellaho
andcommitted
fix(desktop): make compact tool label map type honest
The labels Record was annotated Record<CompactToolKind, ...> but only spreads generic + developerToolLabels(), which excludes the buzz kind. buzz is handled by an early return in compactToolLabel, so it never indexes this map. Narrow the annotation to Exclude<CompactToolKind, "buzz"> so tsc accepts it, and drop the redundant labelsMap re-cast. No runtime behavior change. Co-authored-by: Taylor Ho <taylorkmho@gmail.com> Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
1 parent a88c201 commit 812384e

1 file changed

Lines changed: 2 additions & 7 deletions

File tree

desktop/src/features/agents/ui/agentSessionToolSummary.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ function compactToolLabel(
131131
}
132132

133133
const labels: Record<
134-
CompactToolKind,
134+
Exclude<CompactToolKind, "buzz">,
135135
{ completed: string; running: string; failed: string }
136136
> = {
137137
generic: {
@@ -142,12 +142,7 @@ function compactToolLabel(
142142
...developerToolLabels(),
143143
};
144144

145-
const labelsMap = labels as Record<
146-
CompactToolKind,
147-
{ completed: string; running: string; failed: string }
148-
>;
149-
150-
const set = labelsMap[kind];
145+
const set = labels[kind];
151146
if (failed) return set.failed;
152147
if (running) return set.running;
153148
return set.completed;

0 commit comments

Comments
 (0)