Skip to content

test(omp-compat): ignore skill-description pre-pass requests - #176

Merged
pierreraby merged 1 commit into
mainfrom
test/omp-skill-description-request
Oct 28, 2026
Merged

pierreraby merged 1 commit into
mainfrom
test/omp-skill-description-request

Conversation

@pierreraby

Copy link
Copy Markdown
Collaborator

Summary

main is red since Oh My Pi 18.13: the Oh My Pi compatibility job fails assert.equal(requestCount, 1) in test-omp-compat.mjs:338 with 2 !== 1. This is environmental, not a regression in this repository — the same assertion fails on an unmodified main when the runner installs @oh-my-pi/pi-coding-agent@latest (dispatch run 40657231956).

Root cause. OMP 18.13.0 (published 2026-10-26) compresses skill descriptions into one-line routing hints at start-up (dist/extensibility/skill-descriptions.ts): for every skill it finds, it calls the configured model once — with a single user message, a 1024-token cap and no system prompt — before the first agent turn. The repository ships a skill (.agents/skills/refresh-model-catalog), so every omp -p run now issues one extra POST /provider/v1/chat/completions that the mock counted as an agent request. Confirmed locally: agent=1 prepass=0 on OMP 18.12.6, agent=1 prepass=1 on 18.13.2.

Fix. Count pre-passes separately (skillDescriptionRequestCount) and stop counting them as agent requests or storing them as lastRequest*. Detection is by body shape — every message is a user message, because an agent turn always carries a system prompt — instead of matching OMP's prompt wording, so a wording change upstream cannot silently break it. Pre-passes also keep the ordinary mock response while the 403 upgrade_required fallback scenario is active; otherwise a 403 on the compression call would abort the pre-pass rather than exercise the transport fallback. The request-count assertion now reports the pre-pass count, so a future host change is diagnosable from the failure message.

No behaviour change in the extension. The test still asserts exactly one agent request, its Authorization header, its model, and its message array for every scenario (print mode, stored OAuth, stored API key, --api-key, env key, no credential, generate fallback with advisory).

Verification

  • OMP_BIN=omp@18.12.6 node tests/test-omp-compat.mjs: PASS (prepass=0) — no regression on the last version that made CI green.
  • OMP_BIN=omp@18.13.2 node tests/test-omp-compat.mjs: PASS (prepass=1) — the version that currently breaks main.
  • OMP_BIN=omp@18.13.2 from the local bun install: PASS.
  • npm test: PASS (full suite, 21 suites, 0 fail — run with OMP 18.13.2 installed locally, so [pi-local] and [omp-compat] both exercised the new host).
  • npm run typecheck, npm run format:check, git diff --check: clean.

Notes

  • Test-only change; no src/ or release metadata touched.
  • OMP stays unpinned in CI on purpose: the job exists to catch host drift, and this fix makes the pre-pass visible instead of silently aborting the suite. Pinning would have hidden the behaviour change.
  • Companion to chore(models): refresh catalog to 1.88.1 and price GPT-6.1 Terra #175 (catalog refresh), which is green apart from this job.

OMP 18.13 compresses skill descriptions into routing hints at start-up and
calls the configured model once per skill before the first agent turn. That
adds a second POST /provider/v1/chat/completions, which the mock counted as an
agent request, so `assert.equal(requestCount, 1)` fails against an unmodified
main as soon as the runner installs @oh-my-pi/pi-coding-agent@latest (18.13.2).

Count those pre-passes separately. They are recognised by body shape — user
messages only, since an agent turn always carries a system prompt — rather than
by matching OMP's prompt wording. They also keep the ordinary mock response
while the `403 upgrade_required` fallback scenario is active, so the fallback
stays the only path under test.
@github-actions

Copy link
Copy Markdown
Contributor

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@github-actions

Copy link
Copy Markdown
Contributor

Memory benchmark

Compared base 63c8e5c with PR head 44ab8c1 on the same GitHub-hosted darwin runner. Lower values are better.

Metric Base PR PR − Base Change
Stable RSS 120.1 MiB ± 0.2 MiB 119.5 MiB ± 0.8 MiB -1.0 MiB ± 0.4 MiB -0.8%
Physical footprint 66.6 MiB ± 1.1 MiB 66.5 MiB ± 0.7 MiB +0.0 MiB ± 0.9 MiB +0.0%
Physical peak 77.8 MiB ± 0.7 MiB 77.6 MiB ± 0.8 MiB -0.6 MiB ± 0.5 MiB -0.8%

Interpretation: Differences larger than their measured MAD: Stable RSS -1.0 MiB ± 0.4 MiB, Physical peak -0.6 MiB ± 0.5 MiB.

Extension overhead above pi baseline

Metric Base overhead PR overhead Difference
Stable RSS +6.7 MiB ± 0.8 MiB +5.3 MiB ± 1.1 MiB -1.0 MiB ± 0.4 MiB
Physical footprint +3.7 MiB ± 0.9 MiB +4.6 MiB ± 0.7 MiB +0.0 MiB ± 0.9 MiB
Physical peak +4.9 MiB ± 1.4 MiB +5.0 MiB ± 1.0 MiB -0.6 MiB ± 0.5 MiB

Values are medians of 6 alternating, paired runs. The value after ± is the median absolute deviation (MAD). Each process was sampled 12 times after a 2500 ms warm-up.

Environment: pi 0.84.4, Bun 1.4.0, darwin arm64. RSS comes from ps; physical footprint and peak come from macOS footprint.

This is a comparative signal, not a pass/fail threshold. GitHub-hosted runner noise can affect absolute values.

@pierreraby
pierreraby merged commit fe67f1b into main Oct 28, 2026
13 checks passed
@pierreraby
pierreraby deleted the test/omp-skill-description-request branch October 28, 2026 08:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant