feat(FN-3581): honor runtime model precedence for assigned agents
This merge delivers five major feature clusters: a fully rebuilt dependency graph plugin with draggable nodes, position persistence, modular architecture, highlighting and selection states, toolbar navigation, and keyboard controls; a new roadmap plugin with domain store, ordering logic, and compreh Fusion-Task-Id: FN-3581
This commit is contained in:
@@ -11,6 +11,7 @@ import type { AgentRuntimeOptions } from "./agent-runtime.js";
|
||||
import type { SkillSelectionContext } from "./skill-resolver.js";
|
||||
import type { PluginRunner } from "./plugin-runner.js";
|
||||
import type { AgentSession } from "@mariozechner/pi-coding-agent";
|
||||
import { resolveTaskExecutionModel, type Settings } from "@fusion/core";
|
||||
import { resolveRuntime, buildRuntimeResolutionContext, type SessionPurpose } from "./runtime-resolution.js";
|
||||
import { createLogger } from "./logger.js";
|
||||
import { promptWithFallback, describeModel } from "./pi.js";
|
||||
@@ -112,6 +113,31 @@ export function extractRuntimeModel(
|
||||
};
|
||||
}
|
||||
|
||||
export function resolveExecutorSessionModel(
|
||||
taskModelProvider: string | undefined,
|
||||
taskModelId: string | undefined,
|
||||
settings: Partial<Settings> | undefined,
|
||||
assignedAgentRuntimeConfig?: Record<string, unknown>,
|
||||
): { provider: string | undefined; modelId: string | undefined } {
|
||||
const assignedRuntimeModel = extractRuntimeModel(assignedAgentRuntimeConfig);
|
||||
if (assignedRuntimeModel.provider && assignedRuntimeModel.modelId) {
|
||||
return assignedRuntimeModel;
|
||||
}
|
||||
|
||||
const resolvedTaskModel = resolveTaskExecutionModel(
|
||||
{
|
||||
modelProvider: taskModelProvider,
|
||||
modelId: taskModelId,
|
||||
},
|
||||
settings,
|
||||
);
|
||||
|
||||
return {
|
||||
provider: resolvedTaskModel.provider,
|
||||
modelId: resolvedTaskModel.modelId,
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an agent session using runtime resolution.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user