Skip to content

fix: router delegates customize_prompt_builder with resolved model - #16

Merged
nshi merged 2 commits into
masterfrom
gemma-thinking
Apr 27, 2026
Merged

fix: router delegates customize_prompt_builder with resolved model#16
nshi merged 2 commits into
masterfrom
gemma-thinking

Conversation

@nshi

@nshi nshi commented Apr 26, 2026

Copy link
Copy Markdown
Owner

Summary

  • RouterProvider inherited the default no-op customize_prompt_builder, so provider-specific prompt customizations (e.g. Ollama injecting <|think|> for Gemma) were silently skipped when using routed hints like hint:gemma
  • Router now resolves the hint to the actual provider + model name before delegating to the inner provider's customize_prompt_builder
  • Added #[derive(Clone)] on PromptContext to support creating a copy with the resolved model name

Test plan

  • New test customize_prompt_builder_delegates_with_resolved_model verifies router resolves hint and passes real model name to inner provider
  • All 22 existing router tests pass
  • All 5 existing customize_prompt_builder tests pass (Ollama + Anthropic)
  • Manual: send a message to Gemma via Telegram, verify <|think|> appears at the top of the system prompt in the trace

RouterProvider inherited the default no-op for customize_prompt_builder,
so provider-specific prompt customizations (e.g. Ollama injecting the
<|think|> token for Gemma models) were silently skipped when routing
through hints like "hint:gemma". Resolve the hint to the actual provider
and model name before delegating.
@nshi
nshi merged commit 6287877 into master Apr 27, 2026
18 checks passed
@nshi
nshi deleted the gemma-thinking branch April 27, 2026 02:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant