Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions src/lib/agent/runner/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,11 @@ function captureSwitchboardDecision(
binding: ProgramBinding,
): void {
const trace = ctx.trace ?? {};
// Unpinned orchestrator runs choose a model per task from the context-mill agent prompts; the orchestrator logs that map once the prompts load.
const perTaskModel =
binding.sequence === Sequence.orchestrator && trace.model === 'binding';
const model = perTaskModel ? 'chosen-per-task' : binding.model;
const modelSource = perTaskModel ? 'agent-prompts' : trace.model;
analytics.wizardCapture('switchboard resolved', {
program: ctx.program,
flag_self_driving_use_pi_harness:
Expand All @@ -164,10 +169,10 @@ function captureSwitchboardDecision(
cli_sequence: ctx.cliSequence,
cli_model: ctx.cliModel,
harness_source: trace.harness,
model_source: trace.model,
model_source: modelSource,
sequence_source: trace.sequence,
harness: binding.harness,
model: binding.model,
model,
thinking_level: binding.thinkingLevel,
sequence: binding.sequence,
});
Expand All @@ -178,7 +183,7 @@ function captureSwitchboardDecision(
ctx.cliModel ?? '-'
})` +
` → harness=${binding.harness} (${trace.harness ?? '?'})` +
` model=${binding.model} (${trace.model ?? '?'})` +
` model=${model} (${modelSource ?? '?'})` +
` sequence=${binding.sequence} (${trace.sequence ?? '?'})`,
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,22 @@ export async function runOrchestrator(
);
}

// The end decision the switchboard event defers to: the model each task will actually run on.
const taskModels = Object.fromEntries(
['seed', ...registry.types].map((type) => {
const prompt = type === 'seed' ? seedPrompt : registry.get(type);
const pick = resolveHarness(switchboardCtx, type);
const specModel = prompt && promptModelFor(prompt, pick.harness).model;
return [type, isValidModel(specModel) ? specModel : pick.model];
}),
);
logToFile(
`[orchestrator] task models: ${Object.entries(taskModels)
.map(([t, m]) => `${t}=${m}`)
.join(' ')}`,
);
analytics.wizardCapture('orchestrator task models', taskModels);

// Responsiveness is the headline metric of the dark launch: time to first
// visible progress, and no single step dominating wall-clock. Track it from
// queue transitions, with the resolved model so cheap work is attributable
Expand Down
Loading