feat(weave)!: the client speaks weave-server-sdk models#7178
Draft
andrewtruong wants to merge 1 commit into
Draft
feat(weave)!: the client speaks weave-server-sdk models#7178andrewtruong wants to merge 1 commit into
andrewtruong wants to merge 1 commit into
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! |
|
Preview this PR with FeatureBee: https://beta.wandb.ai/?betaVersion=9be74467521d0b0ac32e0036e2176a4598f8b209 |
e0c835c to
6630fbe
Compare
6a58a0a to
801dbac
Compare
RemoteHTTPTraceServer and the client now use weave_server_sdk.models end to end — the OpenAPI-generated types are the source of truth. The server's hand-written tsi models are no longer used anywhere in client code, enforced by extending the TID251 ban list (trace_server_interface, interface.query, common_interface, service_interface). - TraceServerClientInterface is a client-owned Protocol typed with SDK models, containing the methods the client uses (calls/objects/tables/refs/ files/feedback/costs/annotation queues/completions, set_auth, processors). - RemoteHTTPTraceServer keeps its full drop-in surface, retyped: SDK models in/out where the spec has them, and documented gap models in trace_server_bindings/models.py for everything the published SDK cannot express — multipart file create, binary file content, calls_complete + eager v2, completions, project stats, TTL settings, thread rows, feedback aggregate, the Feedback row schema, EnsureProjectExistsRes, and thin request envelopes (composed FROM the SDK body models) for routes whose ids travel in the URL path (tags/aliases, annotation queues, the v2 object APIs). Each gap is noted for deletion when a regenerated SDK covers it. op_list no longer forwards `eager` (the field no longer exists on the request model; forwarding it was already dead code). - Client modules migrate from tsi imports to weave_server_sdk.models. Notable adaptations: TraceStatus is a Literal in the SDK (status-count keys use literal constants); the SDK has no Operand alias and types operand lists as list[Any], so saved_view parses leaf operands on access; started_at on call-end rides as an extra field until the SDK model declares it; public boundaries (get_calls filter/sort_by/query, get_feedback, annotation queue params) coerce dicts and foreign pydantic families while still rejecting unknown dict keys. - The caching middleware builds prefix-invalidated cache keys with explicit leading fields (the SDK declares fields in sorted order, which silently broke serialized-request prefix matching), and normalizes results to its declared response types so cache hits and misses return the same family. - Tests construct SDK models; no test-side conversion bridge exists. The in-process test servers parse incoming requests with their own request types via a generic, signature-introspected wrapper (tests/trace_server/conftest_lib/request_coercion.py) — the in-process equivalent of the HTTP seam, with no per-method code and no SDK imports. Responses flow back unchanged and are accessed by field. BREAKING: client.server methods reject the legacy tsi request models (construct weave_server_sdk.models instead), and the Monitor object's stored query serialization no longer carries _type metadata on leaf operands.
d34b793 to
8d5eed6
Compare
801dbac to
0e5ec03
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
What does the PR do? Include a concise description of the PR contents.
Testing
How was this PR tested?