#5945: fix: use configured model for slug generator (AI-assisted)
Cluster:
Model Configuration Enhancements
## Summary
- Use the configured default agent model for LLM slug generation instead of falling back to Anthropic defaults.
- Prevent /new hook failures in setups that only configure non-Anthropic providers (e.g., google-antigravity + google-gemini-cli).
## Details
Slug generation uses a temporary embedded agent without specifying provider/model, which defaults to Anthropic. In environments without Anthropic auth, /new triggers FailoverError and can disrupt message handling. This change resolves the default model from config and passes provider/model into the embedded run.
## Testing
- Not run (local reproduction from a live server setup).
## AI Assistance
AI-assisted (OpenCode). Prompt history available on request.
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
This PR updates the LLM-based slug generator hook to use the default model configured for the resolved default agent, instead of implicitly falling back to the global Anthropic defaults. Concretely, `src/hooks/llm-slug-generator.ts` now calls `resolveDefaultModelForAgent({ cfg, agentId })` and passes the returned `{ provider, model }` into `runEmbeddedPiAgent`, preventing failures in environments where Anthropic is not configured but other providers are.
This fits existing patterns in the codebase: other embedded/agent flows resolve a model ref from config (with agent overrides) before running, while the embedded runner itself still retains a final fallback to `DEFAULT_PROVIDER/DEFAULT_MODEL` if nothing is provided.
<h3>Confidence Score: 5/5</h3>
- This PR is safe to merge with minimal risk.
- The change is narrowly scoped (one hook), follows existing model-selection utilities, and simply plumbs an already-supported `provider/model` pair into `runEmbeddedPiAgent` to avoid unintended Anthropic defaults. No behavior changes outside slug generation and no new side effects beyond selecting the configured default model.
- No files require special attention
<!-- greptile_other_comments_section -->
<sub>(2/5) Greptile learns from your feedback when you react with thumbs up/down!</sub>
**Context used:**
- Context from `dashboard` - CLAUDE.md ([source](https://app.greptile.com/review/custom-context?memory=fd949e91-5c3a-4ab5-90a1-cbe184fd6ce8))
- Context from `dashboard` - AGENTS.md ([source](https://app.greptile.com/review/custom-context?memory=0d0c8278-ef8e-4d6c-ab21-f5527e322f13))
<!-- /greptile_comment -->
Most Similar PRs
#4793: hooks: use configured model for slug generator
by yoyooyooo · 2026-01-30
91.5%
#15574: fix(hooks): use configured model for llm slug generation (#15510)
by TsekaLuk · 2026-02-13
91.4%
#9080: Fix: Use configured model for memory file slug generation
by vishaltandale00 · 2026-02-04
90.4%
#23286: fix: use configured model in llm-slug-generator instead of hardcoded …
by wsman · 2026-02-22
89.5%
#13401: fix: slug generator should use agent's primary model instead of har...
by pahud · 2026-02-10
88.9%
#18867: fix: route slug generator LLM call through configured provider
by Celegormhenry · 2026-02-17
86.0%
#7981: fix(runner): use configured primary model as fallback default
by PiyushDuggal-source · 2026-02-03
84.9%
#12459: feat(session-memory): add model config for slug generation
by akari-musubi · 2026-02-09
83.5%
#21735: fix(hooks): pass configured model to slug generator (#21650)
by lailoo · 2026-02-20
80.8%
#14647: feat(plugins): allow before_agent_start hook to override model (#14...
by lailoo · 2026-02-12
79.5%