These tests are the “runtime harness safety net”: they encode harness quirks as executable expectations so adapters don’t silently drift.
- A shared set of tests every runtime adapter must pass.
- Mostly mocked/offline (no network), with optional gated live smoke tests.
- Focused on contract invariants (event ordering, tool-loop duplexing, determinism, and observability), not model quality.
model.output.deltaemits typedModelOutputDeltaPayloadblocks with stableblock_id.model.output.completedemits final typed assistant blocks.model.inputexists and references compiled input artifacts for large payloads.
- Runtime requests a tool (
tool.call.requested). - CodeSDK emits policy events and approves (
tool.call.policy_evaluated→tool.call.approved). - Tool executes and completes (
tool.call.started→tool.call.completed) with required metadata:executed_by,execution_env,policy_snapshot,sandboxsummary, result refs/previews
- CodeSDK feeds result back via
sendToolResult(tool_call_id, ...).
- Runtime requests a tool (
tool.call.requested). - CodeSDK denies (
tool.call.policy_evaluated→tool.call.denied) with:- deterministic
reason policy_snapshotwithdecision: deny
- deterministic
- CodeSDK feeds denial back via
sendToolDenied(tool_call_id, ...).
stop()mid-stream produces a terminaltask.stopped.- No additional tool execution occurs after stop is requested (best-effort but enforced by executor/tool runner).
- Adapter runs without blocking for stdin prompts.
- Runtime “ask user” semantics (if any) degrade deterministically and are attributable in
tool.call.policy_evaluated.
Implicit sources (“hidden input”)
model.inputincludes animplicit_sources_refartifact describing:- what implicit sources were used (or explicitly disabled)
- precedence
- safe hashes (never secrets)
- Hashes are stable across runs in the same
credentialNamespace.
- Adapter/executor tolerates multiple outstanding tool calls (multiple
tool_call_idbefore any results). - If the runtime cannot be configured to avoid this, the executor must queue and process safely (serial execution is acceptable in P1).
- Tool output streaming events are attributable by
tool_call_id.
- A forbidden tool cannot execute even if the runtime would otherwise try.
- The test asserts behavior (no tool execution events / no
sendToolResultfrom execution), not “tool list” output.
- Adapter declares supported MCP transports and a preference order (per harness spec).
- Chosen transport (and fallback, if used) is recorded in support bundle metadata.
Only run when explicitly enabled (e.g., RUN_LIVE_TESTS=1) and credentials are present.
Smoke scenarios:
- one prompt → streaming output
- one tool call → approve → execute via MCP host → feed result back