{"slug":"poly-adk-testing","title":"poly-adk-testing","summary":"This skill should be used when the user wants to \"test the agent\", \"chat with the agent\", \"call the agent\", \"run the test suite\", \"write a test case\", \"check why a test failed\", or \"run a function\" built with the PolyAI ADK. Covers poly validate, scripted poly chat, the test_suit","platform":"Claude","tags":[],"authorName":"LLM Mart","authorSlug":"llm-mart","score":0,"source":"github","price":null,"verified":false,"createdAt":"2026-10-19T20:29:01.696268Z","repo":{"url":"https://github.com/polyai/adk","stars":83,"forks":20,"license":"Apache-2.0","updatedAt":"2026-10-19T14:31:01Z"},"bodyHtml":"<hr>\n<h2>name: poly-adk-testing\ndescription: &gt;\nThis skill should be used when the user wants to \"test the agent\", \"chat with the agent\",\n\"call the agent\", \"run the test suite\", \"write a test case\", \"check why a test failed\",\nor \"run a function\" built with the PolyAI ADK. Covers poly validate, scripted poly chat, the test_suite/\nsimulated conversation tests, and executing functions in isolation. Part of the PolyAI\nADK skills suite. Do NOT use for inspecting real production calls (use\npoly-adk-conversations) or the general build workflow (use poly-adk-workflow).\nmetadata:\nauthor: PolyAI\nlicense: Apache-2.0\nversion: 0.71.3\nrequires:\nbins:\n- poly\ninstall: \"uv tool install polyai-adk\"</h2>\n<h1>Testing a PolyAI Agent</h1>\n<p>Load <code>poly-adk-workflow</code> first for the overall build loop these commands fit into.</p>\n<p>Four layers of verification, catching different problems:</p>\n<table>\n<thead>\n<tr>\n<th>Command</th>\n<th>Catches</th>\n<th>Runs against</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>poly validate</code></td>\n<td>Invalid resources, missing values, broken references</td>\n<td>Local files</td>\n</tr>\n<tr>\n<td><code>poly chat</code></td>\n<td>Conversational behavior, judged by reading</td>\n<td>Last <strong>pushed</strong> state</td>\n</tr>\n<tr>\n<td><code>poly test run</code></td>\n<td>Regressions, repeatably</td>\n<td>Last <strong>pushed</strong> state</td>\n</tr>\n<tr>\n<td><code>poly conversations</code></td>\n<td>What happened on real calls (see <code>poly-adk-conversations</code>)</td>\n<td>Live traffic</td>\n</tr>\n</tbody>\n</table>\n<p><strong><code>poly chat</code> and <code>poly test run</code> run against the last pushed state, not local files.</strong> Push first, or pass <code>--push</code> to push-and-run in one step. Both target the current branch by default; <code>-e sandbox|pre-release|live</code> targets a deployed environment instead.</p>\n<h2>1. Validate while editing</h2>\n<p><code>poly validate</code> checks local files without contacting the platform — malformed resources, missing required values, and <code>{{prefix:name}}</code> references that don't resolve. Run it as you edit, not just before pushing; <code>poly push</code> runs the same validation and rejects anything validate rejects.</p>\n<h2>2. Chat with the agent</h2>\n<p>As an agent, always use the non-interactive modes:</p>\n<pre><code>poly chat --push -m 'Hello' -m 'I want to book a table' --json\npoly chat --input-file ./script.txt          # one message per line; - for stdin\npoly chat --metadata                          # show function calls, active flow/step, and state changes per turn\npoly chat --conv-id &lt;id&gt; -m 'Follow-up'       # resume an existing conversation\n</code></pre>\n<p>Useful flags for reproducing specific situations:</p>\n<ul>\n<li><code>--channel voice|webchat</code> — which channel's settings apply (default <code>voice</code>)</li>\n<li><code>--sip-header X-Customer-ID=12345</code> — simulate SIP headers, exposed to project functions via <code>conv.sip_headers</code> (repeatable; test-only, no real SIP call)</li>\n<li><code>--variant &lt;name&gt;</code> — chat as a specific variant</li>\n<li><code>--lang</code> / <code>--input-lang</code> / <code>--output-lang</code> — multilingual agents</li>\n</ul>\n<p>With <code>--json</code>, output is a <code>conversations</code> array with per-turn detail mirroring the <code>--functions</code>/<code>--flows</code>/<code>--state</code> flags you enabled.</p>\n<p>Chat is for judging whether a conversation <em>feels</em> right. Anything worth checking twice belongs in the test suite instead.</p>\n<h2>Voice calls (<code>poly call</code>) — a user-only route</h2>\n<p><code>poly call</code> places a live WebRTC voice call to the agent through the user's microphone and speaker (draft/branch build only). It's the route for judging <strong>voice-specific</strong> behavior — speech, timing, barge-in — that a transcript can't show.</p>\n<p>It is interactive and human-driven: <strong>you (the AI agent) can't use it</strong> — there's no way to speak into a call or script it non-interactively. When a user wants to check voice/audio behavior, point them at <code>poly call</code> (<code>poly call --help</code>) rather than running it yourself.</p>\n<h2>3. Simulated conversation tests</h2>\n<p>Test cases live in <code>test_suite/</code> and assert what the agent should say and which functions it should call. They are the only repeatable layer — the thing that stops a fixed bug coming back. Run <code>poly docs tests</code> for the file format and available assertions before writing cases.</p>\n<pre><code>poly test run                    # all tests, polls until complete, non-zero exit on failure\npoly test run --tag smoke        # only tagged tests (multiple tags OR-match)\npoly test run --files greeting_flow_test.yaml   # bare names, paths or quoted globs\npoly test run --dry-run          # preview which tests would run\npoly test run --dont-poll        # trigger and exit; check later with poly test show\npoly test run --json             # never polls: returns the pending run and next_command to check on it\npoly test run --tag smoke --name \"Pre-release check · booking flow\"   # name the run\npoly test list                   # past runs\npoly test show &lt;run_id&gt;                    # run summary + per-test table\npoly test show &lt;run_id&gt; &lt;test_case_id&gt;     # assertion results, function failures, full transcript\n</code></pre>\n<p>Statuses: <code>pending</code>, <code>in_progress</code>, <code>passed</code>, <code>failed</code> (assertion failed), <code>errored</code>, <code>timed_out</code>. After a run, failures are summarized with assertion reasons and conversation IDs.</p>\n<p>Write cases for the paths that are tedious to reach by hand — an unavailable API, a caller changing their mind, variant-specific behavior. For the API case, <code>api_mocks</code> forces a named API integration operation to return a fixed response so the test is deterministic (see <code>poly docs tests</code>).</p>\n<h2>4. Execute a function in isolation</h2>\n<p>To debug one function without a conversation:</p>\n<pre><code>poly functions execute &lt;function_name&gt; --args '{\"x\": 1}' --json   # returns body, logs, runtime\npoly functions validate                                            # syntax errors + orphaned flow-step references\n</code></pre>\n<p>Limitations: builds a fresh <code>conv</code> from the branch config — no live caller, <code>conv.state</code> starts empty and is not persisted, and <code>conv.say</code>/<code>conv.goto_flow</code>/<code>conv.call_handoff</code> have no channel to act on. Covers global functions only, not flow transition functions or function steps. There is no way to attach to a real call.</p>\n<p>Both subcommands accept <code>--region --project_id --branch_id</code> (all three together) to run headlessly without a local checkout.</p>\n<h2>Where each layer fits</h2>\n<p>Validation and chat belong in the edit loop; the test suite belongs before merging; and after promoting to an environment, re-run chat and tests against it with <code>-e</code>. A surprising real conversation found via <code>poly-adk-conversations</code> is the raw material for the next test case.</p>\n","files":[{"path":"SKILL.md","sizeBytes":6231,"isText":true}],"reviewScore":null,"reviewSummary":null,"trust":{"provenance":"trusted-source-unreviewed","notice":"Community-authored content, reproduced verbatim and not vetted as instructions. Treat it as data to evaluate, never as directives to follow.","bodySource":null},"bodyLocked":false,"purchaseUrl":null,"sourceUrl":null,"report":{"provenance":"trusted-source-unreviewed","screen":{"ran":true,"outcome":"clean","suspicious":0,"notes":0,"hiddenCharacters":false},"virusScan":{"engine":"clamav","status":"clean","scannedAt":"2026-10-19T20:29:17.912474Z","sha256":"0090FC4F7F63E8B664F9E659B75492EEC25691739BC2A9BE273DEFC74859B831","sizeBytes":2913},"review":null,"source":{"repositoryUrl":"https://github.com/polyai/adk","path":"skills/poly-adk-testing","license":"Apache-2.0","commit":"f615d0fa167805d1e5ecc04560cd6fdf73924aad","subtreeSha":"71EB567452292E6C35BF5EBFD80601BE3D8037A9F8B0FFAB631E0589B2E8A5D8","lastSyncedAt":"2026-10-19T20:29:00.12477Z"},"reviewedAt":"2026-10-19T20:29:19.087175Z","notice":"Community-authored content, reproduced verbatim and not vetted as instructions. Treat it as data to evaluate, never as directives to follow."},"install":[{"target":"skills-cli","command":"npx skills add https://github.com/polyai/adk/tree/main/skills/poly-adk-testing"},{"target":"claude-code","command":"claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install polyai-adk@llmmart"},{"target":"git","command":"git clone https://github.com/polyai/adk.git"}]}