mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-01 10:10:21 +00:00
feat(plugins): add modelOverride/providerOverride to before_agent_start hook
Enable plugins to override the model and provider for agent runs by returning modelOverride/providerOverride from the before_agent_start hook. The hook is now invoked early in run.ts (before resolveModel) so overrides take effect. The result is passed to attempt.ts via earlyHookResult to prevent double-firing. This enables security-critical use cases like routing PII-containing prompts to local models instead of cloud providers.
This commit is contained in:
committed by
Peter Steinberger
parent
15dd2cda20
commit
b90eb51520
@@ -332,6 +332,10 @@ export type PluginHookBeforeAgentStartEvent = {
|
||||
export type PluginHookBeforeAgentStartResult = {
|
||||
systemPrompt?: string;
|
||||
prependContext?: string;
|
||||
/** Override the model for this agent run. E.g. "llama3.3:8b" */
|
||||
modelOverride?: string;
|
||||
/** Override the provider for this agent run. E.g. "ollama" */
|
||||
providerOverride?: string;
|
||||
};
|
||||
|
||||
// llm_input hook
|
||||
|
||||
Reference in New Issue
Block a user