-
-
Notifications
You must be signed in to change notification settings - Fork 39.7k
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Problem
Currently, all custom commands defined in or must go through the AI model:
This consumes input/output tokens even for simple, deterministic commands like:
-
- just runs a local script and returns output
-
- displays system information
- Custom info queries that don't need AI processing
Example Cost
A simple command consumes ~100-200 tokens just to:
- Parse the command
- Execute tool to run script
- Format the response
This adds up for frequently-used commands.
Proposed Solution
Add a flag (or similar mechanism) for custom commands:
When :
- Command is intercepted at gateway level (like native )
- Tool is executed directly
- Output is sent to user without entering AI session
- Zero tokens consumed for the command itself
Benefits
- 💰 Significant cost savings for frequent info commands
- ⚡ Faster response times (no model latency)
- 🏗️ Clearer architecture: AI commands vs system commands
- 🔄 Backward compatible (default )
Alternatives Considered
- Keep current behavior (always through AI) - works but wasteful
- Use hooks - not suitable for user-triggered commands
- Separate command system - adds complexity
Related
- Feature: Plugin callback handler for Telegram inline buttons (bypass LLM) #4280 - Plugin callback handler (bypass LLM for callbacks)
- Feature: Gateway-level /switch command to change auth accounts without AI #7533 - Gateway-level command for auth switching
- Feature Request: Tool execution hook events (tool:before, tool:after) #7597 - Tool execution hook events
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request