# Live verification — Pi

[Русский](live-verification.ru.md) · [README](../README.md)

**PASS, 2026-09-09.** Tested with `@earendil-works/pi-coding-agent` 0.85.1 and Node.js 22.22.2. The package was installed using real `pi install <local-package> -l --approve`, loaded through `pi.extensions`, and removed through Pi. A separate observer extension recorded selection and registered the harmless test tool.

| Evidence | Observed result |
| --- | --- |
| Completed (UTC) | `2026-09-09T11:22:38Z` |
| Cortiq | HTTP 200, schema `1.1` |
| Request | `req_18d3a33a39f6762500487d` |
| Decision | `chitchat`, `medium`, score `0.45327267` |
| Original model | `openrouter/deepseek/deepseek-v4-pro` |
| Selected and generated model | `openrouter/deepseek/deepseek-v4-flash` |
| Tool | exactly one native `cortiq_live_probe` execution |
| Provider response | two assistant messages, final text `CORTIQ_LIVE_OK` |
| Global default | preserved as DeepSeek Pro |

The prompt was: “Call cortiq_live_probe exactly once. Then reply with only the marker it returns. Do not call any other tool.” The tool returns a fixed string and cannot read files, run commands, or access credentials. The observer does not inject routing decisions.

All three tiers deliberately map to Flash; the original model is Pro and no fallback is configured. This tests live classification → native selection → provider generation → tool continuation. Tier differentiation and routing priority are covered by deterministic tests. The catalog also contained `anthropic/claude-sonnet-5`; its presence does not prove generation or account access. The successful routed run generated only with Flash. This is one synthetic tool cycle, not a quality benchmark or exhaustive model compatibility test.

## Reproduce

Supply `CORTIQ_ROUTER_KEY` and `OPENROUTER_API_KEY` through your environment or secret manager; never commit values or include them in command history. From a Git checkout:

```sh
npm ci
CORTIQ_LIVE_SMOKE=1 npm run live
```

For an unpacked npm archive, install the host separately:

```sh
npm install --prefix .live-host --no-save @earendil-works/pi-coding-agent@0.85.1
PI_CLI="$PWD/.live-host/node_modules/@earendil-works/pi-coding-agent/dist/bundle/cli.js" CORTIQ_LIVE_SMOKE=1 npm run live
```

`PI_CLI` may also reuse an existing 0.85.1 CLI; the script checks the package version. `CORTIQ_LIVE_PACKAGE` optionally chooses another package under test. `CORTIQ_LIVE_MODEL` chooses another catalog model with account access and tool support.

Explicit opt-in permits paid calls to `https://router.allaigate.com/v1/route` and native generation through `https://openrouter.ai/api/v1`. Classifier timeout: **15,000 ms**; each CLI command timeout: **120 seconds**; model output limit: **1,024 tokens**; reasoning off; abort before a fourth turn. Only the fixed probe is active. Skills, templates, themes, context files, and session persistence are disabled. Usual host settings/history are not loaded, temporary state is removed, and supplied keys are redacted from diagnostics. CI remains fixture-only.

## Test configuration correction and limits

The first two attempts classified and selected Flash successfully, but provider HTTP 401 reported “Missing Authentication header,” with no tool execution. The test's custom `models.json` mistakenly used plain `OPENROUTER_API_KEY`, which Pi 0.85.1 treats as a literal. The final harness uses `"apiKey": "$OPENROUTER_API_KEY"` and `"authHeader": true`; the next run passed. No adapter credential handling changed. Normal installations retain the user's working provider configuration.

Selection remains in the current session until later routing or manual selection. This test verifies the global default is preserved, not automatic restoration of the preceding session model. The README documents asynchronous setter and queued-input limits. Network availability and classifier decisions can change between runs.

## Version 0.1.1: documentation update

Version 0.1.1 clarifies the product descriptions and AllaiGate links. Routing behavior is unchanged. The live verification recorded above used version 0.1.0; paid tests were not repeated for this documentation release.
