Skip to content

fix(web): show connecting state on launching agent during Auto Run launch - #7

Closed
chr1syy wants to merge 1 commit into
feat/web-autorun-worktreefrom
fix/web-followup-status
Closed

fix(web): show connecting state on launching agent during Auto Run launch#7
chr1syy wants to merge 1 commit into
feat/web-autorun-worktreefrom
fix/web-followup-status

Conversation

@chr1syy

@chr1syy chr1syy commented May 8, 2026

Copy link
Copy Markdown
Owner

Summary

Follow-up to RunMaestro#946 addressing Gap 1 from the post-review notes (https://gist.github.com/chr1syy/67630166ff5217a97d7b1fad91201f3b).

On web/mobile, the launching agent's status indicator stayed green throughout an Auto Run launch (worktree-toggle or otherwise), leaving users without visual confirmation that the launch actually fired. Desktop already flips the indicator to busy/connecting during the spawn.

  • Switch `launchAutoRun` to use `sendRequest`, returning `Promise` so callers can await `configure_auto_run_result` (worktree forwarding from feat(web): add Run-in-Worktree toggle to mobile AutoRun launch RunMaestro/Maestro#946 is preserved).
  • In `mobile/App.tsx`, optimistically flip the launching session's `state` to `connecting` (pulsing orange `StatusDot`) before sending; revert to the captured pre-launch state if the server reports failure. Subsequent `session_state_change` broadcasts overwrite the optimistic value when the agent actually transitions to busy.
  • Expose `setLocalSessionState` on the public `useSessions` return so other consumers can drive the same optimistic-update pattern.

Test plan

  • `npx tsc -p tsconfig.lint.json` clean for touched files (pre-existing repo errors are environmental and unrelated)
  • ESLint clean on touched src files
  • Prettier clean on all touched files
  • `useAutoRun.test.ts` — 10 cases (worktree forwarding + Promise success / server-error / rejection / missing-success-field; loadGitBranches and listWorktrees retained)
  • `useSessions.test.ts` — 77 cases including 3 new for `setLocalSessionState` (optimistic update, server-broadcast overwrite, unknown-id no-op)
  • `messageHandlers.test.ts` — 105 cases pass (server-side `configure_auto_run` flow unchanged)
  • Manual: launch an Auto Run on mobile/web with the worktree toggle off — indicator briefly turns pulsing orange, then yellow as the agent processes
  • Manual: launch with worktree toggle on — same behavior; indicator transitions through connecting → busy as the worktree spawns and dispatches

🤖 Generated with Claude Code

…unch

Gap 1 follow-up: on web/mobile, the launching agent's status indicator
stayed green throughout an Auto Run launch, leaving users without any
visual confirmation. Switch launchAutoRun to use sendRequest so the
caller can await the configure_auto_run_result, optimistically flip the
session to 'connecting' (pulsing orange) before sending, and revert if
the server reports failure. Subsequent session_state_change broadcasts
overwrite the optimistic value as the agent transitions to busy.

Also exposes setLocalSessionState on useSessions so other consumers can
drive the same optimistic-update pattern.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@chr1syy

chr1syy commented May 8, 2026

Copy link
Copy Markdown
Owner Author

Reopening on upstream RunMaestro/Maestro so it's visible alongside PR RunMaestro#946.

@chr1syy chr1syy closed this May 8, 2026
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.

1 participant