#13401: fix: slug generator should use agent's primary model instead of hardcoded anthropic default
stale
Cluster:
Model Configuration Enhancements
Fixes #13396
## Problem
When using OpenClaw with **Bedrock-only** configuration (no Anthropic API key), the slug generator fails with:
```
FailoverError: No API key found for provider "anthropic"
```
This occurs because `runEmbeddedPiAgent` (used by slug generator) falls back to the hardcoded default `anthropic/claude-opus-4-6` instead of respecting the agent's configured primary model.
## Solution
The slug generator now resolves models in this order:
1. Explicit `slugGenerator.model` config (if provided)
2. Agent's primary model (from agent config)
3. Falls back to `runEmbeddedPiAgent`'s default resolution
## Changes
- Added `slugGenerator.model` field to `OpenClawConfig` type
- Modified `llm-slug-generator.ts` to resolve model using `resolveAgentModelPrimary`
- Pass resolved model to `runEmbeddedPiAgent`
## Testing
Tested with Bedrock-only configuration:
- Agent primary model: `amazon-bedrock/us.anthropic.claude-haiku-4-5-20251001-v1:0`
- No Anthropic API key configured
- Slug generator now uses Bedrock model successfully
## Impact
This fixes startup failures for users with:
- Bedrock-only setup
- Azure OpenAI-only setup
- Any non-Anthropic provider configuration
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
This PR updates the LLM-based session slug generator to pick a model from configuration instead of relying on `runEmbeddedPiAgent`’s hardcoded defaults (which can force the `anthropic` provider and break “Bedrock-only”/non‑Anthropic setups). It adds an optional `slugGenerator.model` field to `OpenClawConfig`, then in `src/hooks/llm-slug-generator.ts` resolves the effective model as `cfg.slugGenerator.model` first, otherwise the default agent’s primary model via `resolveAgentModelPrimary(cfg, agentId)`, and passes that through to `runEmbeddedPiAgent`.
Overall, the change is small and consistent with existing model selection helpers (`resolveAgentModelPrimary`). I did not find any new functional issues in the changed code paths.
<h3>Confidence Score: 5/5</h3>
- This PR is safe to merge with minimal risk.
- Changes are limited in scope, use an existing model-resolution helper, and correctly pass an optional `model` override down to `runEmbeddedPiAgent` without altering other execution logic.
- 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>
<!-- /greptile_comment -->
Most Similar PRs
#23286: fix: use configured model in llm-slug-generator instead of hardcoded …
by wsman · 2026-02-22
90.3%
#5945: fix: use configured model for slug generator (AI-assisted)
by HEDELKA · 2026-02-01
88.9%
#15574: fix(hooks): use configured model for llm slug generation (#15510)
by TsekaLuk · 2026-02-13
88.9%
#9080: Fix: Use configured model for memory file slug generation
by vishaltandale00 · 2026-02-04
88.0%
#4793: hooks: use configured model for slug generator
by yoyooyooo · 2026-01-30
87.6%
#18867: fix: route slug generator LLM call through configured provider
by Celegormhenry · 2026-02-17
85.3%
#20712: fix(subagents): prioritize agent runtime default model over global ...
by sourcesavant · 2026-02-19
81.3%
#7981: fix(runner): use configured primary model as fallback default
by PiyushDuggal-source · 2026-02-03
80.9%
#12459: feat(session-memory): add model config for slug generation
by akari-musubi · 2026-02-09
80.4%
#8963: fix(bedrock): fix amazon bedrock model problem of dealing with profile
by 67ailab · 2026-02-04
80.0%