Docs / ai / AgentTalkResult

AgentTalkResult

typesince 0.7.0not for built apps

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

FieldTypeDescription
status'done' | 'running' | 'error' | 'unknown'The discriminator. unknown means the job expired (1h TTL) or never existed.
job_idstringThe run id — pass to getAgentResult while status is running.
agent_idstringThe agent that ran.
site_idstringThe site the agent belongs to.
personastringThe persona name that handled the task.
responsestringThe answer. Present only when status is 'done'.
turns_usednumberAgent turns consumed by the run.
cost_usdnumberRun cost in USD.
routedbooleanTrue when the capability registry picked the target rather than the caller.
messagestringHuman-readable status text. Present when status is 'running'.
poll_toolstringHow to fetch the answer. Present when status is 'running'.
errorstringFailure detail when status is 'error'.
Warningresponse 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.
Warningstatus: '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.