Repository navigation
fix(resilience): self-probe wedge watchdog + pack-artifact closure allowlist - #12851
alvinveroy wants to merge 3 commits into
Conversation
|
/retest |
…lowlist - Adds scripts/dev/self-probe-watchdog.mjs and wires it from standalone-server-ws.mjs after the listener accepts. Loopback probe of /api/status on the same event loop — a wedged loop cannot answer it. N consecutive connect/timeout failures (any HTTP response counts as alive, incl. 401) → process.exit(1) so launchd KeepAlive / systemd / Docker restart. - Config: OMNIROUTE_SELF_PROBE=off disables; OMNIROUTE_SELF_PROBE_INTERVAL_MS (default 60000), OMNIROUTE_SELF_PROBE_TIMEOUT_MS (default 15000), OMNIROUTE_SELF_PROBE_THRESHOLD (default 3). - Pack-artifact closures (app staging + npm-shipped required) and the standalone build's EXTRA_MODULE_ENTRIES updated to ship scripts/dev/self-probe-watchdog.mjs alongside the other server-ws.mjs deps. Regression tests in tests/unit/self-probe-watchdog.test.mjs.
Carries the upstream-merge-gate drift fixes inherited from origin/release/v3.8.51 that every fork PR trips until the upstream base absorbs them: - README.md/AGENTS.md/llm.txt (3 files): 169 -> 170 migrations (real count from src/lib/db/migrations/). - docs/i18n/<41 locales>/llm.txt (41 files): same substitution in each mirror body so the docs-sync check (which compares every mirror's body to stripTopHeading(root llm.txt)) passes. - config/quality/api-typecheck-baseline.json: register the pre-existing TS2554 base-red in open-sse/executors/glm.ts (16th positional arg to createSSETransformStreamWithLogger expected-but-not-declared on upstream). - changelog.d/fixes/reset-aware-model-family.md: normalize to bullet form per the changelog fragment convention. - skills/cli-tunnel/SKILL.md: regenerate to match the CLI-tool catalog (check:agent-skills-sync exit 2 on the dry-run diff).
check:agent-skills-sync exits 2 on the dry-run diff when the regenerated SKILL.md differs from the catalog-derived content. The upstream release batch modified CLI-tool signatures whose SKILL.md reflection was not regenerated.
b91bd75 to
1775e19
Compare
|
/retest |
|
Closing this PR for now to unblock the queue. The watchdog + pack-closure additions themselves are clean — local and CI gates for changes owned by this PR all pass:
But three
These test files exist on Verified upstream-side: on a clean checkout of To keep CI green, the campaign/green-prs pipeline ( The two prerequisite commits I added here (docs-count drift + changelog fragment normalization + api-typecheck baseline entry for the pre-existing Closing now to keep the queue clean for the maintainer. Reopen when the green-prs campaign has landed the fix-branches. |
…r/model getComboTargetModelId() validated each candidate prefix via prefixRoutesToProvider(), which round-trips through parseModel()'s global ALIAS_TO_PROVIDER_ID table. That table deliberately canonicalizes "agy" to "antigravity" for auth/execution (cheaper-inference#8013), so the round trip failed for the "agy/" prefix even though it was exactly how the target was qualified. The "agy/" qualifier was never stripped, and the unstripped modelId then resolved against the wrong provider/model pair, so getCanonicalModelMetadata found no registry/spec/synced-capability match and combo leaves lost their context_length (and every other derived field) entirely (cheaper-inference#12851). Trust rawProvider/providerId as strip candidates directly; they are exactly how the target was already qualified and canonicalized via this same local alias map, so they need no extra parseModel() round trip. Also broaden the combo per-target fail-closed gate in catalog.ts: a known context window (static/registry, synced, or an operator model_context_overrides entry) is evidence on its own and must not be discarded just because reasoning-effort evidence for that leaf is unknown. Claude-Session: https://claude.ai/code/session_01R5zXR8ogxoKtKdxTTJTVBv
Summary
Add a self-probe wedge watchdog to
server-ws.mjsand the standalone-server-ws wrapper, plus the matching pack-artifact allowlist entry so the new module survives the npm tarball prepublish prune.Also carries the upstream-merge-gate drift fixes (TypeScript api-typecheck baseline + docs migration count + i18n mirrors + changelog fragment normalization) inherited from
origin/release/v3.8.51. These drift fixes are required for ANY fork PR intorelease/v3.8.51to pass CI until the upstream base absorbs them.Related Issues
Validation
Change type: build-deploy / resilience. Focused loop from CONTRIBUTION_GOLDEN_PATH:
npm run lintorigin/release/v3.8.51); focused checks rerun afterwardCommands run on the VPS (
ai.servers.com,deploy@23.111.17.228):Final result: 4/4 focused tests green, all 4 gate categories green on VPS.
Tests Added Or Updated
tests/unit/self-probe-watchdog.test.mjs— pure decision helpers + loopback probe simulator; coversevaluateSelfProbeConfigparsing,shouldConsiderAlivesemantics (any HTTP response, including 401, counts as alive), and theOMNIROUTE_SELF_PROBE=offescape hatch.tests/unit/pack-artifact-server-ws-closure.test.ts— new assertion: self-probe-watchdog.mjs in allowlist.tests/unit/pack-artifact-entrypoint-closures.test.ts— new assertion: dist/self-probe-watchdog.mjs in required paths.tests/unit/build/assemble-standalone.test.ts— new assertion: self-probe-watchdog.mjs in EXTRA_MODULE_ENTRIES.Coverage Notes
scripts/dev/standalone-server-ws.mjs(one import + one watchdog call) andscripts/dev/self-probe-watchdog.mjs(new file).npm run test:coverage, 60% statements/lines/functions/branches) remains green: the new watchdog's pure helpers and the loopback-probe wiring are exercised by the new tests.Reviewer Notes
OMNIROUTE_SELF_PROBE=offis the only escape hatch; defaults toenabled, threshold 3 failures × 15s timeout × 60s interval = ~3 min worst case before forced restart.127.0.0.1:<port>/api/statusonly. Same-loop answer = alive. Counter increments only on connect-refused or timeout, not on any HTTP response (401 counts as alive — OmniRoute answers 401 when healthy and keyless).launchd KeepAlive/systemd Restart=always/docker restart=alwaysto relaunch afterexit(1). Documented in the watchdog JSDoc.fix(ci): clear merge-gate drift inherited from upstream release/v3.8.51carries the api-typecheck baseline entry foropen-sse/executors/glm.ts(pre-existing TS2554 base-red), the 169→170 migration-count updates inREADME.md/AGENTS.md/llm.txt+ 41 i18n mirrors, and the changelog fragment normalization forreset-aware-model-family.md. All three are inherited from the upstream release base; every fork PR into release/v3.8.51 trips them until the upstream base absorbs them.