Skip to content
Source
Sign inSign up
TanStack/ai

feat(ai-harness): add toolCallId to step.ask questions from a durable tool #2316 (GitHub #2315)

Open381181295(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/2315/headopened View on GitHub

Showing 12 changed files with 7 additions and 0 deletions (loading 9).

x
0 of 12 viewed, 12 left
5 additions and 0 deletions.changeset/step-ask-tool-call-id.mdAdded
View file
@@ -0,0 +1,5 @@
+---
+'@tanstack/ai-harness': minor
+---
+​
+A question of `step.ask` in a durable tool has the `toolCallId` of the call that asks: in the session view's `questions`, in `snapshot().pendingWaits`, and in `onQuestion`. A UI can show the question with its tool call without rebuilding the question id.
1 addition and 0 deletionsdocs/harness/custom-ui.mdModified
View file
@@ -304,6 +304,7 @@
- `schema`: the JSON Schema of the answer, when the question has one. Without a schema, the answer is text.
- `secret`: the answer is a key or a password. Hide what the user types.
- `url`: a page that the user must open before they answer, for example a payment page.
+- `toolCallId`: the id of the tool call that asks, for a `step.ask` in a durable tool. Use it to show the question with that call. Other questions have none.
- `answer(value)`: sends the answer.
​
When a question has a `url`, show the link. The user opens it, then answers. The session does not open the page. This handler adds the link to the screen:
1 addition and 0 deletionsdocs/harness/waits.mdModified
View file
@@ -83,6 +83,7 @@
- Without `runId`, it resolves with the first wait of the session.
- `session.snapshot().pendingWaits` lists every open wait, oldest first. A wait that a chat run stopped for has its `interrupt`. A wait of the stopped turn has `turn: true`.
- A wait of an agent that the model calls as a tool has the `agent` name and the `subagentRunId` of that agent run. See [When an agent tool waits](./subagents#when-an-agent-tool-waits).
+- A question of `step.ask` in a durable tool has the `toolCallId` of the call that asks.
​
Each wait has a `kind`:
​