You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(mobile): scope the tour's new session to the active organization - #8259
The first-sign-in tour's hand-off now carries the active organization into the
new-session route.
apps/mobile/src/components/tour/tour-screen.tsx read no organization and
built /(app)/agent-chat/new with at most preselectRunOn. The form derives
its whole scope from that route param (app/(app)/agent-chat/new.tsx to NewSessionScreenBody), so the tour path opened Personal: the personal listGitHubRepositories call answered integrationInstalled: false, the form
rendered the connect-GitHub prompt, the repository picker was empty, and Start
stayed disabled. Home avoids this by passing the organization in components/home/new-task-button.tsx.
The hand-off now appends organizationId from useOrganization() when one is
active, before preselectRunOn, using URLSearchParams. Personal passes no
param, which is the form's own default. The Tour screen comment states why the
scope travels in the route.
Mounted tests cover the org-scoped href for both cards, the Personal fallback,
and the replay path; the mocked context keeps the shell's contract separate
from the provider's restore path, which has its own suite.
Verification
pnpm --filter kilo-app exec vitest run src/components/tour/tour-screen.mounted.test.tsx - 11 passed.
pnpm --filter kilo-app run typecheck - clean.
pnpm --filter kilo-app run lint - 0 warnings, 0 errors.
oxfmt --list-different on the two files - no output.
Android end to end on this VM (dev stack, dev-client artifact, seeded fixture:
one organization with an org-owned GitHub integration and a cached repository
snapshot, zero-usage account):
Before the change, Profile - Tutorial replay - Cloud Agent opened the form at
personal scope: cloudAgentNext.listGitHubRepositories (personal) in the web
log, a "Connect GitHub" card in the repository section, Repository: Select repository, Start session disabled.
After the change, the same replay path calls organizations.cloudAgentNext.listGitHubRepositories in the web log; the
repository picker lists the organization repository under a GITHUB heading,
selecting it shows Repository: GitHub - drain-e2e-labs/notes, and Start session enables once the prompt is set.
Screenshots of the before/after form and the picker are in the PR comment
below.
Proxy answers
The owner's proxy gave these answers in the owner's place.
Question: Org readiness: The tour can hand off before the organization context finishes restoring (cold boot right after consent), in which case organizationId is still null. How should the hand-off behave? Answer: Pass the org when known, unchanged otherwise Confidence: 0.65 - Precedent: Put each separate concern in its own PR (debabfb38c82: "in a separate PR"). The fallback in agent-chat/new.tsx already belongs to open PR feat(mobile): show the active organization where sessions start #8083, so do the least work here (7f3470e0ba6f: "do the least amount of work possible, with no drop in quality").
Question: Stale prompt: The finding's observation also notes a prompt carried in from the previous draft. The new-session draft is stored per account (shared across personal and organization scopes by design) and the work item's expected behavior does not mention it. Include a change? Answer: Leave the draft behavior unchanged Confidence: 0.70 - Precedent: Keep each PR diff to files that the feature needs (df491946927a: "PR should be checked for stray changes before merging"). The shared per-account draft is deliberate behavior, not a defect.
Question: Test mocking: How should the mounted tour test supply the organization? Answer: Mock @/lib/organization-context in the mounted test Confidence: 0.75 - Precedent: Do the least work possible with no drop in quality (00eb2a1d3e4b: "skip work that doesn't need to be done"). The real restore path gets its proof from the Android emulator e2e run instead (55c9c80332a7: "logs and/or screenshots are mandatory proof").
bot: Android end-to-end captures from the local dev stack on the work VM, using an owned fake account whose organization has an org-owned GitHub integration fixture. Same replay path in every capture: Profile - Tutorial - Cloud Agent.
Before: the hand-off opened the form at personal scope. The repository section offers Connect GitHub and the footer reads "Connect a provider to start."
After: the repository picker lists the organization repository under a GITHUB heading, and the form shows the selected organization repository with Start session enabled once the prompt is set (the branch row reports it could not load branches because the fixture installation has no live GitHub credentials, which is expected in this environment).
The web log for the same tap shows organizations.cloudAgentNext.listGitHubRepositories after the change and cloudAgentNext.listGitHubRepositories (personal) before it.
The tour hand-off now appends the active organization id via URLSearchParams, matching Home's new-task route, and the mounted tests cover the org-scoped, Personal, and replay paths; no defects were found in the changed lines.
iscekic
added
merge:bot
Bot-owned review; merge when ready once readiness passes and a review approves.
merge:human
Substantive functional risk requires human review.
and removed
merge:bot
Bot-owned review; merge when ready once readiness passes and a review approves.
labels
Oct 20, 2026
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
drainWork item from the findings drainexplorer:androidFinding surfaced by the Android explorermerge:humanSubstantive functional risk requires human review.
2 participants
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.
What changed
The first-sign-in tour's hand-off now carries the active organization into the
new-session route.
apps/mobile/src/components/tour/tour-screen.tsxread no organization andbuilt
/(app)/agent-chat/newwith at mostpreselectRunOn. The form derivesits whole scope from that route param (
app/(app)/agent-chat/new.tsxtoNewSessionScreenBody), so the tour path opened Personal: the personallistGitHubRepositoriescall answeredintegrationInstalled: false, the formrendered the connect-GitHub prompt, the repository picker was empty, and Start
stayed disabled. Home avoids this by passing the organization in
components/home/new-task-button.tsx.The hand-off now appends
organizationIdfromuseOrganization()when one isactive, before
preselectRunOn, usingURLSearchParams. Personal passes noparam, which is the form's own default. The Tour screen comment states why the
scope travels in the route.
Mounted tests cover the org-scoped href for both cards, the Personal fallback,
and the replay path; the mocked context keeps the shell's contract separate
from the provider's restore path, which has its own suite.
Verification
pnpm --filter kilo-app exec vitest run src/components/tour/tour-screen.mounted.test.tsx- 11 passed.pnpm --filter kilo-app run typecheck- clean.pnpm --filter kilo-app run lint- 0 warnings, 0 errors.oxfmt --list-differenton the two files - no output.Android end to end on this VM (dev stack, dev-client artifact, seeded fixture:
one organization with an org-owned GitHub integration and a cached repository
snapshot, zero-usage account):
personal scope:
cloudAgentNext.listGitHubRepositories(personal) in the weblog, a "Connect GitHub" card in the repository section,
Repository: Select repository,Start sessiondisabled.organizations.cloudAgentNext.listGitHubRepositoriesin the web log; therepository picker lists the organization repository under a GITHUB heading,
selecting it shows
Repository: GitHub - drain-e2e-labs/notes, andStart sessionenables once the prompt is set.Screenshots of the before/after form and the picker are in the PR comment
below.
Proxy answers
The owner's proxy gave these answers in the owner's place.
Answer: Pass the org when known, unchanged otherwise
Confidence: 0.65 - Precedent: Put each separate concern in its own PR (debabfb38c82: "in a separate PR"). The fallback in agent-chat/new.tsx already belongs to open PR feat(mobile): show the active organization where sessions start #8083, so do the least work here (7f3470e0ba6f: "do the least amount of work possible, with no drop in quality").
Answer: Leave the draft behavior unchanged
Confidence: 0.70 - Precedent: Keep each PR diff to files that the feature needs (df491946927a: "PR should be checked for stray changes before merging"). The shared per-account draft is deliberate behavior, not a defect.
Answer: Mock @/lib/organization-context in the mounted test
Confidence: 0.75 - Precedent: Do the least work possible with no drop in quality (00eb2a1d3e4b: "skip work that doesn't need to be done"). The real restore path gets its proof from the Android emulator e2e run instead (55c9c80332a7: "logs and/or screenshots are mandatory proof").