feat: add message routing hook for model selection#20
Open
feat: add message routing hook for model selection#20
Conversation
…dback (openclaw#14374) - Add warning message when audio transcription is skipped due to no models - Add verbose logging throughout auto-detection flow - Help users understand why transcription isn't working - Guide users to docs for setup instructions Fixes openclaw#14374 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Add modelId field to before_agent_start hook event and result - Call hook before model selection in agent runner - Allow plugins to route messages to different models based on content - Support both provider/model and model formats for routing - Add verbose logging when routing occurs Fixes openclaw#14150 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Add modelId to embedded runner hook event for consistency - Fix routing log to only show when routing actually applied - Add messages to agent-runner-execution hook event - Reject invalid modelId formats (more than 2 parts) Addresses Greptile review feedback
…t hook - Add local routing variables (routedProvider, routedModelId, routedModel) - Parse hookResult.modelId and resolve model from registry - Use routed model throughout execution (createAgentSession, validation, logging) - Consistent with agent-runner-execution.ts routing implementation - Reject invalid modelId formats (more than 2 slashes)
- Remove non-existent messages field from hook event (not available in agent runner context) - Fix logger call from defaultRuntime.log.warn to defaultRuntime.log (log is a function, not object) - Agent runner hook now consistent with type definitions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
before_agent_starthook for message routing and model selection (Feature Request: Message Pre-Processing Hook for Request Routing openclaw/openclaw#14150)before_agent_starthook consistent across all runners (embedded, subprocess, etc.)Test plan
before_agent_starthook fires before model selectionpnpm testto ensure no regressions🤖 Generated with Claude Code