Conversation
The gateway's run envelope now carries an optional `source`: the customer-safe identity of the lane that actually served the call, in the same shape discovery already publishes under `lanes[].source`. Both SDKs dropped it on the floor, so a caller could not read which source served a run and feed that id back as `source` (or into `ignoreSources`) next time. Declare it on `RunResult` and `BareRunResult` in both languages, reusing the existing `DiscoverySource` type rather than declaring a second one, and record it in SPEC 2.3 beside the run-envelope field-presence erratum: the Go tag carries `omitempty`, so `source` is optional exactly like `resultId` and `jqError`. The synthetic fixtures are unchanged for the same reason they omit `resultId` - they model the success path. Co-Authored-By: Claude Fable 5.1 <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
The gateway added an optional
sourceto thePOST /v1/run/{slug}success envelope in anyapi#1133 (in production since 2026-09-16). Neither SDK declared it, so a caller could readcostUsdandreplayedoff a run but not which source served it - and therefore could not feed that id back as thesourceinput, or intoignoreSources, on the next call.sourceis the same customer-safe object discovery already publishes underlanes[].source({ id, name, kind, artworkKey }), so both SDKs reuse their existingDiscoverySourcetype rather than declaring a second one. The internal routing provider slug is never part of it andproviderstays the literal"AnyAPI".Changed
SPEC.md2.3:source?: DiscoverySourceon theRunResult<T>declaration, added to the "Run-envelope field presence" erratum's optional set, and a new "Served source" erratum. Mirrored in the 3.3 Python sketch.packages/typescript/src/core/types.ts:source?: DiscoverySourceonRunResult<T>andBareRunResult<T>.packages/python/src/getanyapi/types.py:source: DiscoverySource | None = NoneonRunResultandBareRunResult.artworkKey/artwork_key), and is absent when the run names no resolvable lane.The Go tag carries
omitempty, sosourceis optional exactly likeresultIdandjqError. The synthetic fixtures are unchanged for the same reason they omitresultId: a fixture models the success path, and the generator was not touched.Proof
Removing the two field declarations fails the new coverage:
tsc --noEmitreportsProperty 'source' does not exist on type 'RunResult<AmazonReviewsData>'at both new assertions, and pytest failstest_served_source_parses_as_a_discovery_sourceandtest_source_defaults_to_none_when_no_lane_is_named.Full gate green on the final tree:
pnpm check(dash guard, release tests, no regen drift, 162 generator tests, 481 TypeScript tests, tsup, consumer-typecheck),pyright,mypy --strict,pytest508 passed.No version bump and no workflow dispatch: the blocked catalog-refresh release is a separate call.