fix: use current selected model
All checks were successful
port-to-omp / port (push) Successful in 10s
publish / publish (push) Successful in 14s

This commit is contained in:
2026-08-21 21:18:15 -04:00
parent bb2e89c83f
commit bff187da20
8 changed files with 65 additions and 7 deletions

View File

@@ -17,7 +17,10 @@
import { rm } from "node:fs/promises";
import { resolve, join } from "node:path";
import type { ExtensionUIContext } from "@earendil-works/pi-coding-agent";
import type {
ExtensionCommandContext,
ExtensionUIContext,
} from "@earendil-works/pi-coding-agent";
import type { CheckDefinition, CheckScope } from "../checks/registry.js";
import { runAgentTask } from "../agent-runner.js";
import { runRecon } from "../recon.js";
@@ -84,6 +87,12 @@ export interface RunCheckOptions {
ui?: ExtensionUIContext;
/** Whether dialog-capable UI is available. */
hasUI?: boolean;
/**
* The currently selected model from the invoking session; forwarded to
* each sub-agent so scans run on the model the user picked, not the
* settings default.
*/
model?: ExtensionCommandContext["model"];
/** Pre-existing run state to update (for `/pygienium-all` and resume). */
existingState?: RunState;
/** Optional callback to post completion messages into the chat. */
@@ -278,6 +287,7 @@ async function runCheckImplInner(
cwd: scope.target,
agentName: check.agentName,
task: scanTask,
model: opts.model,
onEvent: forward(PHASE_ANALYSIS),
});
findings = scanResult.text;
@@ -310,6 +320,7 @@ async function runCheckImplInner(
cwd: scope.target,
agentName: check.fixAgentName ?? "fixer",
task: fixTask,
model: opts.model,
onEvent: forward(PHASE_FIX),
});
changes = fixResult.text;