Skip to content

Add recent models to native picker - #195

Closed
kentdebruin wants to merge 3 commits into
mainfrom
report-add-recent-models-to-native-picker
Closed

kentdebruin wants to merge 3 commits into
mainfrom
report-add-recent-models-to-native-picker

Conversation

@kentdebruin

@kentdebruin kentdebruin commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Summary

  • hydrate and persist native recent-model history through the shared recent-models UI preference
  • show up to three available recent choices above the full model submenu
  • preserve unknown model IDs, routing behavior, selection checkmarks, and account-scoped caches
  • serialize selection writes so rapid changes preserve newest-first server ordering
  • allow the shared preference to store all 12 routed model IDs

Verification

  • OS1 iOS Simulator build
  • OS1Mac build
  • OS1Mac unit tests, 934 passed
  • bun test packages/core/opensession-server/src/server/ui-prefs.test.ts, 5 passed

Created by this OS session

@tella-butler

tella-butler commented Aug 24, 2026

Copy link
Copy Markdown
Contributor
🕙 Outdated review — superseded by a newer review below

🤖 OS review

⚠️ Review run errored: The review did not produce the required structured verdict after one continuation.
1 inline comment below.

💡 Labels: os-auto-fix — I fix these and push until CI passes · os-adversarial — deeper two-pass review · os-simplify — quality cleanup pass.
Reviewed 4e80f72 · GPT-5.6 Sol · earlier reviews collapse above · open session

@vercel

vercel Bot commented Aug 24, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
opensession Ready Ready Preview Aug 24, 2026 11:51pm

@tella-butler tella-butler left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OS review · 4e80f72

Comment thread packages/clients/ios/OS1/NativePreferences.swift Outdated
@tella-butler

tella-butler commented Aug 24, 2026

Copy link
Copy Markdown
Contributor
🕙 Outdated review — superseded by a newer review below

🤖 OS review · request changes · confidence 2/5

Safe 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.
1 inline comment below.

💡 Labels: os-auto-fix — I fix these and push until CI passes · os-adversarial — deeper two-pass review · os-simplify — quality cleanup pass.
Reviewed 4e80f72 · GPT-5.6 Sol · earlier reviews collapse above · open session

🔁 Handed 1 finding(s) to the owning session — fix round 1/6 · open session

@tella-butler tella-butler left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OS review · 4e80f72

Comment thread packages/clients/ios/OS1/NativePreferences.swift Outdated
@tella-butler

tella-butler commented Aug 24, 2026

Copy link
Copy Markdown
Contributor
🕙 Outdated review — superseded by a newer review below

🤖 OS review · request changes · confidence 3/5

The new commit fixes the concurrent-write race, but the configured history size still exceeds what the shared preference endpoint can persist.
1 inline comment below.

💡 Labels: os-auto-fix — I fix these and push until CI passes · os-adversarial — deeper two-pass review · os-simplify — quality cleanup pass.
Reviewed bfce922 · GPT-5.6 Sol · earlier reviews collapse above · open session

🔁 Handed 1 finding(s) to the owning session — fix round 2/6 · open session

@tella-butler tella-butler left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟠 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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 1ae4ca2: recent-models now uses the long UI-preference value allowance, with a regression test covering twelve realistic routed IDs.

@tella-butler

tella-butler commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

🤖 OS review · approve · confidence 3/5

The 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.

💡 Labels: os-adversarial — deeper two-pass review · os-simplify — quality cleanup pass · os-auto-fix — fix anything outstanding and push until CI passes.
Reviewed 1ae4ca2 · GPT-5.6 Sol · earlier reviews collapse above · open session

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants