Skip to content

feat(weave)!: the client speaks weave-server-sdk models#7178

Draft
andrewtruong wants to merge 1 commit into
andrew/sdk-uptake-01-remote-server-on-sdkfrom
andrew/sdk-uptake-02-client-sdk-models
Draft

feat(weave)!: the client speaks weave-server-sdk models#7178
andrewtruong wants to merge 1 commit into
andrew/sdk-uptake-01-remote-server-on-sdkfrom
andrew/sdk-uptake-02-client-sdk-models

Conversation

@andrewtruong

Copy link
Copy Markdown
Collaborator

Description

  • Fixes WB-NNNNN
  • Fixes #NNNN

What does the PR do? Include a concise description of the PR contents.

Testing

How was this PR tested?

andrewtruong commented Jun 11, 2026

Copy link
Copy Markdown
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.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@codecov

codecov Bot commented Jun 11, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 75.75758% with 136 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
.../trace_server_bindings/remote_http_trace_server.py 27.64% 89 Missing ⚠️
weave/flow/saved_view.py 25.80% 46 Missing ⚠️
...server_bindings/caching_middleware_trace_server.py 95.65% 0 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@wandbot-3000

wandbot-3000 Bot commented Jun 11, 2026

Copy link
Copy Markdown

@andrewtruong andrewtruong force-pushed the andrew/sdk-uptake-02-client-sdk-models branch from e0c835c to 6630fbe Compare June 11, 2026 13:46
@andrewtruong andrewtruong force-pushed the andrew/sdk-uptake-02-client-sdk-models branch 2 times, most recently from 6a58a0a to 801dbac Compare June 11, 2026 15:20
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.
@andrewtruong andrewtruong force-pushed the andrew/sdk-uptake-01-remote-server-on-sdk branch from d34b793 to 8d5eed6 Compare June 11, 2026 17:13
@andrewtruong andrewtruong force-pushed the andrew/sdk-uptake-02-client-sdk-models branch from 801dbac to 0e5ec03 Compare June 11, 2026 17:13
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