compute: discover the API surface at runtime instead of compiling it in#318
Open
samcm wants to merge 1 commit into
Open
compute: discover the API surface at runtime instead of compiling it in#318samcm wants to merge 1 commit into
samcm wants to merge 1 commit into
Conversation
The compute integration was pinned to a hand-copied OpenAPI document: every upstream API change meant re-copying the spec, regenerating an 11k-line typed client, and hand-updating the server's per-operation argument mapping, the CLI, and the Python docs. The service publishes its OpenAPI 3 document at /v1/openapi.yaml, so fetch it through the credential proxy at runtime (cached per datasource, stale tolerated on refresh failure) and dispatch operations generically: path, query, and header arguments are classified by the document, required body fields are enforced from its schemas, and everything else passes through as body fields. Operations added upstream become callable with no panda change, via `panda compute call <operation>` and compute.call(...) in Python, with list_api_operations serving the discovered catalog. Two small adapters keep the legacy flat argument shapes working (create_sandbox snapshot source, fork identity nesting), and the previous SSH-key operation names remain as aliases. The index retains only structural data — operation ids, paths, parameter names — never the document's free text, so nothing upstream-specific surfaces to callers; tests pin that with a sentinel-branded fixture. All 46 previously wired operations resolve to identical method+path against the production document. The generated client, embedded spec, and codegen tooling are removed (-14.4k lines). Claude-Session: https://claude.ai/code/session_01WmTXRKrnKGn6HvMA2Hdoos
Contributor
🐼 Smoke eval —
|
| question | result | tokens | tools |
|---|---|---|---|
forky_node_coverage |
✅ | 27,855 | 6 |
tracoor_node_coverage |
✅ | 19,464 | 9 |
mainnet_block_arrival_p50 |
✅ | 16,301 | 9 |
list_datasources |
✅ | 13,006 | 2 |
block_count_24h |
✅ | 21,328 | 10 |
missed_slots_24h |
✅ | 27,188 | 16 |
chartkit_default_arrival_distribution |
✅ | 58,678 | 29 |
storage_upload_session_scoped |
✅ | 19,714 | 15 |
🔭 Langfuse traces (8 runs; ⚠️ = failed)
The report walks this branch's commits against the master baseline and the most recent release. A self-contained copy is in the run's eval-smoke-* artifact.
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.
Replaces the checked-in compute OpenAPI spec and its generated 11k-line client with runtime discovery: the panda server now fetches the service's OpenAPI document through the credential proxy (cached per datasource), and dispatches
compute.*operations generically from it — path/query/header args classified by the document, required body fields enforced from its schemas, everything else passed through as body fields. Operations added upstream are callable without touching panda, viapanda compute call <operation>andcompute.call(...)/list_api_operations()in Python.Two adapters keep the legacy flat argument shapes working (create_sandbox snapshot source, fork identity nesting) and the old SSH-key operation names remain as aliases. The operation index keeps structural data only (ids, paths, parameter names), never the document's free text, pinned by a sentinel-branded test fixture. All 46 previously wired operations resolve to the same method and path as the generated client did against the production document; 16 more become reachable through
call.Note:
panda compute callneeds a server running this change — against an older server it returns unknown-operation.https://claude.ai/code/session_01WmTXRKrnKGn6HvMA2Hdoos