Repository navigation
Conversation
The mobile organization selection is now a single account-scoped SecureStore value: an organization id, the Personal choice, or nothing for "not chosen yet". Every reader decodes it through lib/organization-selection, so the Personal choice is never taken for an organization id. Saves run on the shared serialized save queue and re-check their generation and auth epoch once the queue settles, so the stored value matches the selection the provider publishes even when two selections are made in quick succession. A legacy Personal marker is read once for upgrades, recorded as the selection value, and cleared with the rest of the account metadata on sign-out.
|
bot: Android emulator, dev client against the local stack, signed in with a test account that belongs to two organizations.
The unit and mounted suites cover the storage path headlessly as well. |
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Executive SummaryThe follow-up splits save fencing from restore fencing ( Assumptions: Files Reviewed (2 files)
Previous Review Summaries (9 snapshots, latest commit 256b7c0)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit 256b7c0)Status: 1 Issue Found | Recommendation: Address before merge Executive SummaryThe ordered, fenced selection save treats a same-account token refresh as a superseding operation, so Assumptions: Overview
Issue Details (click to expand)WARNING
Files Reviewed (2 files)
Fix these issues in Kilo Cloud Previous review (commit 5ccdea9)Status: No Issues Found | Recommendation: Merge Executive SummaryThe incremental change updates only comments and a test name in Assumptions: Files Reviewed (2 files)
Previous review (commit 43161b6)Status: 1 Issue Found | Recommendation: Address before merge Executive SummaryThe selection queue and its per-write generation/epoch fences hold, and the earlier promote/ Assumptions: Overview
Issue Details (click to expand)SUGGESTION
Files Reviewed (4 files)
Fix these issues in Kilo Cloud Previous reviewStatus: 3 Issues Found | Recommendation: Address before merge Executive SummaryThe new native-build promote path is inert: the workflow consumes Assumptions: Overview
Issue Details (click to expand)WARNING
SUGGESTION
Files Reviewed (2 files)
Fix these issues in Kilo Cloud Previous review (commit 6e184c9)Status: No Issues Found | Recommendation: Merge Executive SummaryThe incremental change since 9a17f63 touches only Assumptions: Files Reviewed (1 file)
Previous review (commit 9a17f63)Status: No Issues Found | Recommendation: Merge Executive SummaryThe incremental change adds a generation/auth-epoch re-check between the organization key and Personal marker writes, closing the sign-out race the prior review raised; no new issues were found on the changed lines. Assumptions: Files Reviewed (1 file)
Previous review (commit 1db1bba)Status: 1 Issue Found | Recommendation: Address before merge Executive SummaryThe queue serializes selections correctly, but its generation/epoch fence runs only before the two-key pair, so a sign-out that lands between the writes can let the Personal marker be re-created after the sign-out cleanup. Assumptions: Overview
Issue Details (click to expand)SUGGESTION
Files Reviewed (2 files)
Fix these issues in Kilo Cloud Previous review (commit efd6523)Status: No Issues Found | Recommendation: Merge Executive SummaryThe incremental change routes the voice-input catalogue/upload scope and the tool-summary translation scope through Assumptions: Files Reviewed (4 files)
Previous review (commit ec76606)Status: 1 Issue Found | Recommendation: Address before merge Executive SummaryThe single-value selection contract is not applied to two remaining scope readers, so an explicit Personal choice is sent to the gateway as an organization id and breaks dictation and tool-summary translation. Assumptions: Overview
Issue Details (click to expand)CRITICAL
Files Reviewed (14 files)
Reviewed by deepseek-flash-latest · Input: 67K · Output: 15.5K · Cached: 481.8K Review guidance: REVIEW.md from base branch |
…elper The voice-input catalogue read and the tool-summary translation resolve their organization scope through the same helper every other reader uses, so each request runs in the scope selected in the app.
|
bot: Scope of the on-device run, for the record. The Android run above exercised the selection path end to end: the picker, saving a choice, and the choice surviving a relaunch, for both an organization and the Personal scope. It did not complete a gateway round trip in either direction. The local ai-gateway in this environment answers
Mobile vitest on this head: 1252 files, 18595 passed, 2 skipped. Typecheck and lint are clean. |
iscekic
left a comment
There was a problem hiding this comment.
Request changes: ordered saves are the fix and should stay, so the last selection always wins. Keep the existing two-key stored format and the separate Personal marker instead of migrating every reader to a new stored value.
Saves of the mobile organization selection now share one queue slot per account, so a later choice is written after an earlier one and the organization key and Personal marker go out as a single pair. The stored format is unchanged. The regression test parks every storage call and shows the second selection is written after the first pair.
Keep each organization selection save ordered and verify the active selection before each account metadata write. The saved keys retain their existing format.
The ordered selection save checks the current generation and auth epoch before each storage write. Organization selection remains in its established key-and-marker format.
|
bot: Follow-up retains the established organization key and Personal marker. Selection saves share one ordered queue and check the active generation and auth epoch before each metadata write. Android verification: signed in with a local test account, selected Local Team Two, force-stopped and relaunched the app, and confirmed the Home header still showed Local Team Two after Metro loaded the current bundle. The regression test uses deferred storage writes to verify ordered completion. |
Allow each platform build request to run independently instead of sharing a native-hash concurrency group. The existing artifact check still reuses a published build. Update the workflow assertion for the expanded job condition.
…lection-single-value # Conflicts: # .github/workflows/mobile-native-build.yml
The heavy jobs check for an already published artifact right before they build, and concurrent runs of one nativeHash may build at once. The gate script header, the check's comment, and its test now say that instead of describing a job-level concurrency group that no longer exists.
|
bot: Android emulator against the local dev stack with an owned test account.
The app served the branch bundle from Metro on this VM for the run. |
|
bot: Android emulator against the local dev stack, seeded non-production account with two organization memberships.
The device store held exactly one selection entry after each step (checked through |
|
Changes requested: remove the out-of-scope CI changes.
|
The organization selection fix does not need a workflow change.
|
bot: Removed the workflow and gate changes. The pull request now changes only |
|
bot: Android emulator against the local dev stack, seeded non-production account with two organization memberships.
The device store held exactly one selection entry after each step (checked through |
A selection save now carries its own order, so a restore that runs for the same account while a save is pending leaves that save to finish and reads the pair it wrote. Saves stay ordered among themselves and stay fenced by the auth epoch.
|
bot: Android emulator (
|




























Evidence
Evidence: demonstrated — on the Android emulator against the local dev stack, a seeded non-production account with two organization memberships switched account scopes repeatedly, the device held exactly one selection entry, the Home header showed the last choice, and the same held through force-stop plus relaunch for both an organization and the Personal scope.
Run at head
015dcd608, with Metro on this VM serving the branch bundle:3000, Metro8081). Emulatoromp36at its default 1080x2400 / 420 dpi.shared_prefs/SecureStore.xmlheld only the organization entry.Store assertions read
shared_prefs/SecureStore.xmlthroughrun-asand compare the selection key names; Expo SecureStore encrypts the values, so the assertion is which of the two entries is present, together with the header before and after relaunch. Screenshots are attached in a comment below.Tests
pnpm --filter kilo-app exec vitest run→ 1314 files, 19283 tests passed, 2 skipped.src/lib/organization-context.test.tscovers two cases with storage calls the test holds open: a Personal choice saved while the token rotates, and two selections queued while the token rotates. Both assert the stored pair and the published selection.Change
Organization selection keeps its established organization-key and Personal-marker format, which the other readers of that key already consume.
Selection saves are ordered and fenced. They run one at a time, check the auth epoch before each of the two metadata writes, and only the newest selection is written, so the stored pair always names the selection the provider publishes. A restore loads the pair after the selection save the queue already holds has settled, and keeps its generation and auth-epoch publication fence.
The proxy recommended reading the pair literally inside the queue; the restore instead awaits the settle signal of the save on that queue and then reads, which keeps the same ordering.
The branch changes only
apps/mobile/src/lib/organization-context.tsxand its test.Production prerequisites
None.
Proxy answers
The owner's proxy gave these answers in the owner's place.
Answer: Collapse into one stored value.
Confidence: 0.60 · Precedent: Prefer clean cutovers, update affected consumers, and address behavior across affected surfaces.
Answer: Read both keys inside the queue.
Confidence: 0.80 · Precedent: Apply the fix across affected behavior.
Answer: Android emulator; selection survives relaunch.
Confidence: 0.85 · Precedent: Require end-to-end proof on the default Android VM lane.
Answer: Do not block readiness on a pending or canceled iOS native build; note the cancellation, retry once after the shared slot frees, and fix the scheduling cause.
Confidence: 0.70 · Precedent: Pending native checks should not block progress; address the underlying cause.
Answer: Use a unique concurrency group per run.
Confidence: 0.60 · Precedent: Prefer the smallest quality-preserving change; independent requests can occasionally duplicate build work instead of introducing a durable coordinator.
Answer: Proceed with resolved remarks.
Confidence: 0.72 · Precedent: Ready when prior review remarks are addressed, there are no conflicts, and other required checks pass; pending native build work does not block progress.
Answer 1 and the owner's later review direction differ on the storage representation: the owner asked to keep the established representation, which this change does. Answer 2 asks for the restore reads to be ordered with the pending save; this change orders them by awaiting that save's settle signal rather than by holding the queue slot.