Files
opencode-mobile/.tasks/10/plan.md
Den 32f7af4e11 fix(sessions): recover home-scoped list after fresh connect
* fix(sessions): use active connection client directly, remove roots filter

Root cause A: loadSessions was calling clientForDirectory(serverHome) which
scoped the session list to /home/azureuser — a different project than the
server's active CWD. Sessions in the current project (e.g. opencode-mobile)
were never returned.

Root cause B: roots:true filtered out sessions that have a parentID (sub-task /
AUTO-REVIEW sessions), hiding valid sessions from the list.

Fix: use connState.client directly (the connection's active directory) and drop
the roots filter so all sessions for that project are visible.

Also adds a verify_session_list CUA smoke scenario that navigates back to the
sessions tab after creating a session and asserts the list is non-empty —
covering the regression path that was previously untested.

* fix(sessions): fetch serverHome in addConnection so loadSessions shows correct sessions

Root cause: addConnection() built the HTTP client but never fetched serverHome
(only loadConnections and setActiveConnection did). When the user adds a new
connection (fresh install / first sign-in), serverHome = null, so loadSessions
fell through to connState.client (the server's CWD). On this dev server the CWD
is the deploy directory — 11 old May-19 sessions that are not the user's recent
work sessions.

Fix: addConnection now fetches currentProject + serverHome via the same
Promise.all as setActiveConnection, before calling set(). This ensures
loadSessions immediately uses clientForDirectory(serverHome) → the global
project → the user's actual recent parent sessions.

Also adds --opencode-url flag to the CUA smoke script, which appends a
connect_and_verify_sessions scenario that reproduces the regression:
  python scripts/android-cua-smoke.py --opencode-url http://100.108.64.76:4096

* fix(sessions): recover home scope after fresh connect

Resolve stale deploy-only session list by recovering server home during first load and keeping regression coverage in default Android CUA smoke and CI.

* chore(release): bump version to 0.4.0
2026-05-26 19:50:17 -07:00

34 lines
2.0 KiB
Markdown

## Approach Summary
Verify existing regression fix on real emulator and real server, then align code/tests/CI with validated behavior. Ship smallest safe diff that satisfies connect-then-sessions success metric and keeps coverage durable.
## Tradeoff: Speed vs Quality
- chosen: balanced
- rationale: bug already has partial fix and open PR context; need fast closure with strong real-feature verification and review loop.
## Tasks
| # | Title | Files | Depends on | Parallel group | Suggested model |
|---|-------|-------|------------|----------------|-----------------|
| 1 | Validate runtime behavior on emulator | .tasks/10/test-plan.md, .tasks/10/test-report.md | - | A | sonnet |
| 2 | Reconcile sessions/client logic to match verified behavior | src/stores/connections.ts, src/stores/sessions.ts | 1 | B | gpt-5.1-codex |
| 3 | Ensure UI trigger path remains deterministic | app/(tabs)/index.tsx | 2 | C | sonnet |
| 4 | Update smoke script/CI coverage if gap remains | scripts/android-cua-smoke.py, .github/workflows/cua-smoke.yml | 1 | B | gpt-5.1-codex |
| 5 | Owner integration pass, docs artifacts, and commit prep | .tasks/10/* | 2,3,4 | D | haiku |
## Parallel Groups
- **A**: task 1 (runtime verification baseline)
- **B** (after A): tasks 2 and 4 in parallel (independent files)
- **C** (after B): task 3
- **D** (after C): task 5
## Done Criteria
- Task 1: report includes explicit pass/fail for connect-then-sessions with screenshots or logs.
- Task 2: store logic reflects validated client-selection behavior; no TypeScript errors.
- Task 3: sessions tab reliably triggers loading after connect/focus without duplicate side effects.
- Task 4: smoke path covers regression in CI/local scenario form; script parses and executes.
- Task 5: artifacts updated (`review.md`, `test-report.md`, `STATE.md`, `worklog.md`) and branch ready for PR.
## Rollback Plan
- Revert ownership commits on feature branch (`git revert <sha>`).
- Keep issue open with failed evidence attached.
- Restore previous merged behavior by cherry-picking last known good commit if needed.