Task Types
PromptBus classifies every incoming request into one of seven task types. This classification drives the routing decision — determining which model and effort level to use.
Classification Method
The classifier uses keyword heuristics — no LLM call on the hot path. It analyzes the last user message in the conversation and extracts signals including:
- Prompt length (in tokens)
- Number of files in context
- Number of tool calls so far in the turn
- Keyword matches
- Follow-up detection in long sessions
- Whether the prior turn used extended thinking
Each signal contributes to a confidence score (0.0–1.0), which is compared against the configurable confidence_floor_for_any_downgrade threshold (default: 0.6).
Task Types Reference
Brief read-only questions, code explanations, or documentation lookups. These are the most common candidates for downgrading to a cheaper model.
Signals
prompt_length_tokens: lownum_files_in_context: lowcontains_keywords: 'what does', 'explain', 'how does', 'why is'num_tool_calls_so_far_in_turn: 0
Default Action
Route to Haiku, low effort
Example Prompt
What does this function do?
```
function calculateTotal(items) {
return items.reduce((sum, i) => sum + i.price, 0);
}
```Targeted edits with short prompts. Typically single-file changes with clear instructions.
Signals
prompt_length_tokens: mediumnum_files_in_context: lowcontains_keywords: 'add', 'change', 'update', 'remove', 'fix'is_followup_in_long_session: false
Default Action
Route to Sonnet, medium effort
Example Prompt
Add input validation to the createUser function. Check that email is not empty and password is at least 8 characters.Cross-file refactoring or significant architectural changes spanning multiple files.
Signals
prompt_length_tokens: highnum_files_in_context: high (3+)contains_keywords: 'refactor', 'restructure', 'migrate', 'extract'prior_turn_used_extended_thinking: true
Default Action
Never downgrade
Example Prompt
Extract the authentication logic from server.ts into a separate auth service module. Update all imports across the project.Design, architecture planning, or implementation strategy discussions.
Signals
num_files_in_context: 0 (no files)contains_keywords: 'plan', 'design', 'architecture', 'strategy', 'approach'prompt_length_tokens: varies
Default Action
Never downgrade
Example Prompt
Design a database schema for a multi-tenant SaaS application with users, organizations, projects, and billing.Debugging sessions, error fixing, or troubleshooting. These often involve iteration and extended thinking.
Signals
num_tool_calls_so_far_in_turn: highis_followup_in_long_session: truecontains_keywords: 'error', 'bug', 'crash', 'debug', 'not working', 'issue'prior_turn_used_extended_thinking: true
Default Action
Never downgrade
Example Prompt
I'm getting a 'TypeError: Cannot read properties of undefined' when I try to access the user profile page. Here's the stack trace and the component code.Writing unit tests, integration tests, or test suites.
Signals
contains_keywords: 'test', 'spec', 'unit test', 'integration test', 'coverage'prompt_length_tokens: mediumnum_files_in_context: low to medium
Default Action
Route to Sonnet, medium effort
Example Prompt
Write unit tests for the authentication middleware. Cover cases: valid token, expired token, missing token, and invalid signature.Requests that don't clearly match any other task type. These default to safe (no downgrade) behavior.
Signals
No strong keyword matchesConfidence below thresholdEdge case or unusual request format
Default Action
Never downgrade (fail safe)
Example Prompt
(Various — any request that doesn't clearly fit the above categories)Override Behavior
The classification and routing can be overridden in several ways:
- Edit rules.yaml — Change which model each task type routes to, or mark it as
never_downgrade - Adjust confidence floor — Lower or raise the threshold that determines whether downgrading is allowed
- Disable routing — Set
enabled: falsein the config to pass all requests through unchanged