The Traffic view on the vLLM lanes, bench.sh's lane names, the FP4-Local lane's start check, the proxy's tripwire on vLLM's reasoning (v6.44), omp's default from the installed template, the one-boot line, and the test that holds every list of the lanes, with what the series' second review found in them. docs/pi.md said omp's default was always lean: it is the installed template's. v1.37.1 is the release of the documentation before it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
7.1 KiB
pi and omp integration
What pi-gen.py generates for pi and omp (oh-my-pi), the coding agents that read no opencode.json. Companion to docs/opencode.md: same engines, same key, same limits, from one source.
Generated artifacts, user-copied
pi (~/.pi/agent) and omp (~/.omp/agent) keep their default model, provider names and limits as plain values in their own files. pi-gen.py writes the agents' side of this box's facts as ready files next to ~/.config/qwen38/opencode.json, the artifact install.sh fits, ./switch-model.sh re-points and oc-fit-limits.py re-fits:
~/.config/qwen38/pi/models.json ~/.config/qwen38/pi/settings.json
~/.config/qwen38/omp/models.yml ~/.config/qwen38/omp/config.yml
Run ./pi-gen.py once to create them. From then on an update (./install.sh, since v1.31), ./switch-model.sh (block 4f) and a fit (oc-fit-limits.py, the cockpit's button) regenerate them; a box that never ran it gets no such files. python3 pi-gen.py --dry-run shows what a regeneration would change.
The repo never writes into ~/.pi or ~/.omp; installing is your copy. On an agent with no config of its own yet:
mkdir -p ~/.pi/agent && cp -n ~/.config/qwen38/pi/*.json ~/.pi/agent/
mkdir -p ~/.omp/agent && cp -n ~/.config/qwen38/omp/*.yml ~/.omp/agent/
cp -n copies nothing over a file that exists: if you already have a models.json or models.yml with other providers, merge the qwen38 and flashnext providers into it by hand (each agent reads one such file), and likewise the default model and compaction settings. Copy again after a switch or a fit, and the agent carries the new lane.
One build, two serializations
The pi pair is canonical; the omp pair is converted from it: same models array, thinking block added, pi's inputLimits and compat dropped (no room for them in omp's schema, and a schema error makes omp disable the whole file), default provider and bare model id into modelRoles.default. Same values, different files, built once: they cannot disagree. The artifact's {file:...} key becomes both agents' !cat <path> form, which they run in a shell at request time: no secret in their files, and a rotated key is read on the next request.
Reasoning effort, the system prompt, images, compaction
The patched template reads reasoning_effort: lean is its default (xhigh on a box installed with LEAN_DEFAULT=0), max and high read as xhigh, minimal as low. SGLang takes the effort from chat_template_kwargs.reasoning_effort or from a top-level reasoning_effort (the first when both are there), and validates the top-level one against none, minimal, low, medium, high, xhigh and max: sent to the engine, a top-level lean is a 400. The proxy moves such a level into chat_template_kwargs (v6.18) and drops it when chat_template_kwargs names a level already (v6.30), so through :30001 neither is refused.
- pi.
modelThinkingLevelsisofffor our models: no effort field, so the template's default,lean(what "no variant" means for opencode), orxhighon a box installed withLEAN_DEFAULT=0and on the Flash FP4-Local lane, its model card's default. A level picked in pi goes out as the top-level field:minimalreads aslow, andhighasxhigh(pi sendshighforxhighandmaxtoo). Each model also carriescompat.supportsDeveloperRole: false: pi sends its system prompt as thedeveloperrole to a reasoning model on a provider it does not know, and the served template refuses that role (every request was a 400 "Unexpected message role." without it). - Kolibri. Its template reads
none,low,mediumorhigh, and vLLM hands it the top-level field: pi sends it, withthinkingLevelMaptakingofftonone(with no field Kolibri reasons athigh),minimaltolowandxhightohigh, and its level starts athigh, what Kolibri does unasked. omp offersnoneasminimal(reasoningEffortMap), and starts athightoo. - Nemotron (Bolt, and Super VL, whose template reads the same two). Its template reads
enable_thinkingandmedium_effort, and no effort level: pi sends the top-level field as for Kolibri (thinkingLevelMaptakingofftonone,minimaltolowandxhightohigh), its level starts athigh, Bolt's full reasoning, and the proxy says each level in the template's words (v6.40):noneandminimalturn the reasoning off,lowandmediumask its shorter one,highits default. omp sends its pick inchat_template_kwargs.reasoning_effort, which the proxy translates the same way. - omp. Its picker goes through the same enum, and
compat.reasoningEffortMaptranslates the pick for the provider: the generator gives itefforts: [minimal, low, medium, xhigh]withminimalmapped tolean, and as its default the installed template's own:minimal(lean), orxhighon a box installed withLEAN_DEFAULT=0and on the Flash FP4-Local lane (pi-gen.py reads it beside the configs it writes; omp sends its default level on every request), the same ladder (lean/low/medium/xhigh) the artifact'svariantsdeclare;offlands onlean, and a level the list does not hold on the nearest one below it (highonmedium,maxonxhigh).compat.qwenTemplateReasoningEffortroutes the mapped level ontochat_template_kwargs.reasoning_effort(it ships on by default for Qwen 3.8+ ids on LM Studio, llama.cpp discovery and vLLM only, none of them this proxy's provider id: without it the picker moved and nothing was sent), andcompat.thinkingFormat: qwen-chat-template, omp's dialect for vLLM and SGLang, sends it there alone: omp's default dialect also sent a top-levellean, a 400 on every request at the default level until the proxy dropped that copy (v6.30, v1.22.1; checked with omp in its default dialect, a 400 through v6.29 and an answer through v6.30).
images.autoResize (on) plus a generated 1568×1568 / 512 KiB per-model resize cap keep an attachment from blowing the prompt past the lane. Compaction follows the artifact: keepRecentTokens = opencode's preserve_recent_tokens, and each lane's reserveTokens = that lane's output cap.
Verified on 2026-10-01 with pi 0.99.2 (@earendil-works/pi-coding-agent) and omp 18.4.9 (@oh-my-pi/pi-coding-agent, which needs Bun 1.3.14 or later), through the proxy to the flash lane: a reply at every thinking level of both agents, and a tool call (read) in each. Both lanes' images validate the effort the same way.
What still differs
pi lifts no hidden output cap (none exists) and retries transient errors itself; the auto-continue plugin's stuck-after-compaction case is still opencode's edge. Nothing pins pi or omp versions (opencode's pin exists because repo behaviour was read out of its binary): a release of either that changes these fields can need a regeneration. omp's roles, fallback chains and path-scoped models stay yours: the artifact sets only the two providers and the default role's model. The cockpit's Agent view stays opencode-only.