Skip to content

copilot-adapter: expose outcome and reason as step outputs uniformly#141

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

copilot-adapter: expose outcome and reason as step outputs uniformly#141
brokenbot merged 1 commit into
mainfrom
copilot-outcome-reason-output

Conversation

@handcaught
Copy link
Copy Markdown
Member

Summary

  • Follow-up to copilot-adapter: expose submit_outcome reason as a step output #140. Align the copilot adapter's step outputs with the shape used by the built-in shell adapter: always populate Outputs on every result, success or failure.
  • Surface two keys uniformly: outcome (mirrors the FSM outcome) and reason (the model's submit_outcome reason, empty on failure paths where the model did not supply one).
  • Previously copilot-adapter: expose submit_outcome reason as a step output #140 only set reason on the success path and left Outputs nil on failures, giving downstream HCL an inconsistent schema. This change makes steps.<name>.outcome and steps.<name>.reason readable regardless of how the step ended.

Test plan

  • go test ./cmd/criteria-adapter-copilot/ -count=1 — full adapter suite passes.
  • New TestAwaitOutcome_OutcomeAndReasonInOutputs asserts both keys are present on success.
  • New TestAwaitOutcome_FailurePathPopulatesOutcomeOutput asserts outcome="failure" and reason="" on the reprompt-exhaustion path.
  • Manually verify a workflow can read steps.<name>.outcome and steps.<name>.reason after a copilot step.

Align the copilot adapter's step outputs with the built-in shell adapter
shape: always populate the Outputs map on every result, regardless of
whether the step succeeded or failed. The shell adapter exposes
stdout/stderr/exit_code on success and failure paths alike; the copilot
adapter now exposes outcome and reason in the same fashion.

- outcome: mirrors the FSM transition outcome
- reason:  the optional reason argument from submit_outcome, empty on
           failure paths (reprompt exhaustion, permission denial,
           max_turns) since the model did not supply one

Downstream steps can read steps.<name>.outcome and steps.<name>.reason
with a consistent schema regardless of how the step terminated.
@brokenbot brokenbot merged commit 2bb58f4 into main May 19, 2026
7 checks passed
@brokenbot brokenbot deleted the copilot-outcome-reason-output branch May 19, 2026 04:34
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