fix(background-agent): respect agent tool restrictions in background task launch

Reorder tool permission spread so getAgentToolRestrictions() comes
last, allowing agent-specific restrictions to override defaults.
Fixes all 3 sites: task-starter.ts (startTask), manager.ts (startTask
and resume paths).

Previously, defaults like call_omo_agent:true would stomp agent
restrictions (e.g., explore's call_omo_agent:false) due to JS
spread semantics.
This commit is contained in:
sjawhar
2026-02-17 01:02:04 +00:00
committed by YeonGyu-Kim
parent 4b09428d7b
commit 6247bf1f78
2 changed files with 95 additions and 2 deletions
+2 -2
View File
@@ -355,10 +355,10 @@ export class BackgroundManager {
system: input.skillContent,
tools: (() => {
const tools = {
...getAgentToolRestrictions(input.agent),
task: false,
call_omo_agent: true,
question: false,
...getAgentToolRestrictions(input.agent),
}
setSessionTools(sessionID, tools)
return tools
@@ -628,10 +628,10 @@ export class BackgroundManager {
...(resumeVariant ? { variant: resumeVariant } : {}),
tools: (() => {
const tools = {
...getAgentToolRestrictions(existingTask.agent),
task: false,
call_omo_agent: true,
question: false,
...getAgentToolRestrictions(existingTask.agent),
}
setSessionTools(existingTask.sessionID!, tools)
return tools