feat(weave): rebuild RemoteHTTPTraceServer on weave-server-sdk#7177
Draft
andrewtruong wants to merge 1 commit into
Draft
Conversation
Collaborator
Author
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
This was referenced Jun 11, 2026
Closed
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Swaps RemoteHTTPTraceServer's hand-rolled HTTP mechanics for the generated weave-server-sdk client (0.0.1, temporarily resolved from test PyPI via a uv index pin), keeping the class and its full tsi-typed method surface intact. (The dormant experimental StainlessRemoteHTTPTraceServer and its opt-in plumbing were removed in the previous commit.) Transport design: - One injected httpx.Client (env-proxy default transport, ssl_verify/ http_timeout honored) shared by SDK-routed and raw paths; a response event hook routes errors through handle_response_error so callers keep seeing httpx.HTTPStatusError / CallsCompleteModeRequired (retry predicates, 413 batch splitting, and the calls_complete auto-upgrade key off these); a request hook injects X-Weave-Retry-Id per attempt. - Typed SDK resource methods wherever the generated client is correct; raw requests, each with a documented reason, for endpoints excluded from the OpenAPI spec (calls_complete v2, eager v2 call start/end, completions, project stats, TTL, feedback aggregate) and for weave-server-sdk 0.0.1 codegen bugs (duplicate generated method names where the last definition wins, lost multipart/otel bodies). Streaming endpoints keep line-by-line streaming (the published SDK buffers jsonl). - files_stats now hits /files/query_stats (the real route); the old implementation targeted /files/stats, which does not exist. - The parallel-table-upload endpoint probe uses a new explicit unretried_table_create_from_digests method instead of poking _post_request_executor.__wrapped__ internals. - The network_proxy_client fixture routes the binding's transport into the FastAPI TestClient via the binding's transport test seam instead of monkeypatching weave.utils.http_requests.post. Also starts the incremental client/server import lint (ruff TID251 banned-api): weave.trace_server.http_service_interface is now unused by client code and banned; the list grows as the client moves to weave_server_sdk models.
d34b793 to
8d5eed6
Compare
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.

Description
Swaps
RemoteHTTPTraceServer's hand-rolled HTTP mechanics for the generated weave-server-sdk client (0.0.1, temporarily resolved from test PyPI via a uv index pin), keeping the class and its full tsi-typed method surface intact — a drop-in replacement. (The dormant experimentalStainlessRemoteHTTPTraceServerwas removed in the parent PR, #7185.)Transport design:
httpx.Client(env-proxy default transport,ssl_verify/http_timeouthonored) shared by SDK-routed and raw paths; a response event hook routes errors throughhandle_response_errorso callers keep seeinghttpx.HTTPStatusError/CallsCompleteModeRequired(retry predicates, 413 batch splitting, and the calls_complete auto-upgrade key off these); a request hook injectsX-Weave-Retry-Idper attempt.files_statsnow hits/files/query_stats(the real route); the old implementation targeted/files/stats, which does not exist.unretried_table_create_from_digestsmethod instead of poking_post_request_executor.__wrapped__internals.network_proxy_clientfixture routes the binding's transport into the FastAPI TestClient via the binding's transport test seam instead of monkeypatchingweave.utils.http_requests.post.Also starts the incremental client/server import lint (ruff TID251 banned-api):
weave.trace_server.http_service_interfaceis now unused by client code and banned; the list grows as the client moves to weave_server_sdk models in the next PRs.Testing
tests/trace_server_bindings— 58 passed, including transport-boundary tests for retry behavior, 413 splitting, calls_complete/eager batching, and the auto-upgrade pathweave_init.pythat was masked at the stack tip; fixed here)