Start the scripted mock on a free port. Each MAIN-LOOP /v1/messages POST
consumes the next turn; one past the end of the script is answered with a
non-retryable API error, never a copy of the last turn (#340 — a looping
agent would pass on turns nobody scripted), and runHarnessTest then fails
the test from the recorded requests (findScriptOverrun);
a SIDE-CHANNEL POST — the CLI's own bookkeeping calls, see
isMainLoopRequest — is answered from outside the script and consumes
nothing. Resolves to a handle with the base url and a close().
Start the scripted mock on a free port. Each MAIN-LOOP
/v1/messagesPOST consumes the next turn; one past the end of the script is answered with a non-retryable API error, never a copy of the last turn (#340 — a looping agent would pass on turns nobody scripted), andrunHarnessTestthen fails the test from the recorded requests (findScriptOverrun); a SIDE-CHANNEL POST — the CLI's own bookkeeping calls, see isMainLoopRequest — is answered from outside the script and consumes nothing. Resolves to a handle with the baseurland aclose().