feat(platform): expose callback_context on Runs.submit() [PYSDK-143]#660
Conversation
Picks up the new optional callback_context field on RunCreationRequest plus unrelated v1.6.0 deltas (grants/share-tokens models). Driven entirely by openapi-generator output from platform-staging — no hand edits. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Exposes the new optional callback_context field (added in Platform API v1.6.0) on the low-level platform.Runs.submit() method. The field is forwarded verbatim into the generated RunCreationRequest; server enforces the 1 KB cap, no client-side validation. The PR also pulls in the v1.6.0 codegen regen (which incidentally brings new grants/share-token models/endpoints and optional share_token query params on run read APIs).
Changes:
- Adds
callback_context: dict[str, Any] | None = Nonekwarg toRuns.submit()and forwards it toRunCreationRequest. - Regenerates
codegen/out/aignx/codegen/*from OpenAPI v1.6.0 (newcallback_contextfield onRunCreationRequest, plus unrelated grants/share-tokens models andshare_tokenquery params). - Updates SPEC and adds two unit tests covering forward-when-provided and default-to-None.
Reviewed changes
Copilot reviewed 4 out of 59 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/aignostics/platform/resources/runs.py | Adds and forwards callback_context kwarg on Runs.submit() |
| tests/aignostics/platform/resources/runs_test.py | Adds two unit tests + assertion in existing test for callback_context |
| specifications/SPEC_PLATFORM_SERVICE.md | Documents the new param on Runs.create() (note: spec still uses create, impl is submit) |
| codegen/in/openapi.json, codegen/in/archive/openapi_1.6.0.json | OpenAPI source bumped to v1.6.0 with callback_context and access/share-token additions |
| codegen/out/aignx/codegen/models/run_creation_request.py | Generated model gains callback_context field and to_dict/from_dict handling |
| codegen/out/aignx/codegen/models/{grant_,share_token_,resource_type,subject_type}.py | New generated models for access/share-token endpoints (regen side-effect) |
| codegen/out/aignx/codegen/models/init.py | Re-exports for new generated models |
| codegen/out/aignx/codegen/api/public_api.py (and docs/PublicApi.md) | Generated endpoints for grants/share-tokens and optional share_token query param on run read APIs |
| codegen/out/aignx/codegen/{api_client,configuration,exceptions,rest}.py & other model headers | Version banner bump from 1.5.0 to 1.6.0 |
| codegen/out/.openapi-generator/FILES | Generator file list updated |
Surfaces the optional v1.6.0 callback_context field as a dict | None kwarg on Runs.submit(), forwarded verbatim to RunCreationRequest. The platform echoes it in state-change events; useful for callers (e.g. internal orchestrators) embedding correlation data. No client-side validation — server enforces the 1 KB limit. CLI, GUI, and the application service orchestration layer are intentionally unchanged per CR PYSDK-143. - src/aignostics/platform/resources/runs.py: add parameter + payload kwarg - tests/aignostics/platform/resources/runs_test.py: forwards-when-provided and omits-when-not-provided unit tests; extend existing test - specifications/SPEC_PLATFORM_SERVICE.md: amend Runs.create() signature Refs: https://aignx.atlassian.net/browse/PYSDK-143 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
feca4cb to
abb59cf
Compare
|
Codecov Report✅ All modified and coverable lines are covered by tests.
|



Summary
Implements CR PYSDK-143: exposes the new optional
callback_contextfield on run submission, introduced by Platform API v1.6.0.platform-staging;RunCreationRequestnow carriescallback_context: Optional[Dict[str, Any]] = None. Unrelated v1.6.0 deltas (new grants/share-token models) are accepted as part of the regen.Runs.submit()gains acallback_context: dict[str, Any] | None = Nonekwarg, forwarded verbatim toRunCreationRequest. No client-side validation; server enforces the 1 KB limit.@pytest.mark.unitcases intests/aignostics/platform/resources/runs_test.py: forwards-when-provided and defaults-to-None.specifications/SPEC_PLATFORM_SERVICE.mdamended to document the new param onRuns.create().applicationservice orchestration layer are intentionally unchanged.Traceability
Per the updated CR, only SPEC-level items are affected:
Runs.create()signature extended.The change is implementation-level passthrough — no SWR-level amendments needed (captured at the SPEC layer).
Test plan
make lint— greenuv run pytest tests/aignostics/platform/resources/runs_test.py— 60/60 passmake test_unit— greencallback_contexton a submitted runmake audit— supply-chain check🤖 Generated with Claude Code