Skip to content

feat(mobile): agent interaction prerequisites (presence, inline suggestions, blocking interaction)#4570

Merged
iscekic merged 3 commits into
mainfrom
feature/mobile-agent-interaction-prerequisites
Jul 16, 2026
Merged

feat(mobile): agent interaction prerequisites (presence, inline suggestions, blocking interaction)#4570
iscekic merged 3 commits into
mainfrom
feature/mobile-agent-interaction-prerequisites

Conversation

@iscekic

@iscekic iscekic commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Summary

Prerequisite mobile release reimplementing in-spirit useful parts of closed PR #4545 on latest main, on top of already-merged PR #4445 (which shipped remote CLI slash commands but left REMOTE_SESSION_ATTENTION_PUSH_ENABLED disabled).

  • Exact-session presence: useCliSessionPresence holds /presence/cli-session/{kiloSessionId} only after the route's session data has verifiably loaded and matches, and only while the route is focused and the app is foregrounded.
  • Inline remote-CLI suggestions: a dedicated SuggestToolCard renders interactive accept/dismiss controls only at the exact matching pending/running suggest tool call (callId === callID), with a synchronous same-frame action lock, per-action loading state, fixed safe retry copy, and automatic reset on request replacement (via key={requestId}).
  • Deterministic blocking-interaction precedence: getBlockingInteraction gives a pending question priority over a pending permission.
  • Composer-state preservation: the composer stays mounted (hidden via accessibility-safe View wrapper + disabled) during a blocking interaction, so draft text, attachments, and voice-input abort semantics are preserved instead of being unmounted.

No push notifications are enabled by this change; REMOTE_SESSION_ATTENTION_PUSH_ENABLED is untouched.

Changes

  • apps/mobile/src/components/agents/agent-interaction-policy.ts (+test) — pure question/permission precedence.
  • apps/mobile/src/components/kilo-chat/hooks/use-cli-session-presence.ts (+test) — canonical CLI-session presence subscription and loaded-session resolver.
  • apps/mobile/src/components/agents/suggestion-card-state.ts (+test), suggestion-card.tsx, suggest-tool-card.tsx — inline suggestion presentation, matching, and action-lock state.
  • apps/mobile/src/components/agents/tool-part-renderer.tsx — routes suggest tool parts to SuggestToolCard.
  • apps/mobile/src/components/agents/session-detail-content.tsx — integrates blocking-interaction policy, presence, and the hidden-not-unmounted composer wrapper.

Verification

  • pnpm test (apps/mobile): 121 files / 783 tests passed (14 new tests across 3 new test files; baseline was 118/769).
  • pnpm typecheck, pnpm lint, pnpm check:unused, pnpm format:check: all clean.
  • Fresh independent code review: 11/11 explicit review points PASS with file:line evidence (presence gating/teardown, composer never unmounted, voice-input abort wiring, suggestion/tool-call matching, action-lock semantics, no raw error leakage, no Cloud Agent suggestion capability added, accessibility, no push enablement, question-before-permission, no backend/lockfile/dependency changes).
  • Device E2E (iOS simulator, local dev stack, real authenticated remote kilo CLI session against this worktree's local backend):
    • Confirmed via live event-service logs that opening the CLI session's detail screen subscribes to the exact /presence/cli-session/{kiloSessionId} context, and navigating away unsubscribes.
    • Confirmed no regressions: session list, session detail rendering, and the existing read-only banner all continue to work correctly with the integrated diff.
    • Live triggering of the suggest tool card and question/permission blocking states was not deterministically reproducible in this run (requires CLI-side scenario/config outside this project's scope — the local CLI auto-approves permissions and does not emit suggest tool calls from ordinary prompts). These states are covered by the 14 new automated unit/state tests plus the reviewer's explicit sign-off on lock/matching/error-copy semantics.

Non-goals confirmed unchanged

  • REMOTE_SESSION_ATTENTION_PUSH_ENABLED and push enablement
  • Notification contracts, outboxes, retries, migrations
  • /presence/cli-session/* naming
  • Cloud Agent suggestion filtering/transport capability
  • Dependencies / pnpm-lock.yaml

@iscekic iscekic self-assigned this Jul 15, 2026
@kilo-code-bot

kilo-code-bot Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Executive Summary

Reviewed the mobile agent-interaction prerequisites (blocking-interaction precedence, composer preservation, CLI-session presence, and inline suggestion cards) across all 10 changed files with high confidence and found no security, correctness, or breaking-change issues in the changed code.

Files Reviewed (10 files)
  • apps/mobile/src/components/agents/agent-interaction-policy.ts
  • apps/mobile/src/components/agents/agent-interaction-policy.test.ts
  • apps/mobile/src/components/agents/session-detail-content.tsx
  • apps/mobile/src/components/kilo-chat/hooks/use-cli-session-presence.ts
  • apps/mobile/src/components/kilo-chat/hooks/use-cli-session-presence.test.ts
  • apps/mobile/src/components/agents/suggest-tool-card.tsx
  • apps/mobile/src/components/agents/suggestion-card-state.ts
  • apps/mobile/src/components/agents/suggestion-card-state.test.ts
  • apps/mobile/src/components/agents/suggestion-card.tsx
  • apps/mobile/src/components/agents/tool-part-renderer.tsx

Reviewed by claude-sonnet-5 · Input: 28 · Output: 12.7K · Cached: 717.3K

Review guidance: REVIEW.md from base branch main

@iscekic iscekic merged commit a2621a0 into main Jul 16, 2026
19 checks passed
@iscekic iscekic deleted the feature/mobile-agent-interaction-prerequisites branch July 16, 2026 12:31
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