fix(worker): route OpenAI-compatible summarize turns to CLAUDE_MEM_TIER_SUMMARY_MODEL (closes #3240)#3257
Open
rodboev wants to merge 1 commit into
Open
Conversation
Contributor
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
CLAUDE_MEM_TIER_SUMMARY_MODELis ignored on OpenRouter and Gemini because the only current tier-routing write goes tosession.modelOverride, and those providers never read it. This change resolves the summary-tier model at summarize dequeue time inside the shared OpenAI-compatible provider path, so summaries can switch models without touching the session-wide config or the Claude provider path.Closes #3240
Why
The issue's queue-depth diagnosis identifies a real gate in
SessionRoutes, but it is not enough for the reporter's provider. On current base,applyTierRouting()writes onlysession.modelOverride, andClaudeProvideris the only reader. OpenRouter and Gemini resolveconfig.modelfrom provider settings and keep using it for every per-message request, including summaries.The fix therefore belongs at the request boundary that actually serves the summarize turn. A pure helper in
model-aliases.tsmirrors the existing summary-tier semantics, andOpenAICompatibleProvider.processSummaryMessage()uses that helper to pick the effective model just before the summarize request is sent.Scope
This PR fixes summary-tier routing for OpenRouter and Gemini summarize turns only. It does not change
SessionRoutes, does not change observation-tier routing, does not change Claude live-generator summarize behavior, and does not add new settings or defaults.Risk
The model decision moves to the real consumer boundary, which is the smallest correct fix. The remaining unproved area is live provider confirmation in a real OpenRouter or Gemini session. Local behavioral tests can prove the request boundary but cannot prove remote provider logs without owner-reaching execution.
Verification
bun test tests/worker/openai-compatible-summary-tier.test.tsbun test tests/worker/model-aliases.test.tsnpm run typechecknpm run buildnpm run lint:hook-io && npm run lint:spawn-envnpm run strip-comments:checkCloses #3240