fix(app): restore per-session agent selection when switching between sessions - #3475
Open
PriyeshPandey2000 wants to merge 2 commits into
Open
fix(app): restore per-session agent selection when switching between sessions#3475PriyeshPandey2000 wants to merge 2 commits into
PriyeshPandey2000 wants to merge 2 commits into
Conversation
…ader comment The getSessionAgent helper was exported and imported into session-route.tsx but never called — the send path reads the agent from the render-scope selectedAgent value instead. Remove the dead export and its import. Also correct the file header, which claimed sessions without a stored agent fall back to the global agent preference. They do not: the store simply has no entry and the session uses the default agent. The global preference is only read in session-route.tsx when no session is selected.
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
Contributor
|
@PriyeshPandey2000 is attempting to deploy a commit to the Different AI Team on Vercel. A member of the Team first needs to authorize it. |
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
local.prefs.selectedAgent) shared by every session, so picking an agent in one conversation overwrote it for all of themsession-agent-store.ts, a localStorage store keyed by session ID, mirroring the existingsession-model-store.tssession-route.tsxreads/writes the active session's agent; the new-task composer still uses the global prefWhy
Issue
Scope
session-agent-store.ts(new): per-session agent map underopenwork.sessionAgents.v1, capped at 200 entries, tolerant of missing or malformed storagesession-route.tsx:selectedAgentderives from the active session;setSelectedAgentwrites per-session, or to the global pref when no session is selectedOut of scope
local.prefs.selectedAgentstays as the new-task composer's source of truth, preserving the reload persistence from#2101session-model-store.tsbehaves the same way today, so this keeps the two consistent rather than changing one in a bugfixTesting
Ran
pnpm typecheckbun test --isolate tests/(apps/app unit suite)pnpm test:session-switchpnpm test:sessionspnpm test:healthResult
tests/message-list-loading.test.tsxhas 2 failures (Invalid hook call/TypeError: null is not an object (evaluating 'resolveDispatcher().useState')inrenderToStringImpl). These are pre-existing ondev— I re-ran that file with this branch's two files reverted to theirdevstate and got the identical 2 failures, so they are unrelated to this change. Everything else is green: 600 pass in the unit suite, 7/7 steps intest:session-switch,ok: truefortest:sessionsandtest:health.CI status
Manual verification
buildagent on session A andplanon session Bbuild(before this change it showedplan)