Skip to content

feat(agents): managed agents — controllable LISA-run agents (backend, Phase 3)#108

Merged
oratis merged 1 commit into
mainfrom
feat/managed-agents-backend
Jun 18, 2026
Merged

feat(agents): managed agents — controllable LISA-run agents (backend, Phase 3)#108
oratis merged 1 commit into
mainfrom
feat/managed-agents-backend

Conversation

@oratis

@oratis oratis commented Jun 18, 2026

Copy link
Copy Markdown
Owner

What

The control unit of the agent plane (plan Phase 3, "send commands"). Unlike an externally-started CLI (observe + cancel only — different identity space, no channel), a managed agent is one LISA runs by looping runAgent, so it has a stable id, streams live progress, takes follow-up commands, pauses on every mutating tool for approve/deny, and cancels cleanly.

Per the chosen policy: full tools, but each mutating action blocks on the user's decision.

How

  • src/agents/managed.tsManagedAgent + ManagedRegistry:
    • loops runAgent (continue-from-history = follow-up); a follow-up queue (send), AbortSignal (cancel), and an approval callback that auto-allows safe tools but blocks each mutating one (isMutatingCall) until decide(allow).
    • live activity (turnCount / tools / files / tokens / lastText) derived from the agent onEvent stream.
    • full tools except dispatch_agent/signal_agent (no control-of-control / recursion).
  • integrations/managed/observer.ts + registry + hub default managed: {enabled:true} — managed agents appear in the roster (island / GUI / menu bar) over the existing agent_session_update stream, with pendingPermission surfaced.
  • serverPOST /api/agents/managed/start {task,cwd?,model?} and /:id/{send,cancel,approve}, behind the auth gate like every endpoint.

Verification

  • 705 tests pass (+5): pause→approve→continue + activity recorded; deny doesn't run the tool; follow-up continues the agent; cancel→done; unknown-id→false (scripted-provider, deterministic).
  • npm run typecheck + npm run build clean; managed registered + default-on verified at runtime.

Next

Phase 3b — UI: a "delegate a task" start form + per-managed-row send box + Approve/Deny buttons (the user-facing control surface; the backend + roster display land here).

🤖 Generated with Claude Code

… Phase 3)

The control unit of the agent plane: unlike an externally-started CLI (observe +
cancel only — different identity space, no channel), a managed agent is one LISA
runs by looping runAgent, so it has a stable id, streams live progress, takes
follow-up commands, pauses on every mutating tool for approve/deny, and cancels
cleanly. This is the robust "send commands to a running agent."

- src/agents/managed.ts — ManagedAgent + ManagedRegistry. Loops runAgent
  (continue-from-history = follow-up); a follow-up queue (send), AbortSignal
  (cancel), and an approval callback that auto-allows safe tools but BLOCKS each
  mutating one (isMutatingCall) on a UI decide(allow). Live activity
  (turnCount/tools/files/tokens/lastText) derived from the agent onEvent stream.
  Full tools EXCEPT dispatch/signal (no control-of-control).
- src/integrations/managed/observer.ts + registry + hub default `managed:
  {enabled:true}` — managed agents appear in the roster (island/GUI/menu bar)
  via the existing agent_session_update stream, with pendingPermission surfaced.
- server: POST /api/agents/managed/start {task,cwd?,model?} and
  /:id/{send,cancel,approve} — behind the auth gate like every endpoint.

705 tests pass (+5: pause→approve→continue + activity, deny doesn't run the
tool, follow-up continues, cancel→done, unknown-id→false). typecheck + build
clean; managed registered + default-on verified.

Next: Phase 3b UI (start form + per-row send box + Approve/Deny buttons).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@oratis oratis merged commit cb84a87 into main Jun 18, 2026
1 check passed
@oratis oratis deleted the feat/managed-agents-backend branch June 18, 2026 09:33
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