Skip to content

Comments

feat: add message routing hook for model selection#20

Open
battman21 wants to merge 5 commits intomainfrom
feature/14150-routing-hook
Open

feat: add message routing hook for model selection#20
battman21 wants to merge 5 commits intomainfrom
feature/14150-routing-hook

Conversation

@battman21
Copy link
Owner

Summary

Test plan

  • Verify before_agent_start hook fires before model selection
  • Test hook-based model routing overrides default model selection
  • Confirm hook behavior is consistent across embedded and subprocess runners
  • Verify TypeScript compilation passes cleanly
  • Run pnpm test to ensure no regressions

🤖 Generated with Claude Code

battman21 and others added 5 commits February 12, 2026 17:22
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant