Skip to content

Commit 715756b

Browse files
authored
Optimize tool descriptions for token efficiency (#73)
* Optimize background-task tool descriptions for token efficiency - BACKGROUND_TASK_DESCRIPTION: 571 chars → 127 chars - BACKGROUND_OUTPUT_DESCRIPTION: 268 chars → 95 chars - BACKGROUND_CANCEL_DESCRIPTION: 374 chars → 83 chars Follows token efficiency improvements pattern from PR #71. 🤖 Generated with assistance of OhMyOpenCode (https://github.com/code-yeongyu/oh-my-opencode) * Optimize call-omo-agent tool description for token efficiency - CALL_OMO_AGENT_DESCRIPTION: 841 chars → 156 chars (~81% reduction) - Follows pattern from PR #71 where LSP tool descriptions were optimized - Maintains core information while removing redundant explanations 🤖 Generated with assistance of OhMyOpenCode (https://github.com/code-yeongyu/oh-my-opencode) * Optimize look-at tool description for token efficiency 🤖 Generated with assistance of OhMyOpenCode (https://github.com/code-yeongyu/oh-my-opencode) * Optimize interactive-bash tool description for token efficiency 346 chars → 130 chars (~62% reduction), following PR #71 pattern. 🤖 Generated with assistance of OhMyOpenCode
1 parent cdde8da commit 715756b

File tree

4 files changed

+10
-70
lines changed

4 files changed

+10
-70
lines changed
Lines changed: 4 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,7 @@
1-
export const BACKGROUND_TASK_DESCRIPTION = `Launch a background agent task that runs asynchronously.
1+
export const BACKGROUND_TASK_DESCRIPTION = `Run agent task in background. Returns task_id immediately; notifies on completion.
22
3-
The task runs in a separate session while you continue with other work. The system will notify you when the task completes.
3+
Use \`background_output\` to get results. Prompts MUST be in English.`
44

5-
Use this for:
6-
- Long-running research tasks
7-
- Complex analysis that doesn't need immediate results
8-
- Parallel workloads to maximize throughput
5+
export const BACKGROUND_OUTPUT_DESCRIPTION = `Get output from background task. System notifies on completion, so block=true rarely needed.`
96

10-
Arguments:
11-
- description: Short task description (shown in status)
12-
- prompt: Full detailed prompt for the agent (MUST be in English for optimal LLM performance)
13-
- agent: Agent type to use (any agent allowed)
14-
15-
IMPORTANT: Always write prompts in English regardless of user's language. LLMs perform significantly better with English prompts.
16-
17-
Returns immediately with task ID and session info. Use \`background_output\` to check progress or retrieve results.`
18-
19-
export const BACKGROUND_OUTPUT_DESCRIPTION = `Get output from a background task.
20-
21-
Arguments:
22-
- task_id: Required task ID to get output from
23-
- block: If true, wait for task completion. If false (default), return current status immediately.
24-
- timeout: Max wait time in ms when blocking (default: 60000, max: 600000)
25-
26-
The system automatically notifies when background tasks complete. You typically don't need block=true.`
27-
28-
export const BACKGROUND_CANCEL_DESCRIPTION = `Cancel running background task(s).
29-
30-
Only works for tasks with status "running". Aborts the background session and marks the task as cancelled.
31-
32-
Arguments:
33-
- taskId: Task ID to cancel (optional if all=true)
34-
- all: Set to true to cancel ALL running background tasks at once (default: false)
35-
36-
**Cleanup Before Answer**: When you have gathered sufficient information and are ready to provide your final answer to the user, use \`all=true\` to cancel ALL running background tasks first, then deliver your response. This conserves resources and ensures clean workflow completion.`
7+
export const BACKGROUND_CANCEL_DESCRIPTION = `Cancel running background task(s). Use all=true to cancel ALL before final answer.`
Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,7 @@
11
export const ALLOWED_AGENTS = ["explore", "librarian"] as const
22

3-
export const CALL_OMO_AGENT_DESCRIPTION = `Launch a new agent to handle complex, multi-step tasks autonomously.
3+
export const CALL_OMO_AGENT_DESCRIPTION = `Spawn explore/librarian agent. run_in_background REQUIRED (true=async with task_id, false=sync).
44
5-
This is a restricted version of the Task tool that only allows spawning explore and librarian agents.
5+
Available: {agents}
66
7-
Available agent types:
8-
{agents}
9-
10-
When using this tool, you must specify a subagent_type parameter to select which agent type to use.
11-
12-
**IMPORTANT: run_in_background parameter is REQUIRED**
13-
- \`run_in_background=true\`: Task runs asynchronously in background. Returns immediately with task_id.
14-
The system will notify you when the task completes.
15-
Use \`background_output\` tool with task_id to check progress (block=false returns full status info).
16-
- \`run_in_background=false\`: Task runs synchronously. Waits for completion and returns full result.
17-
18-
Usage notes:
19-
1. Launch multiple agents concurrently whenever possible, to maximize performance
20-
2. When the agent is done, it will return a single message back to you
21-
3. Each agent invocation is stateless unless you provide a session_id
22-
4. Your prompt should contain a highly detailed task description for the agent to perform autonomously
23-
5. Clearly tell the agent whether you expect it to write code or just to do research
24-
6. For long-running research tasks, use run_in_background=true to avoid blocking
25-
7. **IMPORTANT**: Always write prompts in English regardless of user's language. LLMs perform significantly better with English prompts.`
7+
Prompts MUST be in English. Use \`background_output\` for async results.`

src/tools/interactive-bash/constants.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,6 @@ export const BLOCKED_TMUX_SUBCOMMANDS = [
1111
"pipep",
1212
]
1313

14-
export const INTERACTIVE_BASH_DESCRIPTION = `Execute tmux commands for interactive terminal session management.
14+
export const INTERACTIVE_BASH_DESCRIPTION = `Execute tmux commands. Use "omo-{name}" session pattern.
1515
16-
Use session names following the pattern "omo-{name}" for automatic tracking.
17-
18-
BLOCKED COMMANDS (use bash tool instead):
19-
- capture-pane / capturep: Use bash to read output files or pipe output
20-
- save-buffer / saveb: Use bash to save content to files
21-
- show-buffer / showb: Use bash to read buffer content
22-
- pipe-pane / pipep: Use bash for piping output`
16+
Blocked (use bash instead): capture-pane, save-buffer, show-buffer, pipe-pane.`

src/tools/look-at/constants.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
11
export const MULTIMODAL_LOOKER_AGENT = "multimodal-looker" as const
22

3-
export const LOOK_AT_DESCRIPTION = `Analyze media files (PDFs, images, diagrams) that require visual interpretation.
4-
5-
Parameters:
6-
- file_path: Absolute path to the file to analyze
7-
- goal: What specific information to extract (be specific for better results)
8-
9-
This tool uses a separate context window with Gemini 2.5 Flash for multimodal analysis,
10-
saving tokens in the main conversation while providing accurate visual interpretation.`
3+
export const LOOK_AT_DESCRIPTION = `Analyze media files (PDFs, images, diagrams) via Gemini 2.5 Flash in separate context. Saves main context tokens.`

0 commit comments

Comments
 (0)