From 88bfc36585f4961feed3d77ca1ceed6f03ac3c8d Mon Sep 17 00:00:00 2001 From: dtzp555 Date: Mon, 11 May 2026 07:23:24 +1000 Subject: [PATCH] chore(doctor): nit fixes for --check oauth (N3 body=null test + N4 skipped sentinel comment) --- scripts/doctor.mjs | 3 +++ test-features.mjs | 11 +++++++++++ 2 files changed, 14 insertions(+) diff --git a/scripts/doctor.mjs b/scripts/doctor.mjs index 9e88ce4..abe70b6 100644 --- a/scripts/doctor.mjs +++ b/scripts/doctor.mjs @@ -256,6 +256,9 @@ function runOauthOnly(opts, checks, push) { } const fail_count = checks.filter(c => c.level === "FAIL").length; + // "skipped" = --check oauth fast path intentionally omits version detection. + // AI agents should NOT semver-compare against current_version/latest_version when + // either equals "skipped"; the full path provides those fields when needed. return { schema_version: SCHEMA_VERSION, timestamp: new Date().toISOString(), diff --git a/test-features.mjs b/test-features.mjs index 2ab0c1a..d7fa038 100644 --- a/test-features.mjs +++ b/test-features.mjs @@ -883,6 +883,17 @@ await asyncTest("doctor --check oauth + service down → fix_service", async () assert.equal(result.fail_count, 1); }); +await asyncTest("doctor --check oauth + 200 with null body → fix_service", async () => { + const result = await runDoctor({ + checkOnly: "oauth", + mockHealth: { status: 200, body: null } + }); + const ids = result.checks.map(c => c.id); + assert.deepEqual(ids, ["oauth_ok"]); + assert.equal(result.next_action.kind, "fix_service"); + assert.equal(result.fail_count, 1); +}); + // ── Cleanup ── closeDb();