Add opt-in stakwork_run_step tool — execute one workflow step with literal inputs - #1477
Merged
Conversation
…iteral inputs Double-gated: requires the Stakwork API key AND a truthy toolsConfig.stakwork_run_step. Launches a run via the new POST /workflow_steps/run Stakwork endpoint, polls status, and returns the step's full IO; a timed-out call returns in_progress with the project_id so a follow-up call resumes waiting instead of launching a duplicate run. The WORKFLOW_SYSTEM prompt guidance for the tool is gated behind the same flag, so non-opted-in callers see no mention of step execution. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
What
An execute counterpart to the read-only Stakwork run-research tools:
stakwork_run_stepruns ONE workflow step with LLM-supplied literal inputs and returns its output.Double-gated. The tool registers only when the caller supplies the Stakwork API key AND passes a truthy
toolsConfig.stakwork_run_step(standardtoolConfigEnabledsemantics:true, non-empty string, or object withoutenabled: false). TheWORKFLOW_SYSTEMprompt guidance for it is gated behind the same flag, so non-opted-in callers see no mention of step execution. A string/object config value overrides the tool description via the existing override loop (stakwork_run_stepis registered as a properToolName).How it works
workflow_id + step_id(+ literalparams/attributesoverrides) →POST /workflow_steps/runon the Stakwork API (added in stakwork/senza-lnd#7948), which wraps the step in an ephemeral single-transition workflow and runs it as a normal project.GET /projects/:id/statusevery 5s (default 120s, capped 600s). On timeout returnsin_progresswith theproject_id; calling again with thatproject_idresumes waiting instead of launching a duplicate run.GET /projects/:id/steps/:step_id/io(inputs/outputs, truncated at the existing 12KB caps).Overrides are literal — they replace
[$(ancestor).output.x)]interpolations, so no ancestor steps or prior outputs are needed;{{SECRET}}aliases pass through and resolve server-side at execution. The tool description and prompt guidance both steer the agent to study a real run first viastakwork_run_stepsand to treat this as a deliberate, billable action.Dependency
404s until stakwork/senza-lnd#7948 deploys — the read-only tools are unaffected either way.
🤖 Generated with Claude Code