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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user