fix(models): Persist selected model into new sessions#2690
Merged
Conversation
|
React Doctor found no issues in the changed files. 🎉 Reviewed by React Doctor for commit |
Contributor
Prompt To Fix All With AIFix the following 1 code review issue. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 1
packages/agent/src/adapters/claude/claude-agent.resume-model.test.ts:173-190
**Standalone `it` where a parameterised block fits**
The team prefers parameterised tests. There are now two standalone `it` calls covering `newSession` (line 156 and here). The new case exercises a different model value and an extra assertion (`warnSpy`), but both cases could live in a single `it.each` table: one column for `model`, one for `expectedCurrentValue`, and an optional `expectsWarn` flag — or split into two `it.each` blocks grouped by concern. As written, a third scenario would again be a standalone `it`, making the pattern diverge further from the rest of the file.
Reviews (1): Last reviewed commit: "persist selected model into new sessions" | Re-trigger Greptile |
There was a problem hiding this comment.
No showstoppers. Targeted bug fixes for model persistence (hydration race), codex MCP crashes (sub-table collapsing, bare-key guard, reachability probe), and adapter/model desync logging. All new paths are tested, boundary rules respected, and the resolved bot comment was already addressed in this diff.
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.
Problem
The model picked on the task input page could be dropped when starting a new task, so the session silently ran Opus 4.8 instead of the selected model (for example gpt-5.5). The input page restored the saved model before the settings store finished its async hydration, so it read empty and fell back to the server default. Separately, the adapter and the model were resolved from different sources and sent independently, so a Codex model could pair with the Claude adapter, which then silently rewrote the model to Opus.
Changes
usePreviewConfig)TaskInput)base-acp-agent)How did you test this?
pnpm --filter @posthog/agent typecheck(clean)pnpm --filter @posthog/agent exec vitest run claude-agent.resume-model.test.ts(6/6 pass, including the new case)pnpm exec biome linton the four changed files (clean)pnpm typecheckfails on pre-existing@posthog/uiand@posthog/weberrors incanvas/and@posthog/quill/quill-charts, none in the files this PR touchesAutomatic notifications