Skip to main content
← Back to list
01Issue
FeatureOpenSwamp Club
AssigneesNone

Add progress indicator for long-running model methods

Opened by swampadmin · 3/3/2026

Problem

When a model method iterates over many resources (e.g., 60 VMs), the CLI shows no output until the entire method completes. With sequential execution at ~6s per item, this means waiting several minutes with no feedback. Even with batched concurrency (PR #29), methods that touch dozens of resources still take 30-60s with zero visibility.

Proposed Solution

Add a progress indicator that surfaces method execution progress in real-time. Two complementary approaches:

  1. Stream context.logger output during execution — model methods already log per-item progress (e.g., "checking VM 15/60"), but these logs are only shown after the method completes in --json mode. Streaming them to stderr in real-time would give immediate feedback.

  2. Built-in progress API — provide a context.progress(current, total, message?) method that models can call to report progress. The CLI would render this as a progress bar or counter (e.g., [15/60] Checking VMs...).

Alternatives Considered

  • Models could write partial results incrementally, but writeResource is per-item and the CLI still waits for the method to return.
  • Users can watch swamp data list in another terminal, but this is awkward.

Implementation Notes

  • Streaming logs to stderr would be a quick win and backward-compatible
  • The progress API would need a new method on the execution context
  • Both should work in --json mode (stderr for progress, stdout for final JSON)
02Bog Flow
OPENTRIAGEDIN PROGRESSSHIPPED

Open

3/3/2026, 5:48:32 PM

No activity in this phase yet.

03Sludge Pulse

Sign in to post a ripple.