feat(mcp): stream loop progress to the customer via a progress snapshot - #5798
Conversation
Implements JSONbored#4800: a customer can watch their rented loop's progress in near-real time instead of polling for a final result. Adds the deterministic brain of the stream (part of the Rent-a-Loop path JSONbored#4778), so a customer surface (JSONbored#4807) pushes on change rather than on a fixed interval. - new packages/loopover-engine/src/loop-progress.ts (pure): buildProgressSnapshot(state) formats a running loop's already-computed state into phase, status, iteration + percent-complete (through the iteration budget, capped, null when unknown), and a bounded recent-activity tail. progressChanged( prev, next) decides when a snapshot has meaningfully changed on the displayed axes -- so the surface streams ON CHANGE, not on a fixed interval. No IO, no transport. - new loopover_build_progress_snapshot MCP tool (src/mcp/server.ts); src/loop-progress.ts is a thin re-export shim over the engine module. - tests cover percent-complete (known/unknown/zero budget, over-budget cap), the activity-tail cap, the done transition, and every progressChanged axis (first snapshot, phase/status/iteration/activity change, and no-change), at the engine level and end-to-end through the MCP tool. Closes JSONbored#4800
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5798 +/- ##
=======================================
Coverage 95.10% 95.11%
=======================================
Files 584 585 +1
Lines 46440 46455 +15
Branches 14849 14854 +5
=======================================
+ Hits 44169 44184 +15
Misses 1515 1515
Partials 756 756
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
Tip 🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩 ✅ LoopOver review result - approve/merge recommendedReview updated: 2026-07-14 17:38:07 UTC
✅ Suggested Action - Approve/Merge
Review summary Nits — 5 non-blocking
Linked issue satisfactionPartially addressed Review context
Contributor next steps
Signal definitions
[BETA] Chat with GittensoryAsk Gittensory a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.
Full command reference: https://gittensory.aethereal.dev/docs/gittensory-commands 🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by LoopOver, a quiet PR intelligence layer for OSS maintainers.
|
Summary
Implements #4800 — a customer can watch their rented loop's progress in near-real time instead of polling for a final result. Adds the deterministic brain of the stream (part of the Rent-a-Loop path #4778), so a customer surface (#4807) pushes on change rather than on a fixed interval.
packages/loopover-engine/src/loop-progress.ts(pure):buildProgressSnapshot(state)formats a running loop's already-computed state intophase,status,iteration+percentComplete(through the iteration budget — capped at 100, null when the budget is unknown), and a bounded recent-activity tail.progressChanged(prev, next)decides when a snapshot has meaningfully changed on the displayed axes — so the surface streams on change, not on a fixed interval (the exact acceptance criterion). No IO, no transport.loopover_build_progress_snapshotMCP tool (src/mcp/server.ts);src/loop-progress.tsis a thin re-export shim over the engine module.Acceptance (#4800): a test loop's progress is visible and updating without the client polling on a fixed interval — the
progressChangedpush-on-change model provides exactly that, tested at the engine level and end-to-end through the MCP tool.Closes #4800
Scope
feat(mcp): …).CONTRIBUTING.md; nosite//CNAME/VitePress.Closes #4800.Validation
git diff --checknpm run typecheckclean;npm --workspace @loopover/engine run build+npm run build:mcpcleannpm run test:coverageon the changed code:loop-progress.ts100% lines & branches (14/14); the newsrc/mcp/server.tshandler + schema + registration fully covered (all 43 changed lines, both branch sides — diff-verified).mcp-output-schemas"outputSchema on EVERY tool" + "schema-valid structured content").donetransition, and everyprogressChangedaxis (first snapshot, phase/status/iteration/activity change, no-change).If any required check was skipped, explain why:
test:cinot run end-to-end locally (Linux-only shell/self-host steps on Windows); the change-relevant gates above were validated directly.Safety