Skip to content

Add opt-in run_step param to workflow_explorer_agent for single-step execution - #4902

Merged
Evanfeenstra merged 2 commits into
masterfrom
explorer-run-step
Jul 23, 2026
Merged

Add opt-in run_step param to workflow_explorer_agent for single-step execution#4902
Evanfeenstra merged 2 commits into
masterfrom
explorer-run-step

Conversation

@Evanfeenstra

Copy link
Copy Markdown
Contributor

What

Lets the canvas agent's workflow_explorer_agent execute ONE Stakwork workflow step — but only when the user explicitly asks for it. Completes the chain built in stakwork/senza-lnd#7949–#7955 (the run_step_from_template endpoint) and stakwork/stakgraph#1478/#1479 (the swarm-side stakwork_run_step tool, gated on toolsConfig.stakwork_run_step).

How

  • workflowExplorerTools.ts — new optional run_step: boolean on the tool schema. When true, the call forwards toolsConfig: { stakwork_run_step: true } to the swarm agent, flipping its opt-in gate for that one dispatch. When absent, nothing is sent — omission is the swarm's off state, so ordinary research calls stay strictly read-only. Tool + prompt-param descriptions carry the consent rule ("set true ONLY when the user has explicitly asked to run/execute/test a workflow step — never for ordinary research; executions are real and billable").
  • prompt.ts (getWorkflowsCapabilitySnippet) — new "Running a step" section: when to set the flag (explicit user request only, never proactively — propose and wait otherwise), and how to phrase the execution prompt (self-contained: workflow + step id, user-supplied inputs or discover-then-fill with test values / mock_mode, one dispatch carrying the whole discover → fill → run → report loop). "Strictly read-only" caveats updated to "read-only by default".
  • capabilities.ts — menuBlurb mentions the on-request step execution. Deliberately NOT added to writeToolNames: readonly mode strips whole tools by name, which would also remove all research; the comment documents this trade-off.

Why per-call rather than session-level

A session- or capability-level toggle would let one approval bleed into later unrelated calls. A per-call boolean means each execution window is opened by exactly one user request and closes immediately after — layered on top of the existing gates (org-gated workflows capability, server-side Stakwork API key, swarm-side toolsConfig opt-in).

🤖 Generated with Claude Code

Evanfeenstra and others added 2 commits July 23, 2026 09:37
…execution

The explorer stays read-only by default. Passing run_step: true — which
the main agent is instructed to do ONLY when the user explicitly asks to
run/execute/test a workflow step — forwards toolsConfig.stakwork_run_step
to the swarm agent, unlocking the (billable) single-step execution tool
for that one call. Omission is the swarm's off state, so ordinary research
dispatches remain strictly read-only. Prompt guidance covers the consent
rule and how to phrase a self-contained discover → fill → run → report
execution prompt.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@Evanfeenstra
Evanfeenstra enabled auto-merge (squash) July 23, 2026 16:40
@Evanfeenstra
Evanfeenstra merged commit a18219f into master Jul 23, 2026
9 checks passed
@github-actions

Copy link
Copy Markdown

Test environment is now live.

View it at: https://hive-preview-3.sphinx.chat

Database expires at: Jul 23, 2026, 9:42 PM UTC

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.

1 participant