Skip to content

Add dune execution list and cancel for query Activity - #82

Merged
mewwts merged 1 commit into
mainfrom
execution-list-cancel
Nov 26, 2026
Merged

mewwts merged 1 commit into
mainfrom
execution-list-cancel

Conversation

@mewwts

@mewwts mewwts commented Nov 26, 2026 •

Copy link
Copy Markdown
Member

Adds dune execution list and dune execution cancel. They match the Dune MCP's query Activity tools, listTeamExecutions and cancelTeamExecution, from core#8334. That PR is merged and is in prod since core-node release node-1.0.1023.

Impact map

Area Change Calls
execution list [--status active|finished] new listTeamExecutions
execution cancel <execution-id> [--yes] new cancelTeamExecution
execution help, README updated

Review notes

  • No REST endpoint exists for Activity, so the commands go through the MCP, like query alert. The tools are in the MCP's activity toolset. The CLI's MCP client names no toolsets, so it gets them with no change.
  • Permissions are the MCP's, the same as Monitor → Activity: every team member sees the team's runs. Admins can stop any run, and other members only the runs they started. The tools need a team API key.
  • execution list defaults to --status active. The text table shows state, query (name, ID or ad-hoc SQL), who started it (handle or API key name), source, engine, slot use and whether you can cancel, plus the total count and the plan's slot limit. --status finished shows outcome, duration and end time. -o json prints the tool result as it is.
  • execution cancel asks on stderr before it calls the tool, because a shared run also stops for every user on it. Any answer other than y or yes cancels nothing. In a shell where nobody can answer, the command refuses unless --yes is given. It fails when the tool reports cancelled: false.
  • The tools return no SQL text, no query results and no keys.

Testing

  • 9 new tests in cmd/execution/activity_test.go use the fake MCP server: both statuses, an unknown status, JSON pass-through, and cancel with yes, no, no terminal, --yes, and cancelled: false.
  • go test ./... and go vet ./... pass.
  • make lint could not run in my orb: golangci-lint v1.64.8 cannot read the orb's newer Go toolchain, and it fails the same way on main.
  • Not yet run against prod.

No visual surface: CLI only.

execution list calls listTeamExecutions and execution cancel calls
cancelTeamExecution, from core#8334. cancel asks before it stops a run,
because the run also stops for anyone who shares it; --yes skips the
question.

Amp-Thread-ID: https://ampcode.com/threads/T-01a21358-0fae-720b-9830-e8b42af43a85
Co-authored-by: Amp <amp@ampcode.com>
@mewwts
mewwts merged commit bbe135f into main Nov 26, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants