Expose Zoo backend API call IDs to Python callers and logs - #263
Draft
r-barton wants to merge 1 commit into
Draft
Conversation
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.
Python tool callers currently lose Zoo backend API call IDs when results are reduced to measurements, files, or images, especially across retries and failures. Add
ApiCallEventand the context-localcapture_api_call_events()collector, with correlated logs emitted independently of capture. Existing Python return values and MCP response schemas are preserved.Capture KittyCAD responses before SDK parsing, including pagination, polling, raw fallback, and HTTP errors. Preserve the original asynchronous operation ID separately from polling request IDs, and represent a request with no response as an unavailable ID. KCL uses a fresh trace for each attempt, drained in
finally; retry events expose that attempt's IDs. Persistent modeling sessions retain handshake/session metadata and correlate later command outcomes, cancellation, and eviction without extending deadlines or reading extra frames. Nested captures receive each event once, and concurrent invocations have distinct local IDs.Release prerequisite: Depends on KittyCAD/modeling-app#13762 and publication of
zoo-kcl0.3.183. The implementation was exercised against the locally built 0.3.183 wheel, including live Zoo measurements and exports. PyPI currently only has 0.3.182, souv lockcannot resolve the new minimum yet. The MCP package, registry manifest, and lockfile's own package version are prepared as 0.26.8; regenerate and commit the dependency lock after the KCL release before merging or releasing this PR. Keep this PR in draft until that prerequisite is satisfied.