AgentTalkResult
Type: the state of an agent-talk run — returned identically by talkToAgent and getAgentResult.
import type { AgentTalkResult } from 'flowstack-sdk'One shape covers both the inline answer and the polled job. status is the discriminator and the only field always meaningful: response/turns_used/cost_usd appear when done; message/poll_tool appear when running.
Signature
interface AgentTalkResult { status: 'done' | 'running' | 'error' | 'unknown'; job_id: string; agent_id: string; site_id: string; persona: string; response?: string; turns_used?: number; cost_usd?: number; routed?: boolean; message?: string; poll_tool?: string; error?: string }Returns
| Field | Type | Description |
|---|---|---|
status | 'done' | 'running' | 'error' | 'unknown' | The discriminator. unknown means the job expired (1h TTL) or never existed. |
job_id | string | The run id — pass to getAgentResult while status is running. |
agent_id | string | The agent that ran. |
site_id | string | The site the agent belongs to. |
persona | string | The persona name that handled the task. |
response | string | The answer. Present only when status is 'done'. |
turns_used | number | Agent turns consumed by the run. |
cost_usd | number | Run cost in USD. |
routed | boolean | True when the capability registry picked the target rather than the caller. |
message | string | Human-readable status text. Present when status is 'running'. |
poll_tool | string | How to fetch the answer. Present when status is 'running'. |
error | string | Failure detail when status is 'error'. |
Warning
response is optional. Reading it without first checking status === 'done' yields undefined on every run slower than waitSeconds — which is the normal case for research agents.Warning
status: 'error' and status: 'unknown' both arrive with a successful (ok: true) HTTP response. Transport success is not run success — branch on status, not on res.ok alone.See also
talkToAgent · getAgentResult · TalkToAgentOptions
Source: src/api/client.ts (agent-to-agent talk, P0-187 FR3b) · Also available in llms-full.txt and registry.json.