Skip to content

copilot-adapter: expose submit_outcome reason as a step output#140

Merged
brokenbot merged 1 commit into
mainfrom
copilot-outcome-reason-output
May 18, 2026
Merged

copilot-adapter: expose submit_outcome reason as a step output#140
brokenbot merged 1 commit into
mainfrom
copilot-outcome-reason-output

Conversation

@handcaught
Copy link
Copy Markdown
Member

Summary

  • The copilot adapter's ExecuteResult only carried Outcome — the reason argument the model passes to submit_outcome was visible only as an adapter event and could not be referenced from downstream workflow expressions.
  • This change populates ExecuteResult.Outputs with {"reason": <model-supplied reason>} on successful finalization so HCL can read steps.<step_name>.reason. Failure paths (reprompt exhaustion, permission denial, max_turns reached) emit no outputs, matching prior behavior.
  • Documents the new output in docs/adapters.md under "Outcome Finalization".

Test plan

  • go test ./cmd/criteria-adapter-copilot/ -count=1 — full adapter suite passes.
  • New TestAwaitOutcome_ReasonInOutputs asserts the reason surfaces in the result's outputs end-to-end through Execute.
  • Manually verify a real workflow can reference steps.<name>.reason in a downstream step expression.

The copilot adapter previously emitted only an outcome from each step,
leaving the model's `reason` argument visible only as an adapter event
that downstream workflow steps could not reference. Surface it as the
`reason` step output so HCL expressions can read `steps.<name>.reason`.

Failure paths (reprompt exhaustion, permission denial, max_turns) emit
no outputs.
@brokenbot brokenbot merged commit d07c2bf into main May 18, 2026
7 checks passed
@brokenbot brokenbot deleted the copilot-outcome-reason-output branch May 18, 2026 04:09
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