Repository navigation
fix(desktop): route project session branches by owner - #97359
evan-bradford wants to merge 4 commits into
Conversation
fa61ba1 to
e72bc2d
Compare
Live macOS deployment verification — 2026-08-28I built the combined reviewed source at Provenance and packaging:
After backend restart and app relaunch, the actual affected parent session appears exactly once through the I intentionally did not create a throwaway branch in the production session DB; the exact branch interaction is exercised by the native Electron E2E, while live verification remained read-only. |
Launch/default project-tree rows are now stamped profile="default" by
stamp_profile (the cross-profile ownership fix), which forwards an explicit
profile into branchStoredSession. When that explicit profile equals the
ACTIVE gateway profile ("default" on a launch-profile backend) and the
by-id getSession miss resolves to undefined, the fail-closed arm dropped the
parent row's cwd, so the created branch had no workspace and nothing appeared
where the user clicked until a tree/session refresh repainted it.
Soft-fall to the cached row when the explicit profile equals the active
gateway profile — that is not a cross-profile claim, so no metadata can
leak; genuinely foreign profiles still fail closed as before (sfb routing
unchanged). Adds a regression test reproducing the launch-profile miss and
asserting cwd/parent survive. Verified: 100/100 targeted tests, eslint
clean. Follow-up to NousResearch#97359 which exposed this launch-row corner.
Follow-up: keep launch-profile parent metadata in branch owner path (
|
|
Owner note for any agent resuming this PR: commit |
|
Superseded by #100879, which consolidates the full branch-load path.\n\nCarried from here: the gateway-side profile stamping on scoped project rows (), committed under your authorship, plus preferring a self-describing row over an ownerless Recents duplicate. The routing half is subsumed by full owner routing \u2014 a profile name alone can't disambiguate two connections that both expose , which is the case in the original report. The owner now resolves inside , so the sidebar/tile profile passthrough isn't needed. |
|
Superseded by #100879, which consolidates the full branch-load path. Carried from here: the gateway-side profile stamping on scoped project rows ( The routing half is subsumed by full |
Summary
Create a Desktop conversation branch through the parent session's owning profile when that parent comes from a profile-scoped Project tree.
This fixes the observed case where a session owned by a non-default profile was visible under a Project, but Branch could not resolve/read it or created the child through the active/default profile.
Root cause
Profile ownership was lost across three boundaries:
projects.tree/projects.project_sessionsrows were not self-describing.branchStoredSession()could let an ownerless Recents duplicate mask the authoritative Project-tree row, and an explicitly forwarded profile skipped or mis-scoped parent metadata resolution (losing the worktreecwdor borrowing it from a same-ID session in another profile).Fix
session.createthrough that profile.cwdand failing closed rather than borrowing another profile's metadata.Regression coverage
cwd.cwd.Verification on current
mainassert-dist-built: passed2fc2408fc2fc2408fc— PASS, no blockersb5f9c2619additionally pins explicit-profile fetch failure against a foreign same-ID cache row2fc2408fc: arm64 production build, then visible persisted parent → Session actions → Branch → nested child — 1/1 passed in 11.1sRelationship to open PRs
profile_name(defaulting missing values). This PR fixes branch routing and stamps the requested scoped profile, which remains authoritative for legacy rows whose persistedprofile_nameis null. The behavioral scope is additive, though the response field may conflict mechanically if fix(desktop): preserve project session profiles #89736 merges first.Cache/profile safety
No prompt, message history, memory, or toolset state is mutated. Ownership is carried as request/display metadata and used only to select the existing profile-scoped session APIs.