feat: add fire + executions subgroup (parity with @cueapi/mcp 0.4.0)#23
Closed
mikemolinet wants to merge 1 commit intocueapi:mainfrom
Closed
feat: add fire + executions subgroup (parity with @cueapi/mcp 0.4.0)#23mikemolinet wants to merge 1 commit intocueapi:mainfrom
mikemolinet wants to merge 1 commit intocueapi:mainfrom
Conversation
Brings the CLI to parity with the @cueapi/mcp 0.3.0 + 0.4.0 surface for
the fire-cue and worker-execution-lifecycle operations.
New top-level command:
- cueapi fire <cue-id> [--payload-override JSON] [--merge-strategy merge|replace]
Wraps POST /v1/cues/{id}/fire. For ad-hoc one-shot triggers and for
using cues as a messaging channel between agents.
New executions subgroup with seven subcommands:
- executions list
- executions list-claimable [--task] [--agent] server-side SQL filter
- executions get <id>
- executions claim <id> --worker-id ID
- executions claim-next --worker-id ID [--task] internal fan-out when --task
- executions heartbeat <id> --worker-id ID X-Worker-Id header transport
- executions report-outcome <id> --success/--failure [--external-id ...]
Notes:
- list-claimable uses server-side query params for the task / agent filter,
not client-side. Client-side filter after fetch hits the LIMIT 50
starvation bug fixed in the 2026-04-25 prod incident (see app/routers/
executions.py:122-131 docstring in cueapi-core).
- claim-next with --task fans out via list-claimable + claim by ID since
the server's POST /v1/executions/claim endpoint does not accept a task
filter today. Tiny race window between list and claim is bounded by the
atomic claim returning 409, in which case the caller retries.
- heartbeat sends worker_id via the X-Worker-Id request header, not body.
--worker-id is required even though the server permits omission, so
misconfigured callers fail at the CLI instead of silently bypassing the
race-protection check.
Version: 0.1.5 -> 0.2.0. Aligned cueapi/__init__.py (had drifted to 0.1.3)
with pyproject.toml at the same time.
Tests: 36 pass (was 19, +17 new help-text + arg-parsing tests for the new
commands following the existing pattern).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Collaborator
Author
|
Superseded by upstream-branch PR (will be opened next). Fork-PR can't access staging secrets needed by integration tests. |
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
Brings cueapi-cli to parity with the @cueapi/mcp 0.3.0 + 0.4.0 surface for fire-cue and worker-execution-lifecycle operations. Replaces the curl invocations agent users have been falling back to for these operations.
What's added
One top-level command:
cueapi fire <cue-id> [--payload-override JSON] [--merge-strategy merge|replace]POST /v1/cues/{id}/fireOne new subgroup with seven commands:
cueapi executions listGET /v1/executionscueapi executions list-claimable [--task] [--agent]GET /v1/executions/claimable?task=&agent=cueapi executions get <id>GET /v1/executions/{id}cueapi executions claim <id> --worker-id IDPOST /v1/executions/{id}/claimcueapi executions claim-next --worker-id ID [--task]POST /v1/executions/claim(no task) OR list+claim chain (with task)--taskis set.cueapi executions heartbeat <id> --worker-id IDPOST /v1/executions/{id}/heartbeatwithX-Worker-Idheader--worker-idREQUIRED at the CLI even though server permits omission.cueapi executions report-outcome <id> --success/--failure [--external-id ...]POST /v1/executions/{id}/outcomeNotable design choices
list-claimablefilter is server-side, not client-side. Client-side filter after fetch hits the LIMIT 50 starvation bug that was fixed in the 2026-04-25 prod incident (see app/routers/executions.py:122-131 docstring in cueapi-core for the prior repro). Same call we made on @cueapi/mcp 0.4.0 PR chore: add CONTRIBUTING.md #11.claim-next --taskfans out via list-claimable + claim by ID because the server'sPOST /v1/executions/claimendpoint does not accept a task filter today. Tiny race window between list and claim is bounded by the atomic claim returning 409, in which case the caller retries.heartbeatsendsworker_idvia theX-Worker-Idrequest header, not body. That is the server's actual transport for the field (declaredHeader(None)atapp/routers/executions.py:317).--worker-idis required at the CLI even though the server permits omission, so misconfigured callers fail at the CLI instead of silently bypassing the race-protection check at the server.Tests
pytest tests/36 pass (was 19, +17 new). All new tests follow the existing CliRunner help-text + arg-parsing pattern. No live API calls.Version
0.1.5->0.2.0. Minor bump for additive new feature surface.Also aligned
cueapi/__init__.py(had drifted to 0.1.3) withpyproject.tomlwhile bumping; both now at 0.2.0.Out of scope
cueapi-action) to expose the new commands; that's a separate PR queued behind this one shipping to PyPI.Lineage
cueapi_fire_cue) and @cueapi/mcp 0.4.0 (the five execution-lifecycle tools) are the upstream pattern this PR mirrors.