-
Notifications
You must be signed in to change notification settings - Fork 191
Closed
Labels
enhancementNew feature or requestNew feature or requestpkg:coding-agentCoding agent CLICoding agent CLI
Description
Summary
Add three methods to ExtensionAPI to enable extensions to change model and thinking level at runtime. This unblocks implementing preset configurations (#347) as an extension rather than built-in.
Motivation
Issue #347 requests preset configurations. Analysis showed that an extension can already:
- Read config files (Node.js fs)
- Register CLI flags (
--preset) - Change active tools (
setActiveTools) - Append to system prompt (
before_agent_startevent) - Show UI selectors (
ctx.ui.select) - Find models (
ctx.modelRegistry.find)
But it cannot:
- Set the current model
- Get/set thinking level
Proposed API Additions
interface ExtensionAPI {
// ... existing ...
/** Set the current model. Returns false if model not found or no API key. */
setModel(model: Model<any>): Promise<boolean>;
/** Get current thinking level */
getThinkingLevel(): ThinkingLevel;
/** Set thinking level (clamped to model capabilities) */
setThinkingLevel(level: ThinkingLevel): void;
}Implementation
types.ts- Add API methods and handler typesloader.ts- Wire up handlers in loadExtension()runner.ts- Accept and distribute handlers in initialize()agent-session.ts- Provide actual implementations
TUI Reflection
The footer already reads model/thinking from session state on each render. No TUI changes needed.
Related
- Preset configurations #347 - Preset configurations (will be implementable as extension after this)
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestpkg:coding-agentCoding agent CLICoding agent CLI