feat(loops): web UI for sequential agent loops (#1106)#1111
Merged
Conversation
Phase 2 of #740: adds a Loops tab on the Agent Detail page over the existing dev backend (routers/loops.py, loop_service.py) — no backend changes. - stores/loops.js: agent-scoped Pinia store on the shared api.js client (Invariant #7). Filters fleet-wide loop_run_completed/loop_completed WS events by the mounted agent, targeted-refreshes only the affected loop, and runs a 12s backstop poll while any loop is queued/running to recover a missed terminal event. - components/LoopsPanel.vue: Run-loop form (message template w/ {{run}} + {{previous_response}} helper, max_runs, stop_signal, delay, timeout, ModelSelector, allowed_tools), loop list with status/runs/stop_reason, expandable per-run table, last response via DOMPurify renderMarkdown, cooperative Stop control. - AgentDetail.vue: Loops tab between Schedules and Playbooks. - websocket.js: route loop events to the store in the type-keyed branch. - e2e/loops-panel.spec.js + architecture/feature-flow docs. Verified live: tab renders, form submits, loop row reaches terminal state via the live-update path, expanded detail renders the per-run table. Closes #1106 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Summary
devbackend (routers/loops.py,services/loop_service.py, MCPloops.ts). No backend changes.runs_completed/max_runs/stop_reason), Detail + live progress (per-run table, last response, WS-driven), Stop (cooperativestopping→stopped).Changes
src/frontend/src/stores/loops.js— agent-scoped Pinia store on the sharedapi.jsclient (Invariant security: Fix token logging and add HTML reports to gitignore #7). Filters fleet-wideloop_run_completed/loop_completedWS events by the mounted agent, targeted-refreshes only the affected loop, and runs a 12s backstop poll while any loop isqueued/runningto recover a missed terminal event.src/frontend/src/components/LoopsPanel.vue— Run-loop form (message template w/{{run}}+{{previous_response}}helper,max_runs,stop_signal,delay_seconds,timeout_per_run,ModelSelector,allowed_toolspicker), loop list, expandable per-run table, last response via DOMPurifyrenderMarkdown, Stop control.src/frontend/src/views/AgentDetail.vue— Loops tab between Schedules and Playbooks.src/frontend/src/utils/websocket.js— route loop events to the store in thedata.type-keyed branch.src/frontend/e2e/loops-panel.spec.js+architecture.md/run-agent-loop.mddocs.Test Plan
vite buildpasses (no errors)failedonly because the local Anthropic account had no credit balance — the loop machinery & UI handled it correctly.)@interactive— needs a live stack + running agent)uilabel)Design decisions (from
/autoplan)api.jsclient (Invariant security: Fix token logging and add HTML reports to gitignore #7 + the issue AC) rather than the raw-axios pattern some sibling stores drifted to — gains the 401→/login interceptor for free.Closes #1106
🤖 Generated with Claude Code