feat(mobile): pick a remote instance when creating an agent session#4618
feat(mobile): pick a remote instance when creating an agent session#4618iscekic wants to merge 10 commits into
Conversation
…-suite parallel load
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Executive SummaryThe incremental change since the last review fixes both previously-flagged issues (a stale-selection race in the remote-spawn dispatch tail and an unreachable Files Reviewed (3 files)
Previous Review Summaries (2 snapshots, latest commit c750b86)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit c750b86)Status: No Issues Found | Recommendation: Merge Executive SummaryThe incremental change since the last review is a whitespace-only reformat of Files Reviewed (1 file)
Previous review (commit 0d2717a)Status: 2 Issues Found | Recommendation: Address before merge Executive SummaryA stale-selection race in the remote-spawn retry path ( Overview
Issue Details (click to expand)WARNING
SUGGESTION
Files Reviewed (43 files)
Reviewed by claude-sonnet-5 · Input: 34 · Output: 4.4K · Cached: 981K Review guidance: REVIEW.md from base branch |
Summary
Adds a "Run on" instance picker to the new-agent screen so a user can start a session on a connected
kilo remoteCLI instance instead of only the managed Cloud Agent.instancefield and per-sessionplatform; a live-WebSocket-scangetConnectedInstances()DO RPC (deliberately not backed by stored/cached state, so it survives hibernation);GET /api/instances/active;activeSessions.listInstancestRPC procedure (throws on upstream failure, unlikelist, which swallows into an empty array).CommandDeliveredErrorseam in the cloud-agent SDK so callers can distinguish "the relay delivered an error response" from "the command never got a response at all" (transport failure);createRemoteSessionOnConnectionhelper.instance-picker.tsx(happy/empty/error/loading states, refetch-on-focus + poll, dedup suffixes for same-name/project instances), a "Run on" selector on the new-agent screen with a reduced composer for remote targets (model/mode/repo/attachments hidden, single "Start session" CTA), a pure outcome classifier mapping the spawn result to ready/retryable/non-retryable UX, and a?spawned=1bounded NOT_FOUND retry on the session-detail route to bridge the async ingest-row window. Live sessions are now labeled by their actualplatforminstead of a hardcoded "CLOUD AGENT".Non-goals (v1)
/newUX).Verification
apps/mobile:pnpm format:check && pnpm typecheck && pnpm lint && pnpm check:unused && pnpm testall green (155 files / 1070 tests).services/session-ingest: vitest + typecheck + lint green.apps/web: typecheck + lint + touched-scope jest (cloud-agent-sdk,active-sessions-router) green; full jest suite (664 suites) also run clean.XDG_DATA_HOME, local session-ingest/nextjs URLs): empty state, happy path (tmux-mode spawn with a real streamed reply), sibling spawns from both/new-in-session and a second picker-initiated spawn, detached (non-tmux) mode, and the retryable-disconnect-then-recover flow were all verified live on an iOS simulator. Two real bugs found during E2E and fixed in this PR:active-sessions-router.test.ts'sbeforeAllneeded real timeout headroom under full-suite parallel load (unrelated flake, fixed alongside arequire()→ dynamic-import()lint fix in the same file).main(zero file overlap with the 9 commits it had moved by; no conflicts).Linked PR
kilocode CLI-side companion PR: Kilo-Org/kilocode#12327