feat: adopt parallel-web 0.6.0 monitor + non-beta task group#100
Merged
NormallyGaussian merged 1 commit intomainfrom May 8, 2026
Merged
feat: adopt parallel-web 0.6.0 monitor + non-beta task group#100NormallyGaussian merged 1 commit intomainfrom
NormallyGaussian merged 1 commit intomainfrom
Conversation
Upgrades the SDK floor from 0.4.2 (lagged) to 0.6.0 to take advantage of
two changes that ship in that release:
- Task Groups graduated out of beta. Replaces client.beta.task_group.*
calls with client.task_group.* in core/batch.py, integrations/spark/
streaming.py, and the test fixtures, and switches the typed input from
BetaRunInputParam to RunInputParam.
- Monitor moved from a hand-rolled httpx client against /v1alpha to the
SDK's client.monitor resource against /v1. The wrappers in
core/monitor.py now thin-wrap the SDK and return dict payloads via
model_dump(mode="json") so the CLI and existing callers continue to
work. Surface changes mirror the SDK:
- cadence (hourly/daily/...) -> frequency ("1h", "1d", "2w"; aliases
preserved via MONITOR_FREQUENCY_PRESETS)
- delete_monitor -> cancel_monitor (cancellation is irreversible)
- simulate_monitor_event -> trigger_monitor (real one-off run)
- get_monitor_event_group folded into list_monitor_events with
event_group_id filter
- new fields: type (event_stream/snapshot), task_run_id (snapshot),
processor (lite/base), include_backfill
- events listing is cursor-paginated with include_completions / limit
CLI subcommands updated accordingly: monitor cancel/trigger replace
delete/simulate; monitor event-group is removed; --frequency replaces
--cadence; new --type, --task-run-id, --processor, --include-backfill,
--cursor, --status, --event-group-id flags.
Note that query / task_run_id are immutable in the new update endpoint,
so monitor update --query is no longer offered (create a new monitor
to change the tracked target).
README and npm/README snippets refreshed; tests/test_monitor.py
rewritten against the SDK-mocked client; tests/test_enrichment.py mocks
moved off client.beta.task_group.
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
>=0.4.2(which lagged behind reality —uv.lockwas already on 0.5.1) to>=0.6.0to take advantage of two new SDK changes: the Monitor API graduating from a hand-rolled/v1alphashim to a first-classclient.monitorresource, and Task Groups graduating out of beta intoclient.task_group.core/monitor.pyfrom direct httpx calls to thin wrappers overclient.monitor.*while keeping the public function names so callers don't break. The SDK shape changes ripple out:cadence→frequency,delete→cancel,simulate_event→trigger,lookback_period→ cursor pagination, newtype/task_run_id/processor/include_backfillfor event_stream vs. snapshot monitors. CLI subcommands updated to match.client.beta.task_group.*withclient.task_group.*incore/batch.py,integrations/spark/streaming.py, and the enrichment test mocks. Switches the typed input fromBetaRunInputParamto the canonicalRunInputParam.Breaking changes for
parallel-cli monitorusersmonitor delete <id>→monitor cancel <id>(cancellation is irreversible — no actual deletion in the new API)monitor simulate <id>→monitor trigger <id>(now a real one-off execution, not just a webhook ping)monitor event-group <id> <group>removed → usemonitor events <id> --event-group-id <group>--cadence daily→--frequency 1d(aliases likedaily/hourlystill accepted)monitor update --queryremoved: query and task_run_id are immutable in the new SDK; create a new monitor to change themmonitor events --lookback 10d→--cursor/--limit/--include-completions(the API moved to cursor-based pagination)Test plan
uv run pytest tests/— 651 passeduv run ty check parallel_web_tools— all checks passeduv run ruff check parallel_web_tools tests— all checks passedmonitor list --limit 5 --json— returns paginated monitors withnext_cursormonitor list --limit 3— table renders with type/query/frequency/status columnsmonitor create "test query" --frequency 1d --metadata '{"test":"sdk-0.6.0"}' --json— createdmonitor_a01adb52eb1a44c79d5c6ee554ae73d4monitor get <id>— pretty-prints type, frequency, query, processor, last_runmonitor update <id> --frequency 6h— verifiedfrequencyfield updated to6hmonitor trigger <id>— succeeded, completion events appeared in events feedmonitor events <id> --include-completions --limit 5— both JSON and table renders workmonitor cancel <id>— verifiedstatusflips tocancelledmonitor create --type snapshot(no--task-run-id) — fails with helpful errormonitor create(no query) — fails with helpful errorenrich run --no-wait→enrich status→enrich pollcycle on a 2-row CSV — exercisesclient.task_group.create / add_runs / retrieve / get_runsand produced correct CEO results for Anthropic/Stripe.