feat: surface gate detail in the workflow run/resume --json payload#2965
Open
doquanghuy wants to merge 1 commit into
Open
feat: surface gate detail in the workflow run/resume --json payload#2965doquanghuy wants to merge 1 commit into
doquanghuy wants to merge 1 commit into
Conversation
A paused run was indistinguishable from any other pause in the machine-readable outcome, and the gate's prompt/options/choice never left the human-facing stream. Record each step's type in the run state's step results (one engine line) and, when the run sits at a gate, add a gate block (step_id/message/options/choice) to the payload so orchestrators can drive review gates without parsing stdout. Reference implementation for the proposal in github#2964. Addresses github#2964
Contributor
Author
|
@mnriem when you have a moment, would appreciate your thoughts on the direction here — the issue lists the alternatives considered, and I'm happy to rework toward whichever shape fits Spec Kit best. |
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.
Description
Reference implementation for #2964 — for discussion, direction welcome.
When a run pauses at a gate, the
--jsonoutcome now carries agateblock (step_id/message/options/choice) so orchestrators can detect "human review needed" and present the options without parsing the human-facing stream. Two small pieces:typein the run state's step results (one added line instep_data— previously the type was not recoverable from state)._workflow_run_payloadadds thegateblock via a_gate_outcomehelper when the run's current step is a gate.choicepopulates when the outcome ends at the gate with a decision recorded (e.g. an interactive rejection withon_reject: abort→ afailedpayload carrying"choice": "reject"; anon_reject: retrypause likewise). A mid-flow approval proceeds past the gate, so the block clears — by design. Non-gate runs and runs that end elsewhere are unchanged — nogatekey, payload byte-identical to today.The issue lists alternatives (a generic
paused_stepblock; a dedicated status value) — happy to rework toward either.Testing
uv sync && uv run pytest— full suite 3727 passedTestWorkflowRunGateOutcomeJson): a gate pause carries the exact block (CliRunner stdin is non-TTY, so the gate pauses); a completed run has nogatekey — the gate-pause test is red against currentmain, green with the change (verified both directions)uvx ruff check src/— cleanuv run specify --helpworkflow run --json)AI Disclosure
Code, tests, and this description were authored with AI assistance (Claude); verified by running the repo's test suite and ruff locally in both red and green directions.