fix(agents): wire useTaskSystem config flag into Sisyphus and Hephaestus
The experimental.task_system flag was defined in config but never passed through to agent creation, so the task system prompt switch was always off.
This commit is contained in:
@@ -63,7 +63,8 @@ export async function createBuiltinAgents(
|
|||||||
customAgentSummaries?: unknown,
|
customAgentSummaries?: unknown,
|
||||||
browserProvider?: BrowserAutomationProvider,
|
browserProvider?: BrowserAutomationProvider,
|
||||||
uiSelectedModel?: string,
|
uiSelectedModel?: string,
|
||||||
disabledSkills?: Set<string>
|
disabledSkills?: Set<string>,
|
||||||
|
useTaskSystem = false
|
||||||
): Promise<Record<string, AgentConfig>> {
|
): Promise<Record<string, AgentConfig>> {
|
||||||
const connectedProviders = readConnectedProvidersCache()
|
const connectedProviders = readConnectedProvidersCache()
|
||||||
// IMPORTANT: Do NOT call OpenCode client APIs during plugin initialization.
|
// IMPORTANT: Do NOT call OpenCode client APIs during plugin initialization.
|
||||||
@@ -134,6 +135,7 @@ export async function createBuiltinAgents(
|
|||||||
mergedCategories,
|
mergedCategories,
|
||||||
directory,
|
directory,
|
||||||
userCategories: categories,
|
userCategories: categories,
|
||||||
|
useTaskSystem,
|
||||||
})
|
})
|
||||||
if (sisyphusConfig) {
|
if (sisyphusConfig) {
|
||||||
result["sisyphus"] = sisyphusConfig
|
result["sisyphus"] = sisyphusConfig
|
||||||
@@ -150,6 +152,7 @@ export async function createBuiltinAgents(
|
|||||||
availableCategories,
|
availableCategories,
|
||||||
mergedCategories,
|
mergedCategories,
|
||||||
directory,
|
directory,
|
||||||
|
useTaskSystem,
|
||||||
})
|
})
|
||||||
if (hephaestusConfig) {
|
if (hephaestusConfig) {
|
||||||
result["hephaestus"] = hephaestusConfig
|
result["hephaestus"] = hephaestusConfig
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ export function maybeCreateAtlasConfig(input: {
|
|||||||
availableSkills: AvailableSkill[]
|
availableSkills: AvailableSkill[]
|
||||||
mergedCategories: Record<string, CategoryConfig>
|
mergedCategories: Record<string, CategoryConfig>
|
||||||
userCategories?: CategoriesConfig
|
userCategories?: CategoriesConfig
|
||||||
|
useTaskSystem?: boolean
|
||||||
}): AgentConfig | undefined {
|
}): AgentConfig | undefined {
|
||||||
const {
|
const {
|
||||||
disabledAgents,
|
disabledAgents,
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ export function collectPendingBuiltinAgents(input: {
|
|||||||
uiSelectedModel?: string
|
uiSelectedModel?: string
|
||||||
availableModels: Set<string>
|
availableModels: Set<string>
|
||||||
disabledSkills?: Set<string>
|
disabledSkills?: Set<string>
|
||||||
|
useTaskSystem?: boolean
|
||||||
}): { pendingAgentConfigs: Map<string, AgentConfig>; availableAgents: AvailableAgent[] } {
|
}): { pendingAgentConfigs: Map<string, AgentConfig>; availableAgents: AvailableAgent[] } {
|
||||||
const {
|
const {
|
||||||
agentSources,
|
agentSources,
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ export function maybeCreateHephaestusConfig(input: {
|
|||||||
availableCategories: AvailableCategory[]
|
availableCategories: AvailableCategory[]
|
||||||
mergedCategories: Record<string, CategoryConfig>
|
mergedCategories: Record<string, CategoryConfig>
|
||||||
directory?: string
|
directory?: string
|
||||||
|
useTaskSystem: boolean
|
||||||
}): AgentConfig | undefined {
|
}): AgentConfig | undefined {
|
||||||
const {
|
const {
|
||||||
disabledAgents,
|
disabledAgents,
|
||||||
@@ -31,6 +32,7 @@ export function maybeCreateHephaestusConfig(input: {
|
|||||||
availableCategories,
|
availableCategories,
|
||||||
mergedCategories,
|
mergedCategories,
|
||||||
directory,
|
directory,
|
||||||
|
useTaskSystem,
|
||||||
} = input
|
} = input
|
||||||
|
|
||||||
if (disabledAgents.includes("hephaestus")) return undefined
|
if (disabledAgents.includes("hephaestus")) return undefined
|
||||||
@@ -66,7 +68,8 @@ export function maybeCreateHephaestusConfig(input: {
|
|||||||
availableAgents,
|
availableAgents,
|
||||||
undefined,
|
undefined,
|
||||||
availableSkills,
|
availableSkills,
|
||||||
availableCategories
|
availableCategories,
|
||||||
|
useTaskSystem
|
||||||
)
|
)
|
||||||
|
|
||||||
hephaestusConfig = { ...hephaestusConfig, variant: hephaestusResolvedVariant ?? "medium" }
|
hephaestusConfig = { ...hephaestusConfig, variant: hephaestusResolvedVariant ?? "medium" }
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ export function maybeCreateSisyphusConfig(input: {
|
|||||||
mergedCategories: Record<string, CategoryConfig>
|
mergedCategories: Record<string, CategoryConfig>
|
||||||
directory?: string
|
directory?: string
|
||||||
userCategories?: CategoriesConfig
|
userCategories?: CategoriesConfig
|
||||||
|
useTaskSystem: boolean
|
||||||
}): AgentConfig | undefined {
|
}): AgentConfig | undefined {
|
||||||
const {
|
const {
|
||||||
disabledAgents,
|
disabledAgents,
|
||||||
@@ -34,6 +35,7 @@ export function maybeCreateSisyphusConfig(input: {
|
|||||||
availableCategories,
|
availableCategories,
|
||||||
mergedCategories,
|
mergedCategories,
|
||||||
directory,
|
directory,
|
||||||
|
useTaskSystem,
|
||||||
} = input
|
} = input
|
||||||
|
|
||||||
const sisyphusOverride = agentOverrides["sisyphus"]
|
const sisyphusOverride = agentOverrides["sisyphus"]
|
||||||
@@ -67,7 +69,8 @@ export function maybeCreateSisyphusConfig(input: {
|
|||||||
availableAgents,
|
availableAgents,
|
||||||
undefined,
|
undefined,
|
||||||
availableSkills,
|
availableSkills,
|
||||||
availableCategories
|
availableCategories,
|
||||||
|
useTaskSystem
|
||||||
)
|
)
|
||||||
|
|
||||||
if (sisyphusResolvedVariant) {
|
if (sisyphusResolvedVariant) {
|
||||||
|
|||||||
@@ -58,6 +58,7 @@ export async function applyAgentConfig(params: {
|
|||||||
params.pluginConfig.browser_automation_engine?.provider ?? "playwright";
|
params.pluginConfig.browser_automation_engine?.provider ?? "playwright";
|
||||||
const currentModel = params.config.model as string | undefined;
|
const currentModel = params.config.model as string | undefined;
|
||||||
const disabledSkills = new Set<string>(params.pluginConfig.disabled_skills ?? []);
|
const disabledSkills = new Set<string>(params.pluginConfig.disabled_skills ?? []);
|
||||||
|
const useTaskSystem = params.pluginConfig.experimental?.task_system ?? false;
|
||||||
|
|
||||||
const builtinAgents = await createBuiltinAgents(
|
const builtinAgents = await createBuiltinAgents(
|
||||||
migratedDisabledAgents,
|
migratedDisabledAgents,
|
||||||
@@ -71,6 +72,7 @@ export async function applyAgentConfig(params: {
|
|||||||
browserProvider,
|
browserProvider,
|
||||||
currentModel,
|
currentModel,
|
||||||
disabledSkills,
|
disabledSkills,
|
||||||
|
useTaskSystem,
|
||||||
);
|
);
|
||||||
|
|
||||||
const includeClaudeAgents = params.pluginConfig.claude_code?.agents ?? true;
|
const includeClaudeAgents = params.pluginConfig.claude_code?.agents ?? true;
|
||||||
@@ -101,7 +103,6 @@ export async function applyAgentConfig(params: {
|
|||||||
sisyphus: builtinAgents.sisyphus,
|
sisyphus: builtinAgents.sisyphus,
|
||||||
};
|
};
|
||||||
|
|
||||||
const useTaskSystem = params.pluginConfig.experimental?.task_system ?? false;
|
|
||||||
agentConfig["sisyphus-junior"] = createSisyphusJuniorAgentWithOverrides(
|
agentConfig["sisyphus-junior"] = createSisyphusJuniorAgentWithOverrides(
|
||||||
params.pluginConfig.agents?.["sisyphus-junior"],
|
params.pluginConfig.agents?.["sisyphus-junior"],
|
||||||
undefined,
|
undefined,
|
||||||
|
|||||||
Reference in New Issue
Block a user