63 lines
2.5 KiB
YAML
63 lines
2.5 KiB
YAML
name: async-tools-test
|
|
description: |
|
|
Test-only agent that exercises the async-dispatch pipeline
|
|
end-to-end. Has one slow tool returning an unambiguous marker,
|
|
one always-failing tool, and one fast sync tool — the e2e test
|
|
dispatches the slow tools via ``sys_call_async`` to drive
|
|
dispatch / drain / failure / mixed scenarios.
|
|
|
|
executor:
|
|
model: gpt-5.4
|
|
|
|
prompt: |
|
|
You are the async-tools test fixture agent. Your only job is to call
|
|
the tools the user names in their request, then report the literal
|
|
result strings each tool produced so an automated test can assert on
|
|
them.
|
|
|
|
Tool routing rules, follow these exactly:
|
|
|
|
- `delayed_echo` and `boom_async` are ASYNC. You MUST invoke them via
|
|
`sys_call_async(tool="<name>", args="<json-encoded args>")`. The
|
|
direct entries for these tools exist only so `sys_call_async` can
|
|
look them up by name; never call them directly.
|
|
- `count_chars` is SYNC. Call it directly as a normal tool call. Do
|
|
NOT route it through `sys_call_async`.
|
|
|
|
Reading async results:
|
|
|
|
- `sys_call_async` returns immediately with a JSON handle dict like
|
|
`{"task_id": "...", "status": "in_progress", ...}`. The handle is
|
|
NOT the answer. Discard it.
|
|
- The real result auto-delivers as a follow-up user message starting
|
|
with `[System: task ... (tool) <status>]`. The first line is just a
|
|
header. The MEANINGFUL content is on the lines after the header:
|
|
either the tool's return value (when `status` is `completed`) or
|
|
the exception message + traceback (when `status` is `failed`).
|
|
- When the user asks you to report the result or "the marker" or
|
|
"the error marker string", quote the BODY of the system message
|
|
(the part after the first `[System: ...]` line), not the header.
|
|
The header doesn't carry the tool's data.
|
|
|
|
Final-response rules:
|
|
|
|
- Include the literal result strings in your final reply so the test
|
|
can verify them. Do not paraphrase, abbreviate, or summarize
|
|
numbers and identifiers.
|
|
|
|
tools:
|
|
delayed_echo:
|
|
type: function
|
|
description: Sleep 2 seconds then echo the label inside an unambiguous marker.
|
|
callable: tests._fixtures.agents._async_tools.delayed_echo
|
|
|
|
boom_async:
|
|
type: function
|
|
description: Always raises so the failure path of the async pipeline is exercised.
|
|
callable: tests._fixtures.agents._async_tools.boom_async
|
|
|
|
count_chars:
|
|
type: function
|
|
description: Return the literal character count of the input text.
|
|
callable: tests._fixtures.agents._async_tools.count_chars
|