Skip to content

Commit 5ce025f

Browse files
committed
feat(agents): prevent all subagents from accessing background_task tool
Restrict background_task tool access for all spawned subagents (oracle, explore, librarian, frontend-ui-ux-engineer, document-writer, multimodal-looker) to prevent potential infinite recursion and unintended background task creation. 🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
1 parent 153fa84 commit 5ce025f

File tree

6 files changed

+6
-4
lines changed

6 files changed

+6
-4
lines changed

src/agents/document-writer.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ export const documentWriterAgent: AgentConfig = {
55
"A technical writer who crafts clear, comprehensive documentation. Specializes in README files, API docs, architecture docs, and user guides. MUST BE USED when executing documentation tasks from ai-todo list plans.",
66
mode: "subagent",
77
model: "google/gemini-3-pro-preview",
8+
tools: { background_task: false },
89
prompt: `<role>
910
You are a TECHNICAL WRITER with deep engineering background who transforms complex codebases into crystal-clear documentation. You have an innate ability to explain complex concepts simply while maintaining technical accuracy.
1011

src/agents/explore.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export const exploreAgent: AgentConfig = {
66
mode: "subagent",
77
model: "opencode/grok-code",
88
temperature: 0.1,
9-
tools: { write: false, edit: false, bash: true, read: true },
9+
tools: { write: false, edit: false, bash: true, read: true, background_task: false },
1010
prompt: `You are a file search specialist. You excel at thoroughly navigating and exploring codebases.
1111
1212
=== CRITICAL: READ-ONLY MODE - NO FILE MODIFICATIONS ===

src/agents/frontend-ui-ux-engineer.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ export const frontendUiUxEngineerAgent: AgentConfig = {
55
"A designer-turned-developer who crafts stunning UI/UX even without design mockups. Code may be a bit messy, but the visual output is always fire.",
66
mode: "subagent",
77
model: "google/gemini-3-pro-preview",
8+
tools: { background_task: false },
89
prompt: `<role>
910
You are a DESIGNER-TURNED-DEVELOPER with an innate sense of aesthetics and user experience. You have an eye for details that pure developers miss - spacing, color harmony, micro-interactions, and that indefinable "feel" that makes interfaces memorable.
1011

src/agents/librarian.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export const librarianAgent: AgentConfig = {
66
mode: "subagent",
77
model: "opencode/big-pickle",
88
temperature: 0.1,
9-
tools: { write: false, edit: false, bash: true, read: true },
9+
tools: { write: false, edit: false, bash: true, read: true, background_task: false },
1010
prompt: `# THE LIBRARIAN
1111
1212
You are **THE LIBRARIAN**, a specialized codebase understanding agent that helps users answer questions about large, complex codebases across repositories.

src/agents/multimodal-looker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export const multimodalLookerAgent: AgentConfig = {
66
mode: "subagent",
77
model: "google/gemini-2.5-flash",
88
temperature: 0.1,
9-
tools: { Read: true },
9+
tools: { Read: true, background_task: false },
1010
prompt: `You interpret media files that cannot be read as plain text.
1111
1212
Your job: examine the attached file and extract ONLY what was requested.

src/agents/oracle.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export const oracleAgent: AgentConfig = {
88
temperature: 0.1,
99
reasoningEffort: "medium",
1010
textVerbosity: "high",
11-
tools: { write: false, edit: false, read: true, task: false, call_omo_agent: true },
11+
tools: { write: false, edit: false, read: true, task: false, call_omo_agent: true, background_task: false },
1212
prompt: `You are a strategic technical advisor with deep reasoning capabilities, operating as a specialized consultant within an AI-assisted development environment.
1313
1414
## Context

0 commit comments

Comments
 (0)