Skip to content

feat(dev): deep-link E2E navigation, dev session injection, GitHub account seed - #5386

Merged
iscekic merged 3 commits into
mainfrom
e2e-dev-helpers
Aug 19, 2026
Merged

feat(dev): deep-link E2E navigation, dev session injection, GitHub account seed#5386
iscekic merged 3 commits into
mainfrom
e2e-dev-helpers

Conversation

@iscekic

@iscekic iscekic commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

What

Two dev-only helpers that cut E2E wall time in the delivery workflow, plus the routes they need.

  • pnpm dev:mobile:open --email <seeded> <route> — mints a device session for a seeded user and opens the app on a named route (home, sessions, session --session-id, settings, profile, or a raw path), signed in, on a booted simulator/emulator. No args prints the route list.
  • pnpm dev:seed app:github-account [email] --json — reuses a live donor GitHub authorization, verifies connected: true via the same query as githubApps.getUserAuthorization, and prints userId/email/connected/revoked/githubLogin. Failure lines distinguish no-donor / donor-revoked / verification-failed.

Why

Workflow session data: E2E verifier rounds average 22 min (p90 52) and burn steps tap-navigating and re-doing email-code login every round; 5+ runs ended BLOCKED on a missing or revoked GitHub test integration.

Review first

  • apps/mobile/src/lib/dev-session-inject.ts — the __DEV__ gate is the first line of the parser; production paths call takeDevSessionFromUrl but it no-ops outside dev builds.
  • packages/worker-utils/src/kilo-token.ts — production schema gains optional deviceSessionId (additive, backwards compatible) so the minted pair matches issueSessionCredentials.
  • New universal-link routes are production surface: /home, /profile/preferences, /cloud/sessions/* → agent-chat by id (AASA updated).

Checks

  • typecheck: app-shared, kilo-app, worker-utils — pass. oxlint on changed source — pass.
  • app-shared tests 332 pass; mobile deep-link/inject suites 42 pass; dev CLI + seed lib 7 pass; kilo-token 14 pass.
  • Web Jest for AASA not run locally (worktree has no Postgres for test:db); CI covers it.

Human steps

  • Connect GitHub once in the local web app so app:github-account has a live donor (unique index on (github_user_id, github_app_type) blocks copying onto a second user).
  • dev:mobile:open needs a booted device and a seeded user.

…n detail

E2E drives navigation by deep link instead of taps. Adds /home,
/profile/preferences, and /cloud/sessions/* (agent-chat by id).
dev_session_* params sign the dev build in without the email-code flow.
Parser no-ops outside __DEV__. kiloTokenPayload gains an optional
deviceSessionId so minted pairs match issueSessionCredentials.
…seed

open: mints a device session for a seeded user and opens the app on a
named route, signed in. seed: reuses a live donor GitHub authorization
and verifies connected via the product query; --json output.
@iscekic iscekic self-assigned this Aug 19, 2026
@iscekic
iscekic merged commit f579e58 into main Aug 19, 2026
50 checks passed
@iscekic
iscekic deleted the e2e-dev-helpers branch August 19, 2026 22:54
Comment thread dev/local/mobile-open.ts
home: process.env.HOME ?? '',
path: process.env.PATH ?? '',
});
const args = ['shell', 'am', 'start', '-a', 'android.intent.action.VIEW', '-d', url];

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WARNING: Android adb shell will split the deep-link URL on &, so session injection never completes

adb shell concatenates the remaining args and runs them through the device shell. The minted URL always contains & (dev_session_token=…&dev_session_refresh=…&dev_session_expires_in=…), so the shell treats those as job separators. Only dev_session_token reaches am start; parseDevSessionQuery then rejects the incomplete query and signIn is skipped. Quote the -d URI (for example pass a single 'am start … -d "' + url + '"' string to adb shell) so the full credential query survives.


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

Comment thread dev/local/mobile-open.ts

const isMain =
process.argv[1] && path.resolve(process.argv[1]) === path.resolve(import.meta.filename);
if (isMain) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WARNING: Successful dev:mobile:open never closes the seed pg.Pool, so the CLI hangs

getSeedDb() creates a pg.Pool with allowExitOnIdle left at the default false. The seed runner exists specifically to closeSeedDb() in finally for this reason. This entry path only process.exit(1) on failure, so after minting the session and opening the app the Node process stays alive on the open pool. That breaks using this as an E2E step. Close the pool in a finally (or process.exit(0) after a successful open).


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

@kilo-code-bot

kilo-code-bot Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: 2 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 2
SUGGESTION 0
Issue Details (click to expand)

WARNING

File Line Issue
dev/local/mobile-open.ts 127 Android adb shell splits the deep-link URL on &, so session injection never completes
dev/local/mobile-open.ts 171 Successful dev:mobile:open never closes the seed pg.Pool, so the CLI hangs
Files Reviewed (20 files)
  • apps/mobile/src/components/app-root-providers.tsx
  • apps/mobile/src/components/dev-session-injector.tsx
  • apps/mobile/src/lib/deep-link-handler.test.ts
  • apps/mobile/src/lib/deep-link-handler.ts
  • apps/mobile/src/lib/deep-link-launch.test.ts
  • apps/mobile/src/lib/deep-link-launch.ts
  • apps/mobile/src/lib/dev-session-inject.test.ts
  • apps/mobile/src/lib/dev-session-inject.ts
  • apps/mobile/src/lib/universal-link-paths.js
  • apps/web/public/.well-known/apple-app-site-association
  • dev/local/mobile-open-routes.ts
  • dev/local/mobile-open.test.ts
  • dev/local/mobile-open.ts - 2 issues
  • dev/seed/app/github-account.ts
  • dev/seed/lib/github-account.test.ts
  • dev/seed/lib/github-account.ts
  • package.json
  • packages/app-shared/src/universal-links/routes.test.ts
  • packages/app-shared/src/universal-links/routes.ts
  • packages/worker-utils/src/kilo-token.ts

Fix these issues in Kilo Cloud


Reviewed by grok-4.6 · Input: 234.2K · Output: 32.8K · Cached: 883.8K

Review guidance: REVIEW.md from base branch main

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants