Skip to content

Expose Zoo backend API call IDs to Python callers and logs - #263

Draft
r-barton wants to merge 1 commit into
mainfrom
ryan/expose-api-call-ids
Draft

Expose Zoo backend API call IDs to Python callers and logs#263
r-barton wants to merge 1 commit into
mainfrom
ryan/expose-api-call-ids

Conversation

@r-barton

@r-barton r-barton commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator

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 ApiCallEvent and the context-local capture_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-kcl 0.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, so uv lock cannot 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant