feat(executions): add result_ref kwarg to report_outcome#20
Merged
govindkavaturi-art merged 1 commit intomainfrom Apr 19, 2026
Merged
feat(executions): add result_ref kwarg to report_outcome#20govindkavaturi-art merged 1 commit intomainfrom
govindkavaturi-art merged 1 commit intomainfrom
Conversation
The server's /v1/executions/{id}/outcome endpoint already accepts a
`result_ref` evidence field (see OutcomeRequest in cueapi/cueapi
app/schemas/outcome.py). The SDK's report_outcome was missing it,
forcing callers who want to attach a reference ID to fall back to
either raw HTTP or using an unrelated field like external_id.
Single-line addition in executions.py: new kwarg, forwarded to the
POST body when provided, same shape as every other evidence field.
Companion change in cueapi-worker 0.3.0 (monorepo PR in cueapi/cueapi)
exposes the same field on its WorkerAPIClient so worker-transport
handlers can surface result_ref via the new CUEAPI_OUTCOME_FILE
pattern.
No behavioral change for existing callers — kwarg is optional and
defaults to None.
govindkavaturi-art
pushed a commit
that referenced
this pull request
Apr 20, 2026
Before this change, test_report_with_evidence exercised only three of the ten optional evidence kwargs on report_outcome (external_id, result_url, result_type). The remaining seven — result_ref, summary, artifacts, metadata, result, error — were supported by the SDK but had no test confirming they serialize correctly into the POST body. Most urgent of those is result_ref, which shipped in 0.1.4 via PR #20 with no coverage at all. A future refactor dropping the kwarg or breaking its serialization would pass CI silently. Adds six tests: - test_report_with_result_ref - test_report_with_summary - test_report_with_artifacts - test_report_with_metadata - test_report_with_all_evidence_fields — every optional kwarg in one call; guards against accidental field drops - test_report_omits_none_kwargs — ensures unspecified kwargs do NOT appear in the body (important because server distinguishes "not provided" from "explicitly null" for evidence merge semantics) Tests: 18/18 pass locally (was 12/12).
1 task
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.
Summary
The server's
/v1/executions/{id}/outcomeendpoint already accepts aresult_refevidence field (seeOutcomeRequestin cueapi/cueapiapp/schemas/outcome.py). The SDK'sreport_outcomewas missing it, forcing callers who want to attach a reference ID to fall back to either raw HTTP or using an unrelated field likeexternal_id.Change
Single-line addition in
cueapi/resources/executions.py: new optional kwarg, forwarded to the POST body when provided, same shape as every other evidence field.Companion change
cueapi-worker 0.3.0 (released to PyPI 2026-04-17) exposes the same field on its
WorkerAPIClientso worker-transport handlers can surfaceresult_refvia the newCUEAPI_OUTCOME_FILEpattern. This SDK change closes the loop for direct (non-worker) callers.Compatibility
No behavioral change for existing callers — kwarg is optional and defaults to
None.Test plan
report_outcome(execution_id, success=True, result_ref="my-ref-123")POST body contains"result_ref": "my-ref-123"