refactor: migrate delegate_task to task tool with metadata fixes

- Rename delegate_task tool to task across codebase (100 files)
- Update model references: claude-opus-4-6 → 4-5, gpt-5.3-codex → 5.2-codex
- Add tool-metadata-store to restore metadata overwritten by fromPlugin()
- Add session ID polling for BackgroundManager task sessions
- Await async ctx.metadata() calls in tool executors
- Add ses_ prefix guard to getMessageDir for performance
- Harden BackgroundManager with idle deferral and error handling
- Fix duplicate task key in sisyphus-junior test object literals
- Fix unawaited showOutputToUser in ast_grep_replace
- Fix background=true → run_in_background=true in ultrawork prompt
- Fix duplicate task/task references in docs and comments
This commit is contained in:
YeonGyu-Kim
2026-02-06 16:01:54 +09:00
parent f1c794e63e
commit a691a3ac0a
78 changed files with 1182 additions and 403 deletions
+3 -3
View File
@@ -274,7 +274,7 @@ describe("Plan agent demote behavior", () => {
expect(agents.plan.prompt).toBe("original plan prompt")
})
test("prometheus should have mode 'all' to be callable via delegate_task", async () => {
test("prometheus should have mode 'all' to be callable via task", async () => {
// given
const pluginConfig: OhMyOpenCodeConfig = {
sisyphus_agent: {
@@ -305,7 +305,7 @@ describe("Plan agent demote behavior", () => {
})
describe("Agent permission defaults", () => {
test("hephaestus should allow delegate_task", async () => {
test("hephaestus should allow task", async () => {
// #given
const createBuiltinAgentsMock = agents.createBuiltinAgents as unknown as {
mockResolvedValue: (value: Record<string, unknown>) => void
@@ -335,7 +335,7 @@ describe("Agent permission defaults", () => {
// #then
const agentConfig = config.agent as Record<string, { permission?: Record<string, string> }>
expect(agentConfig.hephaestus).toBeDefined()
expect(agentConfig.hephaestus.permission?.delegate_task).toBe("allow")
expect(agentConfig.hephaestus.permission?.task).toBe("allow")
})
})
+6 -6
View File
@@ -419,30 +419,30 @@ export function createConfigHandler(deps: ConfigHandlerDeps) {
}
if (agentResult["atlas"]) {
const agent = agentResult["atlas"] as AgentWithPermission;
agent.permission = { ...agent.permission, task: "deny", call_omo_agent: "deny", delegate_task: "allow", "task_*": "allow", teammate: "allow" };
agent.permission = { ...agent.permission, task: "allow", call_omo_agent: "deny", "task_*": "allow", teammate: "allow" };
}
if (agentResult.sisyphus) {
const agent = agentResult.sisyphus as AgentWithPermission;
agent.permission = { ...agent.permission, call_omo_agent: "deny", delegate_task: "allow", question: questionPermission, "task_*": "allow", teammate: "allow" };
agent.permission = { ...agent.permission, call_omo_agent: "deny", task: "allow", question: questionPermission, "task_*": "allow", teammate: "allow" };
}
if (agentResult.hephaestus) {
const agent = agentResult.hephaestus as AgentWithPermission;
agent.permission = { ...agent.permission, call_omo_agent: "deny", delegate_task: "allow", question: questionPermission };
agent.permission = { ...agent.permission, call_omo_agent: "deny", task: "allow", question: questionPermission };
}
if (agentResult["prometheus"]) {
const agent = agentResult["prometheus"] as AgentWithPermission;
agent.permission = { ...agent.permission, call_omo_agent: "deny", delegate_task: "allow", question: questionPermission, "task_*": "allow", teammate: "allow" };
agent.permission = { ...agent.permission, call_omo_agent: "deny", task: "allow", question: questionPermission, "task_*": "allow", teammate: "allow" };
}
if (agentResult["sisyphus-junior"]) {
const agent = agentResult["sisyphus-junior"] as AgentWithPermission;
agent.permission = { ...agent.permission, delegate_task: "allow", "task_*": "allow", teammate: "allow" };
agent.permission = { ...agent.permission, task: "allow", "task_*": "allow", teammate: "allow" };
}
config.permission = {
...(config.permission as Record<string, unknown>),
webfetch: "allow",
external_directory: "allow",
delegate_task: "deny",
task: "deny",
};
const mcpResult = (pluginConfig.claude_code?.mcp ?? true)