feat(config-handler): add Sisyphus-Junior and orchestrator support
- Add Sisyphus-Junior agent creation - Add orchestrator-sisyphus tool restrictions - Rename Planner-Sisyphus to Prometheus (Planner) - Use PROMETHEUS_SYSTEM_PROMPT and PROMETHEUS_PERMISSION 🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
This commit is contained in:
parent
156a988080
commit
e5b36f30b8
@ -1,4 +1,5 @@
|
|||||||
import { createBuiltinAgents } from "../agents";
|
import { createBuiltinAgents } from "../agents";
|
||||||
|
import { createSisyphusJuniorAgent } from "../agents/sisyphus-junior";
|
||||||
import {
|
import {
|
||||||
loadUserCommands,
|
loadUserCommands,
|
||||||
loadProjectCommands,
|
loadProjectCommands,
|
||||||
@ -22,7 +23,7 @@ import { createBuiltinMcps } from "../mcp";
|
|||||||
import type { OhMyOpenCodeConfig } from "../config";
|
import type { OhMyOpenCodeConfig } from "../config";
|
||||||
import { log } from "../shared";
|
import { log } from "../shared";
|
||||||
import { migrateAgentConfig } from "../shared/permission-compat";
|
import { migrateAgentConfig } from "../shared/permission-compat";
|
||||||
import { PLAN_SYSTEM_PROMPT, PLAN_PERMISSION } from "../agents/plan-prompt";
|
import { PROMETHEUS_SYSTEM_PROMPT, PROMETHEUS_PERMISSION } from "../agents/prometheus-prompt";
|
||||||
import type { ModelCacheState } from "../plugin-state";
|
import type { ModelCacheState } from "../plugin-state";
|
||||||
|
|
||||||
export interface ConfigHandlerDeps {
|
export interface ConfigHandlerDeps {
|
||||||
@ -131,6 +132,7 @@ export function createConfigHandler(deps: ConfigHandlerDeps) {
|
|||||||
explore?: { tools?: Record<string, unknown> };
|
explore?: { tools?: Record<string, unknown> };
|
||||||
librarian?: { tools?: Record<string, unknown> };
|
librarian?: { tools?: Record<string, unknown> };
|
||||||
"multimodal-looker"?: { tools?: Record<string, unknown> };
|
"multimodal-looker"?: { tools?: Record<string, unknown> };
|
||||||
|
"orchestrator-sisyphus"?: { tools?: Record<string, unknown> };
|
||||||
};
|
};
|
||||||
const configAgent = config.agent as AgentConfig | undefined;
|
const configAgent = config.agent as AgentConfig | undefined;
|
||||||
|
|
||||||
@ -141,6 +143,11 @@ export function createConfigHandler(deps: ConfigHandlerDeps) {
|
|||||||
Sisyphus: builtinAgents.Sisyphus,
|
Sisyphus: builtinAgents.Sisyphus,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
agentConfig["Sisyphus-Junior"] = createSisyphusJuniorAgent({
|
||||||
|
model: "anthropic/claude-sonnet-4-5",
|
||||||
|
temperature: 0.1,
|
||||||
|
});
|
||||||
|
|
||||||
if (builderEnabled) {
|
if (builderEnabled) {
|
||||||
const { name: _buildName, ...buildConfigWithoutName } =
|
const { name: _buildName, ...buildConfigWithoutName } =
|
||||||
configAgent?.build ?? {};
|
configAgent?.build ?? {};
|
||||||
@ -165,21 +172,21 @@ export function createConfigHandler(deps: ConfigHandlerDeps) {
|
|||||||
const migratedPlanConfig = migrateAgentConfig(
|
const migratedPlanConfig = migrateAgentConfig(
|
||||||
planConfigWithoutName as Record<string, unknown>
|
planConfigWithoutName as Record<string, unknown>
|
||||||
);
|
);
|
||||||
const plannerSisyphusOverride =
|
const prometheusOverride =
|
||||||
pluginConfig.agents?.["Planner-Sisyphus"];
|
pluginConfig.agents?.["Prometheus (Planner)"];
|
||||||
const defaultModel = config.model as string | undefined;
|
const defaultModel = config.model as string | undefined;
|
||||||
const plannerSisyphusBase = {
|
const prometheusBase = {
|
||||||
model: (migratedPlanConfig as Record<string, unknown>).model ?? defaultModel,
|
model: (migratedPlanConfig as Record<string, unknown>).model ?? defaultModel,
|
||||||
mode: "primary" as const,
|
mode: "primary" as const,
|
||||||
prompt: PLAN_SYSTEM_PROMPT,
|
prompt: PROMETHEUS_SYSTEM_PROMPT,
|
||||||
permission: PLAN_PERMISSION,
|
permission: PROMETHEUS_PERMISSION,
|
||||||
description: `${configAgent?.plan?.description ?? "Plan agent"} (OhMyOpenCode version)`,
|
description: `${configAgent?.plan?.description ?? "Plan agent"} (Prometheus - OhMyOpenCode)`,
|
||||||
color: (configAgent?.plan?.color as string) ?? "#6495ED",
|
color: (configAgent?.plan?.color as string) ?? "#FF6347",
|
||||||
};
|
};
|
||||||
|
|
||||||
agentConfig["Planner-Sisyphus"] = plannerSisyphusOverride
|
agentConfig["Prometheus (Planner)"] = prometheusOverride
|
||||||
? { ...plannerSisyphusBase, ...plannerSisyphusOverride }
|
? { ...prometheusBase, ...prometheusOverride }
|
||||||
: plannerSisyphusBase;
|
: prometheusBase;
|
||||||
}
|
}
|
||||||
|
|
||||||
const filteredConfigAgents = configAgent
|
const filteredConfigAgents = configAgent
|
||||||
@ -255,6 +262,13 @@ export function createConfigHandler(deps: ConfigHandlerDeps) {
|
|||||||
look_at: false,
|
look_at: false,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
if (agentResult["orchestrator-sisyphus"]) {
|
||||||
|
agentResult["orchestrator-sisyphus"].tools = {
|
||||||
|
...agentResult["orchestrator-sisyphus"].tools,
|
||||||
|
task: false,
|
||||||
|
call_omo_agent: false,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
config.permission = {
|
config.permission = {
|
||||||
...(config.permission as Record<string, unknown>),
|
...(config.permission as Record<string, unknown>),
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user