← Back to PRs

#12459: feat(session-memory): add model config for slug generation

by akari-musubi open 2026-02-09 08:23 View on GitHub →
stale
## Summary Allow users to specify a dedicated model for slug generation in the `session-memory` hook, avoiding the use of expensive primary models for trivial slug generation. ## Changes - **`src/hooks/llm-slug-generator.ts`**: Accept optional `model` parameter and pass it to `runEmbeddedPiAgent` - **`src/hooks/bundled/session-memory/handler.ts`**: Read `model` from hook config and forward to `generateSlugViaLLM` - **`src/hooks/bundled/session-memory/HOOK.md`**: Document the new `model` config option ## Configuration ```json { "hooks": { "internal": { "entries": { "session-memory": { "model": "google/gemini-3-flash" } } } } } ``` When not specified, the default primary model is used (backward compatible). ## Motivation The slug generation prompt is trivial ("generate a 1-2 word filename slug") — any small model handles it well. Users with expensive primary models (Opus, GPT-4) are currently spending premium tokens on this. Closes #12458 <!-- greptile_comment --> <h2>Greptile Overview</h2> <h3>Greptile Summary</h3> This PR adds an optional `model` override to the bundled `session-memory` hook so slug generation can run on a cheaper model than the primary/default. The hook handler reads `model` from `hooks.internal.entries["session-memory"]` config, forwards it into `generateSlugViaLLM`, and `llm-slug-generator` passes it through to `runEmbeddedPiAgent`. Documentation (`HOOK.md`) is updated to describe the new config option and show an example. <h3>Confidence Score: 5/5</h3> - This PR is safe to merge with minimal risk. - Changes are small and localized: a new optional config field is plumbed through to an existing agent runner parameter, with sane defaulting when omitted. I verified `runEmbeddedPiAgent` already supports a `model` parameter and defaults are preserved, and no other behavior is changed beyond selecting the model used for slug generation. - 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