Skip to content

feat(active-sessions): normalize optional instance metadata - #5668

Merged
iscekic merged 3 commits into
mobile-ux-ad6d-s1from
mobile-ux-ad6d-s2
Sep 1, 2026
Merged

feat(active-sessions): normalize optional instance metadata#5668
iscekic merged 3 commits into
mobile-ux-ad6d-s1from
mobile-ux-ad6d-s2

Conversation

@iscekic

@iscekic iscekic commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

No new behavior — This change preserves connection details inside the service without changing screens or available actions.


Summary

connectedInstanceSchema now retains metadata in activeSessionsRouter.listInstances and the inferred ConnectedInstance type; invalid values fail response validation.
kind accepts cli or remote; nullable startedAt requires a 24-character datetime with three fractional-second digits; nullable gitBranch accepts at most 24 characters.
Omitted fields default to cli, null, and null; these compatibility defaults must remain until supported metadata-free producers and hibernated attachments retire.

Files
  • apps/web/src/routers/active-sessions-router.ts — Modified source, +5/-0 lines; adds the metadata fields, compatibility defaults, and the condition for removing those defaults.

Tests: 4 modified test and fixture files, +131/-13 lines: apps/extension/tests/e2e/agents-fixture.ts (+20/-7), apps/mobile/src/components/share/share-cli-spawn.test.ts (+7/-1), apps/mobile/src/components/share/share-gate-sheet.mounted.test.tsx (+12/-2), and apps/web/src/routers/active-sessions-router.test.ts (+92/-3).
Generated: 0 files changed.


Verification

Local end-to-end verification on an iOS simulator, 2026-09-01. Seven of nine checks passed. Two have partial coverage.

This section covers the stack's six PRs together: #5666, #5668, #5677, #5680, #5685, and #5686.

No product bug was found. No product source changed. The worktree stayed clean.

Check Result Note
A1. Cloud Agent first, then Remotes, then Terminals PASS Both group headers rendered, in that order.
A2. Each group has its own icon PASS Cloud Agent a cloud, Remotes a server, Terminals a terminal.
A3. Rows show the branch and start time, shortened and localized PASS See the shortening and locale evidence below.
A4. Matching identities each show their own short code PASS Two identical relays showed #77537b and #481fd3 on separate lines.
A5. Names and projects wrap instead of truncating PASS Verified at the largest native text size and with a long project name.
D2. The live badge survives a tab switch PASS The Agents tab kept its numeric badge on Home and Profile.
D3. The count clears when the last session exits PASS Agents showed "Nothing running right now" with no count or badge.
C. History rows show liveness PARTIAL The live dot and "JUST NOW" rendered. No nonzero session cost was established, so cost retention is unverified.
D1. Live counts are organization-scoped PARTIAL Personal scope verified. The test account exposed no organization selector, so scoped counting is untested.

Remotes and locale evidence

The installed CLI 7.5.6 reports no kind, so every real relay lands under Terminals and the Remotes group is unreachable through it. A stand-in producer therefore attached over the real CLI WebSocket contract (/api/user/cli, instanceSchema in services/session-ingest/src/types/user-connection-protocol.ts) and heartbeat an instance identity. Everything below the CLI process is the shipped path: the durable object, getConnectedInstances, activeSessions.listInstances, and the picker.

Two kind: 'remote' instances and one kind: 'cli' instance produced:

  • Grouping and order. Cloud Agent, then REMOTES with both remote rows, then TERMINALS with the terminal row.
  • Branch shortening. feature/remotes-verify1 is 23 code points and rendered as feature/remotes-veri…, exactly the documented 20-code-point boundary.
  • Missing facts stay absent. The instance with no startedAt rendered main alone, with no separator and no date.
  • Localized dates. English rendered Started Sep 1, 2026 at 7:51 AM. German rendered Gestartet 1. Sept. 2026, 07:51 — day-first, German month, 24-hour clock.
  • Localized group headings. REMOTES became REMOTE-INSTANZEN in German.
  • Accessible labels. Each row announced its group, identity, and facts together: Remotes, ci-runner-eu-west on cloud, and feature/remotes-veri… · Started Sep 1, 2026 at 7:51 AM.
  • Stable row identifiers. instance-picker-row-3c7b01, -fe6b0a, and -377bcd were byte-identical across both locales, so the identifier does not depend on displayed facts.
  • Selection. Tapping a Remotes row closed the sheet and set the control to Run on: ci-runner-eu-west · cloud.

Untested condition

The offline banner is driven only by NetInfo device connectivity. createOfflineBannerStore commits online as soon as NetInfo reports a connection and runs its HTTP probe only to suppress a false NetInfo offline report (apps/mobile/src/lib/offline-banner-state.ts:67-88). A backend-only outage with the device still online therefore shows no banner by design. A real device-wide outage was not simulated, so that path has no runtime verdict.

Setup

  • Real worktree stack (14 services) and Metro, branch mobile-ux-ad6d-s6, simulator iPhone 17 Pro on iOS 26.5.
  • Sign-in through the normal email-code screen, with the code read from the locally captured outbound email.
  • Taps and accessibility inspection through AXe. Screenshots captured with xcrun simctl io <udid> screenshot.
  • Full report and images: /Users/igor/Projects/.scratch/local-e2e-ux/.

Unrelated observation

After "Allow once" on a tool permission, repeated Back taps did not leave the chat screen; a cold restart restored navigation. Evidence: /Users/igor/Projects/.scratch/local-e2e-ux/C-back-stuck.png. None of these six PRs touch navigation, and the symptom was not reproduced in a second round. It needs a real CLI relay executing a command to reproduce, so it is recorded here rather than diagnosed.

@kilo-code-bot

kilo-code-bot Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (5 files)
  • apps/web/src/routers/active-sessions-router.ts
  • apps/web/src/routers/active-sessions-router.test.ts
  • apps/extension/tests/e2e/agents-fixture.ts
  • apps/mobile/src/components/share/share-cli-spawn.test.ts
  • apps/mobile/src/components/share/share-gate-sheet.mounted.test.tsx

Reviewed by grok-4.6 · Input: 227.4K · Output: 12.5K · Cached: 651.6K

Review guidance: REVIEW.md from base branch mobile-ux-ad6d-s1

@iscekic
iscekic merged commit 0c26275 into main Sep 1, 2026
25 of 45 checks passed
@iscekic
iscekic deleted the mobile-ux-ad6d-s2 branch September 1, 2026 11:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

human-ready The PR is ready for human review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants