Repository navigation
fix(mobile-web): derive chat header from the session workspace - #3665
Merged
bobleer merged 6 commits intoNov 2, 2026
Merged
Conversation
The chat header read the store's selected workspace, so opening a Claw session showed the previously selected project and branch. Pass the session's workspace context when a session is opened and keep it in the tab navigation record. Assistant sessions show the assistant name and no branch; normal sessions show their own workspace and a branch only when it is the currently selected workspace. Fixes openBitFun#2360
The rollback gate read the selected workspace, so a session opened from another workspace could get the wrong answer. Decide it from the same session context as the header. Also compare localhost markers from older hosts on both sides when matching the selected workspace, apply a selected owner to a created session only when it matches, and clear the session workspace when leaving the chat.
A path-only session context, such as an old cached row, read as local and could offer rollback on an SSH workspace. Treat it as unknown: it stays gated if the selected workspace or a known workspace with the same ID or root is remote. Only Claw/assistant or explicit routing facts can override a remote selection.
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
The mobile web chat header now takes its workspace line from the session being opened, not from the store's selected workspace. Assistant/Claw sessions show the assistant name and no branch. A normal session shows its own workspace, and a branch only when that workspace is the currently selected one, because that is the only workspace whose branch mobile web knows.
Fixes #2360
Type and Areas
Type: Bug fix
Areas: Mobile web
Motivation / Impact
Opening a Claw session in BitFun Remote showed the previously selected project and branch (
home / master), even though commands ran in the assistant workspace.SessionListPagenow passes aSessionWorkspaceContextwhen a session is selected or created. Its display name and kind come from the owning catalog row, or from the mode-scoped selection for the flat list, because the host'sworkspace_nameis only a root label.Appkeeps that context and adds it to the tab navigation record, so a reload restores the same header. The field is additive.resolveChatHeaderContext(inworkspaceIdentity.ts) derives the header.isClawAgentmoved there fromSessionListPage, unchanged.Native mobile apps (Kotlin, HarmonyOS) are not changed. The issue reports the relay web UI, and I did not check whether the native headers have the same problem.
Verification
Run locally in
src/mobile-web, all passing:pnpm --dir src/mobile-web run type-checkpnpm --dir src/mobile-web run test:workspace-identity(35): assistant, other-project, same-path SSH hosts,localhostmarkers from older hosts on either side, the rollback gate, and selections that no longer own a created sessionpnpm --dir src/mobile-web run test:account-login(18): navigation records from older builds, and malformed workspace valuespnpm --dir src/mobile-web run test:ui-components(18)pnpm --dir src/mobile-web run test:account-browser(21): includes a new test using the real sidebar andChatPagein Chrome at 390px and 1280px, with host IO simulated andhome / masterselected. It checks a new Claw session, an existing Claw session, the selected project (home,master) and another project (api, no branch).pnpm --dir src/mobile-web run test:chat-transcript-browser,test:rollback-browser,test:session-stream-browserpnpm run build:mobile-webRegression check: with the old header logic temporarily restored, the new browser test fails with
{ workspace: 'home', branch: 'master' }, which matches the issue.Remote scenarios:
Locale files are unchanged because the fallback label reuses
shared.agents.Claw, so the i18n audit was not run.Reviewer Notes
session.workspaceinopenbitfun.mobile.navigation.v1is optional. Older builds ignore it, and new code reads records without it and drops malformed values.currentWorkspace, so it could offer rollback on an SSH session while a local project was selected, or hide it on a Claw or local session while an SSH project was selected.isRemoteSessionWorkspacenow decides from the same session context as the header. Only Claw/assistant or a context with explicit routing facts can decide alone. A context with no routing facts (for example an old cached row with only a path) is treated as unknown, and stays gated ifcurrentWorkspaceis remote or a known workspace with the same ID or root is remote.knownWorkspaces). Until it loads, such as right after a restore, onlycurrentWorkspacecan gate an unknown context.Checklist