Markella Skempri
04/14/2026, 8:28 AMMarvin
04/14/2026, 8:28 AMMarvin
04/14/2026, 8:36 AMprefect-shell-0.3.x): Prefect tags
If you can confirm the page you’re looking at, I’ll post a concise, per-version summary (0.3.1 → 0.3.5) with direct links to the exact release notes/changelogs in my next reply.Markella Skempri
04/14/2026, 8:52 AMMarkella Skempri
04/14/2026, 8:56 AMMarvin
04/14/2026, 8:56 AMMarvin
04/14/2026, 8:58 AMMarkella Skempri
04/14/2026, 9:04 AMMarvin
04/14/2026, 9:04 AMMarvin
04/14/2026, 9:06 AMstream_output=True.
- Tag: prefect-shell-0.3.4
- 0.3.5: Fix to preserve streamed logs in the Prefect API. This mainly affects what shows up in the UI/API; terminal output should be unchanged unless you rely on API round‑tripped logs for local display.
- Tag: prefect-shell-0.3.5
- 0.3.2: Internal migration to async_dispatch changed execution paths for sync/async under the hood. The default behavior still streams when stream_output=True, but timing/ordering could feel slightly different in mixed async/sync contexts.
- Tag: prefect-shell-0.3.2
Unlikely to affect console output
- 0.3.3: Dependency floor bump only.
- Tag: prefect-shell-0.3.3
- 0.3.1: No known change specifically targeting shell log streaming.
- Tag: prefect-shell-0.3.1
Quick checks
- Ensure stream_output=True (default remains True):
- Confirmed by the current API: ShellOperation(..., stream_output: bool = True, ...)
- Verify Prefect logging level/handlers. By default, Prefect prints logs to the console when you run flows locally.
- If you upgraded and now see delayed output, 0.3.4 should improve real‑time streaming for sync commands.
Minimal example to confirm streaming locally
from prefect import flow
from prefect_shell import shell_run_command
@flow
def demo():
shell_run_command("for i in 1 2 3; do echo $i; sleep 1; done", stream_output=True)
if __name__ == "__main__":
demo()
If you’re seeing unexpected behavior, let me know:
- Your prefect-shell version
- Where you’re running (local vs worker, and which worker)
- Whether the issue is “no logs at all” or “logs appear only at the end” or “logs missing in the UI but present locally”Markella Skempri
04/14/2026, 9:16 AMMarkella Skempri
04/14/2026, 9:16 AMMarvin
04/14/2026, 9:16 AMMarvin
04/14/2026, 9:19 AMfrom prefect import flow, get_run_logger
from prefect_shell import ShellOperation
def log_chunks(logger, text, size=8000):
for i in range(0, len(text), size):
<http://logger.info|logger.info>(text[i:i+size])
@flow
def run_and_log():
logger = get_run_logger()
op = ShellOperation(commands=["your-long-command"], stream_output=False)
lines = op.run() # returns list[str]
output = "\n".join(lines)
log_chunks(logger, output)
if __name__ == "__main__":
run_and_log()
- This ensures the UI receives many smaller log records, which are less likely to be dropped/truncated.
Quick confirmations
- Keep stream_output=True for normal usage (it’s the default), unless you’re applying the “log chunks” workaround above.
- Verify logs are being sent to the API in your runtime environment (Cloud vs self-hosted), and whether you can see the full logs locally (stdout) but not in the UI — that’s a strong signal it’s the API/logging pipeline, not the shell process itself.
If you can share:
- Your exact versions (prefect, prefect-shell), worker type (process/docker/k8s), and whether you’re on Cloud or a self-hosted server
- Whether you see the full output locally but not in the UI
…I can recommend the safest pin (upgrade path vs. specific downgrade) for your setup.Markella Skempri
04/14/2026, 9:37 AMMarvin
04/14/2026, 9:37 AMMarvin
04/14/2026, 9:43 AMprefect.blocks.system.{JSON,String,DateTime} → migrate to Variables.
- Removed Runner utilities (e.g., submit_to_runner, wait_for_submitted_runs) and deprecated server helpers.
- Some deployment control helpers removed/renamed (pause/resume via API/CLI instead).
- Link: PR #19307, 3.5.0 notes
- CLI framework change under the hood: Typer → Cyclopts (3.6.20+)
- End-user CLI commands/flags remain the same.
- If you’ve built custom CLI plugins that import/use Typer internals from Prefect, you’ll need to migrate to Cyclopts.
- Links: PR #20821, PR #20838
Other behavior/compatibility changes to be aware of
- Legacy settings/internal imports fully removed (3.6.0)
- Code importing private settings modules or legacy settings paths will break. Use documented PREFECT_* env vars and public settings APIs.
- Link: PR #19353
- Background task system updated (3.6.0)
- Server background tasks switched to a more robust mechanism (with optional Redis backing). Mostly transparent, but custom server extensions relying on FastAPI BackgroundTasks may require adjustment.
- Link: PR #19377
- Logging pipeline improvements in 3.6.x (affects very long logs)
- Newer 3.6.x releases improved max-log-size handling and API propagation. If you rely on extremely long single log records, expect truncation at cloud limits (25k chars) and consider chunking. This is typically beneficial but can change observed behavior compared to 3.4.x.
- Notes: see 3.6 release notes stream 3.6.x notes
- Integration compatibility floors raised
- Many integration packages (e.g., prefect-shell >=0.3.3) started requiring Prefect >=3.6.17. If you upgrade integrations while staying on 3.4.x, you’ll hit resolver conflicts or subtle behavior differences.
- Example PR: PR #20659
What typically doesn’t change for most 3.4 → 3.6 upgrades
- Core Flow/Task APIs remain stable.
- Deployments, workers, and pools keep the same user-facing commands and configuration shapes (beyond internal CLI framework change).
- Prefect Cloud account/org/workspace behavior is unaffected.
Suggested upgrade path and checks
- Environment
- Ensure Python 3.10+ before upgrading Prefect.
- If you’ve pinned integrations (prefect-aws, prefect-kubernetes, prefect-shell, etc.), verify their Prefect version requirements first.
- Codebase scans
- Remove system blocks usage:
- Replace prefect.blocks.system.* with prefect.variables.Variable.
- Remove runner APIs:
- Replace any imports from prefect.runner or references like submit_to_runner.
- Check for ad-hoc settings imports:
- Replace private settings imports with env vars (PREFECT_*) or public config accessors.
- If you have custom CLI plugins:
- Replace Typer usage that depends on Prefect’s CLI internals with Cyclopts-compatible code (or shell out to prefect).
- Logging for very long outputs
- Prefer line-by-line logging (or chunk large strings to <25k chars) for Cloud.
- If you use prefect-shell for long-running commands, use recent versions (0.3.4/0.3.5) with Prefect 3.6.x to get reliable incremental streaming to the UI.Marvin
04/14/2026, 9:43 AMMarkella Skempri
04/15/2026, 9:58 AMMarvin
04/15/2026, 9:59 AMMarvin
04/15/2026, 10:01 AMwait_for_completion): prefect-shell-0.3.4
- 0.3.5 (preserve streamed logs in Prefect API): prefect-shell-0.3.5
- Curated notes when available: prefect-shell release notes
So, if you were on prefect-shell 0.3.1 (row-by-row) and then noticed grouped output, that change in behavior lines up with 0.3.2. If you need row-by-row on the sync path, 0.3.4+ restores it (and 0.3.5 ensures those streamed lines reach the UI).Markella Skempri
04/15/2026, 10:04 AMMarvin
04/15/2026, 10:04 AMMarvin
04/15/2026, 10:04 AMfrom prefect import flow, get_run_logger
from prefect_shell import ShellOperation
def log_chunks(logger, text, size=8000):
for i in range(0, len(text), size):
<http://logger.info|logger.info>(text[i:i+size])
@flow
def run_and_log():
logger = get_run_logger()
op = ShellOperation(commands=["your-long-command"], stream_output=False) # capture but don't stream
lines = op.run() # list[str]
output = "\n".join(lines)
log_chunks(logger, output)
if __name__ == "__main__":
run_and_log()
- Quick checks that help diagnose:
- Ensure stream_output=True if you want native streaming.
- Confirm logs are being sent to the API in your runtime (look for “Sending logs to API” on worker start or ensure PREFECT_LOGGING_TO_API=true).
- Verify log level is INFO (e.g., PREFECT_LOGGING_LEVEL=INFO).
- Check worker stdout vs. UI: if you see the full stream locally but not in the UI, it’s the API/logging pipeline issue above.
If you can share your worker type (process/docker/k8s), whether you’re on Cloud vs. self‑hosted, and whether the full output appears locally but not in the UI, I can suggest the safest pin/upgrade path for your exact setup.