feat(agents): pocket-control CLI + dispatch list + iOS companion plan#113
Merged
Conversation
- lisa agents pty <agent> <task>: adopt-at-launch — spawn the real claude/codex under the running server's PTY so the session is born controllable (roster / island / phone). --resume <id> bridges to #111's resume-adopt (continue an IDLE session; the server 409s a live one). - GET /api/agents/pty/<id>/stream: live PTY output SSE (snapshot + chunks; ends when the agent finishes) — drives the local attach mirror. - GET /api/dispatch/list: structured view of LISA's fire-and-forget dispatches (complements /api/agent/signal's prose list); never leaks the raw log path. - docs/IOS_COMPANION_PLAN.md: full iOS companion design — Dispatch telemetry + control, connectivity (Tailscale-first), QR pairing, push, and controlling non-LISA sessions (adopt-at-launch + resume-adopt; live sessions are untappable). Verification: typecheck + build clean; 728 tests / 727 pass / 1 skip / 0 fail. Live PTY spawn needs node-pty, which fails under local Node 26 (CI = Node 24) — logic is unit-tested via an injected fake pty. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This was referenced Jun 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Two things, both driven by a new iOS companion design.
Design —
docs/IOS_COMPANION_PLAN.md: a full plan for an iOS app that turns the phone into a remote telemetry + control terminal for Dispatch (see/command Claude Code · Codex · OpenCode · Aider), plus the other pillars (chat, mood, Reve recap, Sense consent). Covers connectivity (Tailscale-first), QR pairing, push (operational + opt-in, not proactive outreach), Live Activity / Dynamic Island, and — the hard part — controlling sessions LISA didn't start: a live external session is untappable (the Claude desktop app owns itsstream-jsonpipe), so the real answer is adopt-at-launch + resume-adopt of idle sessions (claude --resume, guarded against live ones).Code — three backend increments the plan leans on, all behind the existing loopback-or-token auth gate:
lisa agents pty <agent> <task>— adopt-at-launch: a thin client to the runninglisa serve --webthat spawns the real CLI under the server's PTY, so the session is borncontrollable:"pty"(in the roster, steerable from island/GUI/phone), mirrors output here (SSE), and forwards each typed line.--resume <id>bridges to the resume-adopt path (continue an idle session; the server409s a live one).GET /api/agents/pty/<id>/stream— live PTY output SSE (snapshotthenchunks; ends when the agent finishes).GET /api/dispatch/list— structured view of the dispatch ledger (complements/api/agent/signal's proselist); reduceslogPathto a boolean so the raw path never leaks.Notes
PtyRegistryvia a newoutputevent (each ANSI-stripped chunk).lisa agents ptyis line-oriented in v1 — good for task-style runs, not full arrow-key TUIs; raw attach is a follow-up.claude --resume(Phase 6) #111); control UI keys offAgentSession.controllable/resumable.Verification
npm run typecheck+npm run buildclean.node-ptyround-trip)./api/dispatch/listand/api/agents/sessionsagainst a running server (the latter shows externally-startedclaude-codesessions as observe-only — nocontrollable— confirming the honesty distinction).node-ptythrowsposix_spawnp failedunder Node v26 (CI uses Node 24). The logic is unit-tested with an injected fake pty.Follow-ups
Backend — finish the control story
remoteAdoptExternal/remoteControlgating (/api/control/policy): remote (phone) callers must not adopt/control external sessions without a Mac-side opt-in + per-action confirm. (security gap — do first)lisa agents pty(keystroke passthrough + resize) so it can drive full TUIs.GET /api/dispatch/status?id=— gated log-tail readback (structured list exists; raw stdout is separate + gated).iOS app (the companion itself)
LisaClient, SSE parser, models incl.controllable/resumable)./api/pair/start,/api/devices[/revoke])./api/push/register) + Mac-side push-bridge + trigger matrix (done/error/permission/idle) + E2E payload (minimal relay default; self-host ntfy option).controllable/resumable: managed approve/deny/send/cancel; pty send/output/cancel;resumable→ "adopt" button.Polish / cross-cutting
/chatis full-tool).🤖 Generated with Claude Code