Skip to content

feat(mobile): offer a computer's CLI agents in the agent picker - #7756

Merged
iscekic merged 3 commits into
mainfrom
igor/mobile-remote-instance-agents
Oct 16, 2026
Merged

iscekic merged 3 commits into
mainfrom
igor/mobile-remote-instance-agents

Conversation

@iscekic

@iscekic iscekic commented Oct 16, 2026

Copy link
Copy Markdown
Collaborator

Refs Kilo-Org/kilocode#15133. CLI side: Kilo-Org/kilocode#15159.

What

  • Relay: list_agents joins the viewer-command allowlist. An old CLI's unknown command: list_agents maps to CLI_UPGRADE_REQUIRED, like list_directories. It is not in the catalog dedupe set, because two requests for different folders on one connection are both valid.
  • SDK: listAgents(connection, target) sends list_agents either to a connection (with an optional launch-folder directory) or to a session, and classifies the result like the other CLI catalog helpers.
  • Mobile:
    • New session on a computer: the agent picker shows the built-in modes, the profile's agents, and the agents the CLI loads for the selected launch folder (including project agents from .kilo/agents). If the user switches the target away from that computer, an agent only that CLI offered falls back to code.
    • Open remote session: the picker merges the profile's agents with the agents the CLI reports for the session's directory.

Why

The picker for a remote computer only knew the built-in modes and the cloud profile's agents, so project-local agents that kilo agent list shows never appeared.

Compatibility

  • An old CLI, an old relay, or an invalid body gives no CLI agents, and the picker stays as it is today.
  • The response schema strips unknown agent fields, so a later CLI can add optional fields without hiding the list from this app version.
  • Agents a CLI reports carry no model pin here. The remote model picker keeps its current behavior.

@iscekic iscekic self-assigned this Oct 16, 2026
@kilo-code-bot

kilo-code-bot Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Executive Summary

The follow-up re-validates an inherited custom mode against a computer's known agent lists, so a slug the target no longer offers falls back to code; the changed code introduces no new issues and the previously reported finding is resolved.

Files Reviewed (4 files)
  • apps/mobile/src/components/agents/new-session-screen-body.tsx
  • apps/mobile/src/components/agents/use-effective-profile-custom-modes.ts
  • apps/mobile/src/lib/hooks/use-cli-agents.ts
  • apps/mobile/src/lib/hooks/use-cli-agents.mounted.test.tsx

Resolved at d47c6c8: the effect at new-session-screen-body.tsx:306 now falls back to code for any custom mode a computer's settled profile + list_agents answer does not offer (covering a mode inherited through prefillMode), while Cloud keeps only the CLI-picked check; use-effective-profile-custom-modes.ts now exposes a settled flag; and use-cli-agents.ts only reports settled for a real (ok) list, so an old CLI never clears an inherited slug.

Previous Review Summaries (2 snapshots, latest commit 7ab9471)

Current summary above is authoritative. Previous snapshots are kept for context only.

Previous review (commit 7ab9471)

Status: 1 Issue Found | Recommendation: Address before merge

Executive Summary

The follow-up fixes the four previously reported issues, but the new reset mechanism tracks only picker-driven mode selections, so an inherited CLI-only agent is still forwarded to a target that does not offer it.

Overview

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

SUGGESTION

File Line Issue
apps/mobile/src/components/agents/new-session-screen-body.tsx 289 cliPickedModeRef is only set by handleModeChange, so a CLI-only mode inherited from prefillMode (Continue from a remote session running a .kilo/agents project agent) is never re-validated on a target or launch-folder change and is forwarded as input.agent.
Files Reviewed (5 files)
  • apps/mobile/src/components/agents/new-session-screen-body.tsx - 1 issue
  • apps/mobile/src/components/agents/session-detail-content.tsx - 0 issues
  • apps/mobile/src/lib/hooks/use-cli-agents.mounted.test.tsx - 0 issues
  • apps/mobile/src/lib/hooks/use-cli-agents.ts - 0 issues
  • packages/cloud-agent-sdk/src/list-agents.ts - 0 issues

Previously reported issues verified fixed at 7ab9471: the success parse in list-agents.ts is now guarded; the target/folder reset no longer fires on a no-op re-selection; a launch-folder change re-keys the CLI query and re-evaluates the settled answer; and the hook's new settled flag is exercised by the added transport case.

Fix these issues in Kilo Cloud

Previous review (commit 893d7e2)

Status: 4 Issues Found | Recommendation: Address before merge

The remote agent picker's new CLI agent source scopes its list to the selected computer and launch folder, but the selected mode is only re-validated on a target switch, so a no-op re-selection or a folder change can leave a stale CLI agent selected and forwarded to the remote create call. The SDK helper also drops its sibling helpers' defensive parse guard.

Overview

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

WARNING

File Line Issue
apps/mobile/src/components/agents/new-session-screen-body.tsx 624 Re-selecting the current computer resets a CLI-only agent to code; the picker calls onSelect even for the already-checked row.
apps/mobile/src/components/agents/new-session-screen-body.tsx 277 A launch-folder change does not re-evaluate the selected mode, so a project agent from the previous folder stays selected and is forwarded as input.agent.

SUGGESTION

File Line Issue
packages/cloud-agent-sdk/src/list-agents.ts 96 The success safeParse is not wrapped in try/catch, so the file's never throws contract and the list-directories/instance-model-catalog pattern are not honored.
apps/mobile/src/lib/hooks/use-cli-agents.mounted.test.tsx 63 The unsupported assertion only observes the loading default; the transport rejection path (the reason list_agents was added to the CLI command union) is untested.
Files Reviewed (12 files)
  • packages/cloud-agent-sdk/src/list-agents.ts - 1 issue
  • packages/cloud-agent-sdk/src/list-agents.test.ts - 0 issues
  • packages/cloud-agent-sdk/src/schemas.ts - 0 issues
  • packages/cloud-agent-sdk/package.json - 0 issues
  • apps/mobile/src/lib/hooks/use-cli-agents.ts - 0 issues
  • apps/mobile/src/lib/hooks/use-cli-agents.mounted.test.tsx - 1 issue
  • apps/mobile/src/lib/hooks/cli-command-unavailable-error.ts - 0 issues
  • apps/mobile/src/components/agents/new-session-screen-body.tsx - 2 issues
  • apps/mobile/src/components/agents/session-detail-content.tsx - 0 issues
  • apps/mobile/src/components/agents/mode-normalize.ts - 0 issues
  • services/session-ingest/src/dos/UserConnectionDO.ts - 0 issues
  • services/session-ingest/src/dos/UserConnectionDO.test.ts - 0 issues

Fix these issues in Kilo Cloud


Reviewed by deepseek-v4.1-flash · Input: 75.1K · Output: 16.6K · Cached: 447.7K

Review guidance: REVIEW.md from base branch main

@iscekic

iscekic commented Oct 16, 2026

Copy link
Copy Markdown
Collaborator Author

bot: Native E2E on an iOS simulator (cached dev client accepted by KILO_REMOTE_NATIVE=required, live Metro bundle from this branch) against a local stack (nextjs, session-ingest) and the CLI from Kilo-Org/kilocode#15159 running kilo remote in a fixture repo with .kilo/agents/swift-vibecoder.md (mode: primary) and .kilo/agents/swift-test-writer.md (mode: subagent).

Wire check first (SDK listAgents over a real /api/user/web connection): both the launch folder and directory: 'ios' returned the built-in agents plus swift-vibecoder ("Builds Swift apps"). swift-test-writer was not in either result.

Scenario Result
a. Run on = CLI computer, mode picker swift-vibecoder listed with its description. swift-test-writer absent. Built-in modes still listed.
b. Folder = ios, picker reopened swift-vibecoder still listed
c. Start a session as swift-vibecoder in ios The CLI created the session in <fixture>/ios and streamed with agent=swift-vibecoder mode=primary. No inference ran: the local gateway refused because the fake account has no credits.
d. Open remote session, mode picker swift-vibecoder listed and checked
e. Run on switched back to Cloud Agent Mode fell back to Code

a. Launch folder
a

b. ios folder
b

c. Before start
c-form

c. Session opened
c-session

d. Picker in the remote session
d

e. Back to Cloud Agent
e

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