Repository navigation
feat(mobile): show the active organization where sessions start - #8083
Conversation
Home gets the switchable account control in the header's context slot, and the new-session screen gets an Organization section above Run on. Switching updates the global account (as Profile does) and reopens the form with the new organization id through the stack-safe replace, so the org-scoped picks and the create attribution follow; the durable text draft survives. The clone entry stays locked to its source organization. Reuse: ContextControl and the context picker sheet, no new copy keys.
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Executive SummaryThe incremental change closes the previous gap: a failed account list now keeps the active-account new-session form gated behind the retry, while route-scoped and clone entries still mount from their own scope. No new issues found. Files Reviewed (3 files)
Previous Review Summaries (9 snapshots, latest commit ae3a2d1)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit ae3a2d1)Status: 1 Issue Found | Recommendation: Address before merge Executive SummaryThe retry now covers a failed secure-store restore, but a failed organization-list fetch still mounts the form scoped to Personal with no error or retry on this screen. Overview
Issue Details (click to expand)WARNING
Files Reviewed (2 files)
Fix these issues in Kilo Cloud Previous review (commit a856f28)Status: 1 Issue Found | Recommendation: Address before merge Executive SummaryThe new account gate closes the previous Personal-scope window, but a failed organization restore leaves the new-session screen on a spinner with no retry or fallback. Overview
Issue Details (click to expand)WARNING
Files Reviewed (3 files)
Fix these issues in Kilo Cloud Previous review (commit 4240120)Status: 1 Issue Found | Recommendation: Address before merge Executive SummaryThe new account resolver makes the active account load-bearing for the new-session screen, but the unresolved state is silently treated as Personal by every org-scoped read and by session creation, which can latch a Personal model or create in the wrong account on a cold start. Overview
Issue Details (click to expand)WARNING
Files Reviewed (7 files)
Previous review (commit 6fe6289)Status: No Issues Found | Recommendation: Merge Executive SummaryThe only change since the previous review is a documentation comment in Files Reviewed (1 file)
Previous review (commit e7c14d8)Status: No Issues Found | Recommendation: Merge Executive SummaryThe incremental commit only removes the dev-server-generated Next.js rules block from Files Reviewed (4 files)
Previous review (commit 033a4c9)Status: No Issues Found | Recommendation: Merge Executive SummaryThe incremental commit only corrects the Files Reviewed (1 file)
Previous review (commit 9f3b19b)Status: 1 Issue Found | Recommendation: Address before merge Overview
Fix these issues in Kilo Cloud Issue Details (click to expand)SUGGESTION
Files Reviewed (3 files)
Previous review (commit 63bd6ee)Status: No Issues Found | Recommendation: Merge Executive SummaryBoth previously reported account-switch defects are fixed: the entry's existing search params are carried through the remount and re-picking the active account is now a no-op. The incremental changes introduce no new issues. Files Reviewed (3 files)
Previous review (commit eb0a0c5)Status: 2 Issues Found | Recommendation: Address before merge Executive SummaryThe new account switch on the new-session screen rewrites the route with only Overview
Fix LinkFix these issues in Kilo Cloud Issue Details (click to expand)WARNING
Files Reviewed (6 files)
Reviewed by deepseek-v4.1-flash-1017 · Input: 55.7K · Output: 8.1K · Cached: 405.4K Review guidance: REVIEW.md from base branch |
|
bot: Android end-to-end run on the emulator against the local development stack, using owned non-production test data. Home header shows the active workspace and switches it in place:
New session names the workspace the create will be attributed to:
Arabic RTL pass:
|
Switching the account from the new-session Organization section now carries the entry's own route params (share prefill, clone/fork ids, run-on preselect) into the replaced route, so the remount reopens the same entry instead of a bare one. Re-picking the already-active account in the picker no longer fires the selection callback, so the screen does not remount for a no-op.
…ush the draft before an account switch The Continue/clone entry now renders the account as a read-only ContextControl scope, so a clone still names the organization it belongs to. Switching the account on the ordinary entry flushes the pending debounced draft write before the stack-safe replace, so the remount's draft load reads the newest prompt text inside the debounce window.
The branch picked up the agent-rules block that `next dev` writes into apps/ai-gateway/AGENTS.md. Restore the file so the change stays limited to the mobile screens that show the active account.
|
bot: Android emulator run against the local development stack, with an owned fake account in two test organizations (test fixtures only). What these captures show, in order:
The captured rows name the test organizations "Northwind Labs" and "Cedar Works", and the clone entry uses the fixture title "Fixture source". |
The picker hook calls its change callback only for a picked account that differs from the active one. Say so, so a caller that reopens its screen can rely on a re-pick of the current account being a no-op.
The form, the model catalog, the repositories, the profiles, the attachments and the create read one resolved account: an explicit route organization first, then the active account. Entries that carry no organization (the tour hand-off, the launcher New Agent shortcut) therefore start in the account Home shows instead of a personal scope. A clone entry keeps its own source scope, and an explicit personal clone never inherits the active account. The Organization section shows that same value, so the account it names is the account the create uses.
|
bot: Follow-up verification of the account resolution, on the Android emulator against the local development stack, fake account in two test organizations.
The section, the model catalog, the repositories, the profiles, the attachments and the create read the same resolved account, so the row cannot name an account the session is not created in. |
The form, the model catalog, the repositories, the profiles and the create all take the resolved account, and an unresolved value reads as Personal. Mount them only after the account settles, so a launcher or tour entry cannot fetch a personal catalog, latch a personal model, or start a personal session before the active account arrives. Resolving is a stored-choice read, so the wait is a frame in the common case; an offline first run settles to Personal through the same fallbacks the account context already uses.
…tored A failed restore leaves the account unresolved, so the gate would otherwise show a spinner with no way forward. Show the failure with a retry that re-runs the account restore, and say in the gate comment that a stored choice resolves from storage while an absent one waits on the account list.
A failed account list publishes Personal for the whole app so it stays usable. When the active account is what decides this screen, that fallback is not the user's choice, so keep the form gated behind the retry instead of creating in it. A route-scoped entry and a clone entry know their account without the list, so they still mount.




























bot:
Change
Members of several organizations could not see which account a new session would belong to: only Profile > Credits named it. This PR surfaces the active account (organization or Personal) at both places sessions start:
ContextControl) now sits in the header's context slot under the greeting. It opens the existing account picker sheet and updates in place.organizationIdthrough the stack-safe replace, so org-scoped data (repositories, models, profiles) and the create attribution follow, and the entry's own route params are carried through. The durable text draft is flushed before the replace, so a switch inside the debounce window keeps the typed prompt. The Continue/clone entry renders the same section as a read-only row locked to the source session's organization, so a clone names the account it belongs to without offering a switch.organizationIdin the route, otherwise the active account (useNewSessionOrganization). Entries that carry no organization (the tour hand-off, the launcher "New Agent" shortcut) therefore start in the account Home shows, and the section cannot name an account the create does not use. A Continue/clone entry keeps its own source scope, so a personal clone never inherits the active organization.Reuse over new code:
ContextControl/useContextPickergain an optionalonSelectionChangecallback; no new copy keys (reusescommon.organization,common.personal,profile.selectAccount).Verification
pnpm --filter kilo-app run typecheck,lintandformat:checkclean at HEAD; the full mobile suite passes (1192 files / 17,888 tests), including new tests for the account resolver, for a control that shows an account other than the active one, and for the route gate.Proxy answers
The owner's proxy gave these answers in the owner's place.
Answer: ScreenHeader context slot (below title)
Confidence: 0.65 · Precedent: Speed and least work: 'do the least amount of work possible, with no drop in quality' (7f3470e0ba6f); UX: 'CLS is a massive enemy' (00eb2a1d3e4b). The documented slot avoids width plumbing next to the title.
Answer: Switch globally + replace route (Recommended)
Confidence: 0.75 · Precedent: UX: keep similar elements consistent across surfaces, 'the thought row match the tool call row' (a247f3c19b1e). Use the same global semantics as Profile so the Home attribution stays correct.
Answer: Section like Environment (Recommended)
Confidence: 0.75 · Precedent: UX: keep similar elements consistent across surfaces (a247f3c19b1e), so it matches the form's other pickers.
Answer: Lock (Recommended)
Confidence: 0.65 · Precedent: Autonomy: make executive decisions with the 'is this reasonable?' test (7f3470e0ba6f). Locking keeps clone attribution correct.
Answer: Inherit the active account (Recommended)
Confidence: 0.72 · Precedent: Fix the root cause and the class on every affected surface: session 75f8833fe8c1, "fix this for all shared services model pickers on all surfaces (web, app)"; keep similar elements consistent across surfaces: session a247f3c19b1e