feat(agents): managed agents — controllable LISA-run agents (backend, Phase 3)#108
Merged
Conversation
… 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>
This was referenced Jun 18, 2026
Merged
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
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.ts—ManagedAgent+ManagedRegistry: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) untildecide(allow).onEventstream.dispatch_agent/signal_agent(no control-of-control / recursion).integrations/managed/observer.ts+ registry + hub defaultmanaged: {enabled:true}— managed agents appear in the roster (island / GUI / menu bar) over the existingagent_session_updatestream, withpendingPermissionsurfaced.POST /api/agents/managed/start {task,cwd?,model?}and/:id/{send,cancel,approve}, behind the auth gate like every endpoint.Verification
npm run typecheck+npm run buildclean;managedregistered + 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