#18867: fix: route slug generator LLM call through configured provider
size: XS
Cluster:
Model Configuration Enhancements
## Problem
`generateSlugViaLLM()` calls `runEmbeddedPiAgent()` without passing `provider` or `model`, so the embedded agent defaults to a direct Anthropic API call. For users routing through LiteLLM (or other proxies), this silently fails — no API key for Anthropic — and every session falls back to a timestamp slug (e.g. `0231`) instead of a descriptive one (e.g. `slug-bug`).
## Fix
Extract the provider and model from `agents.defaults.model.primary` (e.g. `litellm/claude-opus-4-6` → provider `litellm`, model `claude-opus-4-6`) and pass them to `runEmbeddedPiAgent()`. This ensures the slug generator uses the same model routing as the rest of the app.
## Testing
Before fix: every `/new` produced timestamp slugs (`2026-02-17-0210.md`, `2026-02-17-0220.md`, etc.)
After fix: `/new` produces descriptive slugs (`2026-02-17-slug-bug.md`)
<!-- greptile_comment -->
<h3>Greptile Summary</h3>
Fixes slug generation for users routing LLM calls through LiteLLM or other proxies by extracting provider and model from `agents.defaults.model.primary` and passing them to `runEmbeddedPiAgent()`. Without this fix, the slug generator defaults to direct Anthropic API calls, which fail for proxy users without Anthropic keys, resulting in timestamp-based slugs instead of descriptive ones.
<h3>Confidence Score: 4/5</h3>
- This PR is safe to merge with minimal risk
- The fix correctly addresses the root cause by extracting provider/model from config and passing to the embedded agent. The parsing logic is sound (using indexOf + slice), though it differs from the existing splitModelRef utility in subagent-spawn.ts. The fallback behavior (undefined when no slash found) matches the function signature expectations.
- No files require special attention
<sub>Last reviewed commit: 15e3c16</sub>
<!-- greptile_other_comments_section -->
<sub>(2/5) Greptile learns from your feedback when you react with thumbs up/down!</sub>
<!-- /greptile_comment -->
Most Similar PRs
#9080: Fix: Use configured model for memory file slug generation
by vishaltandale00 · 2026-02-04
88.2%
#23286: fix: use configured model in llm-slug-generator instead of hardcoded …
by wsman · 2026-02-22
87.4%
#15574: fix(hooks): use configured model for llm slug generation (#15510)
by TsekaLuk · 2026-02-13
86.2%
#5945: fix: use configured model for slug generator (AI-assisted)
by HEDELKA · 2026-02-01
86.0%
#13401: fix: slug generator should use agent's primary model instead of har...
by pahud · 2026-02-10
85.3%
#4793: hooks: use configured model for slug generator
by yoyooyooo · 2026-01-30
85.1%
#21735: fix(hooks): pass configured model to slug generator (#21650)
by lailoo · 2026-02-20
81.1%
#14464: fix(hooks): use configured primary model for slug generation (#14272)
by lailoo · 2026-02-12
78.6%
#12459: feat(session-memory): add model config for slug generation
by akari-musubi · 2026-02-09
76.5%
#7981: fix(runner): use configured primary model as fallback default
by PiyushDuggal-source · 2026-02-03
76.2%