← Back to PRs

#4793: hooks: use configured model for slug generator

by yoyooyooo open 2026-01-30 17:44 View on GitHub →
### Summary `session-memory` can generate a human-friendly slug via an LLM call. When the provider/model is not explicitly specified, the slug generator may fall back to an Anthropic default, which is both noisy and can fail in deployments that only configure OpenAI. ### Changes - Resolve the provider/model for slug generation from the configured defaults instead of relying on implicit fallback behavior. - Add a regression test covering model resolution for the slug generator. ### Rationale This avoids unintended Anthropic usage and prevents `No API key found for provider "anthropic"` errors during `/new` / `session-memory` runs when Anthropic is not configured. ### Testing - `pnpm vitest run src/hooks/llm-slug-generator.test.ts` <!-- greptile_comment --> <h2>Greptile Overview</h2> <h3>Greptile Summary</h3> This PR updates the session-memory slug generator to explicitly resolve the provider/model from the configured defaults (via `resolveDefaultModelForAgent`) and pass them into `runEmbeddedPiAgent`, avoiding implicit Anthropic fallback behavior. It also adds a regression test to ensure the slug generator honors the configured default model/provider (e.g., OpenAI) when Anthropic is not configured. <h3>Confidence Score: 4/5</h3> - This PR is likely safe to merge; changes are small and covered by a focused regression test. - The change is localized to slug generation and uses an existing model-resolution helper that already encodes repo defaults and overrides. Main risk is if callers previously relied on implicit model/provider selection inside `runEmbeddedPiAgent`, but the new behavior aligns with configured defaults and is exercised by a new unit test. - src/hooks/llm-slug-generator.test.ts (ensuring the config shape used in the test matches supported config schemas) and src/hooks/llm-slug-generator.ts (confirming the new explicit provider/model doesn’t conflict with agent overrides). <!-- greptile_other_comments_section --> <sub>(3/5) Reply to the agent's comments like "Can you suggest a fix for this @greptileai?" or ask follow-up questions!</sub> <!-- /greptile_comment -->

Most Similar PRs