diff --git a/.github/ocr/README.md b/.github/ocr/README.md index a5c56a561..b05b71b84 100644 --- a/.github/ocr/README.md +++ b/.github/ocr/README.md @@ -35,7 +35,7 @@ For `large-lean-hotspots`, the scout is enabled by default and uses sandboxed.sh - `OCR_SCOUT_ENABLED`: optional, defaults to `true`; set to `false` to disable only the large Lean scout call. - `OCR_SCOUT_LLM_URL`: optional; defaults to `OCR_LLM_URL` when the same sandboxed endpoint supports model selection. -- `OCR_SCOUT_LLM_KEY`: optional; defaults to `OCR_LLM_KEY` when the same sandboxed key can route both models. +- `OCR_SCOUT_LLM_KEY`: optional; defaults to `OCR_LLM_KEY`, then `OCR_LLM_TOKEN`, when the same sandboxed key can route both models. - `OCR_SCOUT_LLM_MODEL`: optional; defaults to `MiniMax-M3`, the MiniMax hybrid long-context scout model listed in the sandboxed.sh provider catalog. The router sends only a bounded JSON risk dossier to the scout model. The scout model is cheap triage only: it selects packet IDs, reasons, risk categories, questions for a stronger reviewer, and residual coverage. It never produces final review approval. If scout configuration is absent, disabled, malformed, rejected by the provider, or the call fails, the router records that state in metrics and falls back to deterministic ranking. diff --git a/.github/scripts/ocr-router.js b/.github/scripts/ocr-router.js index 406c44e38..308afd0ef 100644 --- a/.github/scripts/ocr-router.js +++ b/.github/scripts/ocr-router.js @@ -485,6 +485,7 @@ function stripThinking(text) { return text .replace(/[\s\S]*?<\/mm:think>/gi, '') .replace(/[\s\S]*?<\/think>/gi, '') + .trim() .replace(/^```(?:json)?\s*/i, '') .replace(/\s*```$/i, ''); } diff --git a/.github/scripts/test-ocr-routing.js b/.github/scripts/test-ocr-routing.js index 1582e7442..c09f341cb 100644 --- a/.github/scripts/test-ocr-routing.js +++ b/.github/scripts/test-ocr-routing.js @@ -148,8 +148,8 @@ function testScoutConfigDefaultsToMiniMaxOnOcrEndpoint() { assert.strictEqual(config.url, 'https://sandboxed.example/v1'); assert.strictEqual(config.key, 'shared-key'); assert.strictEqual(config.model, 'MiniMax-M3'); - const ocrReviewerModel = 'reviewer'; - assert.strictEqual(ocrReviewerModel, 'reviewer'); + const workflow = fs.readFileSync(path.join(__dirname, '..', 'workflows', 'ocr-review.yml'), 'utf8'); + assert.ok(workflow.includes('OCR_LLM_MODEL: reviewer')); } function testScoutConfigCanDisableLargeLeanScout() {