fix: use configured model in llm-slug-generator instead of hardcoded …#23286
Open
wsman wants to merge 1 commit intoopenclaw:mainfrom
Open
fix: use configured model in llm-slug-generator instead of hardcoded …#23286wsman wants to merge 1 commit intoopenclaw:mainfrom
wsman wants to merge 1 commit intoopenclaw:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
llm-slug-generatorfunction was using a hardcodedanthropic/claude-opus-4-6model instead of respecting the user's configured default model (agents.defaults.model.primary).FailoverError: No API key found for provider "anthropic".resolveDefaultModelForAgentto resolve the user's configured default model and passprovider/modelparameters torunEmbeddedPiAgent.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
User-visible / Behavior Changes
llm-slug-generator(used by session-memory hook) now respectsagents.defaults.model.primaryconfigurationSecurity Impact (required)
NoNoNoNoNoRepro + Verification
Environment
agents.defaults.model.primary: "openai/gpt-4.1-mini"Steps
openai/gpt-4.1-mini)Expected
Actual (before fix)
[llm-slug-generator] Failed to generate slug: FailoverError: No API key found for provider "anthropic"Evidence
Build and tests pass:
pnpm build✅pnpm test src/hooks/bundled/session-memory✅ (15 tests passed)Human Verification (required)
resolveDefaultModelForAgentwhich handles all model resolution edge cases (aliases, agent-specific overrides, fallbacks)Compatibility / Migration
YesNoNoFailure Recovery (if this breaks)
git revert <commit-sha>nulland falls back to timestamp-based filenames (existing graceful degradation)Risks and Mitigations
agents.defaults.model.primarymight see different errorsnullon failure and falls back gracefullyGreptile Summary
This PR fixes a critical bug where the
llm-slug-generatorwas hardcoded to useanthropic/claude-opus-4-6instead of respecting the user's configured default model. The fix correctly addsresolveDefaultModelForAgentto resolve the configured model and passes bothproviderandmodelparameters torunEmbeddedPiAgent.Key changes:
resolveDefaultModelForAgentfrom../agents/model-selection.jsconst modelRef = resolveDefaultModelForAgent({ cfg: params.cfg, agentId })provider: modelRef.providerandmodel: modelRef.modeltorunEmbeddedPiAgentImpact:
FailoverError: No API key found for provider "anthropic"when session memory hooks generate slugsagents.defaults.model.primaryconfiguration and agent-specific overridesConfidence Score: 5/5
resolveDefaultModelForAgent). The change correctly addresses the root cause by allowing the model selection logic to respect user configuration instead of hardcoding values. The implementation follows the codebase's existing patterns and has proper error handling already in place (slug generation returns null on failure with graceful fallback).Last reviewed commit: d2e2309