fix(think-mode): skip gpt-5-nano high upgrade on unsupported Zen model#2383
fix(think-mode): skip gpt-5-nano high upgrade on unsupported Zen model#2383cyberprophet wants to merge 2 commits intocode-yeongyu:devfrom
Conversation
…Korean keyword matching Two independent bugs caused 'Model not found: opencode/gpt-5-nano-high': 1. gpt-5-nano was mapped to gpt-5-nano-high in HIGH_VARIANT_MAP, but this variant does not exist on the OpenCode Zen provider. gpt-5-nano is a lightweight nano model with no reasoning/high-effort variant. 2. The Korean word '고민' (to worry/ponder) was listed as a think-mode trigger keyword. It is a common conversational word that fires think mode on everyday sentences like '어떻게 할지 고민하고 있었는데' (I was wondering how to...). Replaced with explicit reasoning-request forms only: '생각해줘', '깊이 생각', '신중하게 검토'. Fixes: code-yeongyu#2382
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
There was a problem hiding this comment.
1 issue found across 4 files
Confidence score: 4/5
- This PR looks safe to merge with minimal risk: the reported issue is in a test (
src/hooks/think-mode/index.test.ts) rather than production logic. - The most significant concern is that the '고민' regression test uses
gpt-5-nano, which is not inHIGH_VARIANT_MAP, so the test cannot validate the intended model-upgrade path and may miss keyword-detection regressions. - Given severity 5/10 (with high confidence), this is a meaningful quality gap but not an immediate runtime breakage signal.
- Pay close attention to
src/hooks/think-mode/index.test.ts- the current model choice weakens regression coverage for keyword detection behavior.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="src/hooks/think-mode/index.test.ts">
<violation number="1" location="src/hooks/think-mode/index.test.ts:171">
P2: The regression test for '고민' uses an incapable model (gpt-5-nano), making it ineffective at catching keyword detection regressions. Since gpt-5-nano is not in HIGH_VARIANT_MAP, the model will never be upgraded regardless of keyword detection results. If the keyword detector were to regress and start detecting '고민', this test would pass silently. Change the modelID to a capable model like 'claude-opus-4-6' to properly isolate and test keyword detection behavior.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
Preserve existing multilingual think-mode detection, including Korean trigger words like "고민", while limiting the fix to the actual incompatibility: gpt-5-nano has no supported high variant on the OpenCode Zen provider. This keeps existing Sonnet/Opus high-variant behavior intact on the same trigger text and prevents Model not found: opencode/gpt-5-nano-high. Refs: code-yeongyu#2382
There was a problem hiding this comment.
No issues found across 3 files
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Auto-approved: Minimal fix removing a broken model mapping that caused crashes. Comprehensive regression tests confirm the specific fix and preserve existing behavior for other models.
|
Closing, fixed by #2390 . Thank you for your contributions! |
@code-yeongyu I really appreciate the effort you’ve put into this project, and I’m looking forward to seeing how it continues to evolve. Wishing you all the best with your future work! |
Summary
Fixes
Model not found: opencode/gpt-5-nano-highwith the minimum production change needed.Closes #2382
Why this is the smallest safe fix
The failure is not in multilingual think-mode detection itself. The actual incompatibility is narrower:
-highvariantgpt-5-nanowas included inHIGH_VARIANT_MAPopencode/gpt-5-nano-highModel not foundBecause of that, this PR leaves
detector.tsunchanged and only removes the unsupported upgrade path.Production change
File:
src/hooks/think-mode/switcher.tsRemoved the single unsupported mapping:
That means:
-highgpt-5-nanono longer upgrades to a model ID that Zen cannot resolveStability / risk profile
This is intentionally a minimal-scope fix:
src/hooks/think-mode/switcher.tssrc/hooks/think-mode/detector.tsis untouched in the final PRcreateThinkModeHook()API stays the sameTests
Regression coverage was added to prove both safety and behavior preservation:
src/hooks/think-mode/switcher.test.tsgetHighVariant("gpt-5-nano")returnsnullgetHighVariant("opencode/gpt-5-nano")returnsnullsrc/hooks/think-mode/index.test.tsUsing the same Korean trigger sentence that surfaced the bug:
gpt-5-nanodoes not upgradeclaude-sonnet-4-6still does upgrade toclaude-sonnet-4-6-highThis directly verifies that the fix is narrow:
Verification
bun test src/hooks/think-mode/Result:
Review note
cubic identified a valid test weakness in the first draft: the original regression test used
gpt-5-nanoalone, which was not sufficient to prove keyword-trigger behavior on a model that can actually upgrade. This PR now includes a paired Sonnet regression on the same Korean sentence to preserve that coverage while keeping the production fix minimal.