fix: print the running tool once, not twice (#17)

This commit was merged in pull request #17.
This commit is contained in:
2026-10-05 09:49:39 +00:00
parent 26e05dea5b
commit ff99778e5d
7 changed files with 198 additions and 34 deletions
+28
View File
@@ -158,6 +158,24 @@ export interface SessionSummary {
*/
export type VisionSupport = "yes" | "no" | "unknown";
/**
* The tool running right now, and how stale it is getting.
*
* Lives here rather than beside the chat state machine so that `thread.ts` can
* carry it into the transcript, which is the only place it is now rendered.
*/
export interface ToolActivity {
/** Human-readable label, e.g. "Searching the web". */
label: string;
/**
* How many times this turn has now started this *identical* call.
*
* Counted by the agent over name and arguments together, so two different
* searches are two tools doing their job rather than a repeat.
*/
count: number;
}
/** A model as reported by `GET /api/tags`. */
export interface ModelInfo {
name: string;
@@ -204,6 +222,16 @@ export interface ThreadMessage {
error?: string;
/** Activity line shown while this message is streaming, e.g. "Searching the web". */
status?: string;
/**
* The tool this message is waiting on, when there is one.
*
* Separate from {@link ThreadMessage.status} because the two are rendered from
* different triggers: the status is a stand-in used only while there is no text
* to read, while a running tool is worth saying whether or not tokens have
* started arriving. Carrying both is what lets one line be printed for one
* fact, rather than the same sentence appearing twice at the top of a turn.
*/
activity?: ToolActivity;
/** Images attached to this question. Only ever non-empty on a user message. */
attachments: Attachment[];
}