fix: scope empty session reuse to current window to prevent session mixing#7602
Merged
jh-block merged 1 commit intoblock:mainfrom Mar 4, 2026
Merged
Conversation
23a5283 to
72cddf4
Compare
…ixing (block#7601) When multiple windows are open during an upgrade/restart, handleNewChat previously grabbed the first empty session from the global session list. All windows would race for the same empty session, causing session mixing and data loss. Now handleNewChat only reuses the current window's own active session if it is empty. If the active session has messages or no session is active, a new session is always created. This prevents cross-window collisions. Signed-off-by: fresh3nough <[email protected]>
72cddf4 to
73f9da1
Compare
1 task
jh-block
approved these changes
Mar 4, 2026
Collaborator
|
thanks! |
lifeizhou-ap
added a commit
that referenced
this pull request
Mar 4, 2026
* main: docs: add GOOSE_INPUT_LIMIT environment variable documentation (#7299) Merge platform/builtin extensions (#7630) Clean up stale references to removed components (#7644) fix: scope empty session reuse to current window to prevent session mixing (#7602) fix: prevent abort in local inference (#7633) Revert git patch for llama-cpp-2 (#7642) docs: update recipe usage step to reflect auto-submit behavior (#7639) docs: add guide for customizing the sidebar (#7638) docs: update Claude Code approve behavior and model list in cli-providers guide (#7448) fix: restore provider and extensions for LRU-evicted sessions (#7616) Restore goosed logging (#7622)
Contributor
Author
|
np |
craigwalkeruk
pushed a commit
to craigwalkeruk/custom-goose
that referenced
this pull request
Mar 5, 2026
…ixing (block#7602) Signed-off-by: fresh3nough <[email protected]>
tlongwell-block
added a commit
that referenced
this pull request
Mar 5, 2026
* origin/main: (107 commits) Merge platform/builtin extensions (#7630) Clean up stale references to removed components (#7644) fix: scope empty session reuse to current window to prevent session mixing (#7602) fix: prevent abort in local inference (#7633) Revert git patch for llama-cpp-2 (#7642) docs: update recipe usage step to reflect auto-submit behavior (#7639) docs: add guide for customizing the sidebar (#7638) docs: update Claude Code approve behavior and model list in cli-providers guide (#7448) fix: restore provider and extensions for LRU-evicted sessions (#7616) Restore goosed logging (#7622) feat: return structured {stdout, stderr} from shell tool with output schema (#7604) Improve custom provider creation experience (#7541) fix(scheduler): schedules added via CLI showing up in UI (#7594) chore: openai reasoning model cleanup (#7529) chore(deps): bump hono from 4.12.1 to 4.12.3 in /evals/open-model-gym/mcp-harness (#7585) chore(deps): bump minimatch from 10.1.1 to 10.2.3 in /evals/open-model-gym/suite (#7498) chore(deps): bump swiper from 11.2.10 to 12.1.2 in /documentation (#7368) Better network failure error & antrhopic retry (#7595) feat: make the text bar persistent and add a queue for messages (#7560) fix: outdated clippy command in goosehints (#7590) ... # Conflicts: # Cargo.lock # Cargo.toml # crates/goose-server/src/commands/agent.rs # crates/goose-server/src/main.rs # crates/goose-server/src/routes/reply.rs
Abhijay007
pushed a commit
to Abhijay007/goose
that referenced
this pull request
Mar 6, 2026
…ixing (block#7602) Signed-off-by: fresh3nough <[email protected]>
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
Fixes #7601
When multiple goose desktop windows are open during an upgrade or restart, all windows reload and call
handleNewChat. The previous implementation used a globalsessions.find(s => shouldShowNewChatTitle(s))which picked the first empty session from the shared session list. Every window would grab the same empty session, causing:Root Cause
In
AppSidebar.tsx,handleNewChat(line 432) searched the entirerecentSessionslist for any empty session to reuse. Since all windows load the same session list from the API, they all race for the same first empty session.Fix
Changed
handleNewChatto only reuse the current window's own active session (identified byactiveSessionIdfrom the URL search params) if that session is empty. If the window has no active session or the active session already has messages, a new session is always created.This prevents cross-window collisions because each window has its own distinct
activeSessionId.Changes
ui/desktop/src/components/GooseSidebar/AppSidebar.tsx: Replaced global empty-session lookup with window-scoped active session checkui/desktop/src/__tests__/sessions.test.ts: Added 9 tests coveringshouldShowNewChatTitleand the scoped reuse logic, including a test that demonstrates the old bugTesting
All 307 existing tests pass plus 9 new tests. ESLint clean.