Add recent models to native picker - #195
kentdebruin wants to merge 3 commits into
Conversation
🕙 Outdated review — superseded by a newer review below🤖 OS review
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
tella-butler
left a comment
There was a problem hiding this comment.
OS review · 4e80f72
🕙 Outdated review — superseded by a newer review below🤖 OS review · request changes · confidence 2/5Safe once the concurrent-write race below is fixed. The native picker correctly hydrates, filters, displays, and locally updates recent models, but rapid selections can leave the shared server preference stale and break cross-device ordering.
🔁 Handed 1 finding(s) to the owning session — fix round 1/6 · open session |
tella-butler
left a comment
There was a problem hiding this comment.
OS review · 4e80f72
🕙 Outdated review — superseded by a newer review below🤖 OS review · request changes · confidence 3/5The new commit fixes the concurrent-write race, but the configured history size still exceeds what the shared preference endpoint can persist.
🔁 Handed 1 finding(s) to the owning session — fix round 2/6 · open session |
tella-butler
left a comment
There was a problem hiding this comment.
OS review · bfce922
| guard !id.isEmpty else { return } | ||
| let defaults = UserDefaults.standard | ||
| let current = decodeRecentModels(defaults.string(forKey: recentModelsStorageKey)) ?? [] | ||
| let next = addingRecentModel(id, to: current) |
There was a problem hiding this comment.
🟠 P2 — Allow the server to store the configured history size
This retains up to 12 IDs, while ui-prefs.ts still gives recent-models the ordinary 200-character limit. The seven default routed picker IDs already encode to exactly 200 characters, so selecting any preset or eighth configured model produces an oversized value. patchUiPrefs silently rejects that key, while the optimistic local cache hides the failure until another device or later hydration reads the old history. Add recent-models to the server's long-value keys, with a limit test covering 12 realistic model IDs.
There was a problem hiding this comment.
Fixed in 1ae4ca2: recent-models now uses the long UI-preference value allowance, with a regression test covering twelve realistic routed IDs.
🤖 OS review · approve · confidence 3/5The latest commit resolves the remaining persistence-limit issue. The full PR now safely hydrates, validates, displays, and persists recent models while serializing native writes and preserving account-scoped state.
|
Summary
recent-modelsUI preferenceVerification
bun test packages/core/opensession-server/src/server/ui-prefs.test.ts, 5 passedCreated by this OS session