Skip to content

feat(weave): adopt weave-server-sdk and rewrite the stainless trace server against it#7163

Closed
andrewtruong wants to merge 1 commit into
masterfrom
andrew/stainless-sdk-default
Closed

feat(weave): adopt weave-server-sdk and rewrite the stainless trace server against it#7163
andrewtruong wants to merge 1 commit into
masterfrom
andrew/stainless-sdk-default

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?

…erver against it

Adds the published weave-server-sdk (0.0.1, temporarily resolved from test
PyPI via a uv index pin) as a required dependency and rewrites
StainlessRemoteHTTPTraceServer against it. The published SDK differs from the
old git-pinned generation: a WeaveTrace client, flat resources, and methods
that take pydantic request models.

The binding keeps the tsi-typed TraceServerClientInterface surface and full
behavior parity with RemoteHTTPTraceServer:

- One injected httpx.Client (env-proxy default transport, ssl_verify/
  http_timeout honored) shared by SDK and raw paths; a response event hook
  routes errors through handle_response_error so callers keep seeing
  httpx.HTTPStatusError / CallsCompleteModeRequired; a request hook injects
  X-Weave-Retry-Id per attempt.
- Ports calls_complete v2 batching + eager v2 start/end (CallBatchProcessor)
  and the auto-upgrade path, which the old stainless binding lacked.
- Raw _request escape hatches, each with a documented reason: endpoints
  excluded from the OpenAPI spec (calls_complete, eager v2, completions,
  project stats, TTL, feedback aggregate) and SDK 0.0.1 codegen bugs
  (shadowed duplicate method names, lost multipart body).
- Streaming endpoints stay line-by-line streamed (the SDK buffers jsonl).
- files_stats now hits /files/query_stats (the real route); the old
  RemoteHTTPTraceServer targeted /files/stats, which does not exist.

Tests: rewrites the stainless behavior tests to mock at the httpx transport
boundary (SpyTransport) so hooks, SDK encode/decode, and retry predicates are
exercised for real; ports the remote-only calls_complete/eager coverage; and
re-enables the dormant stainless CI shard in both test matrices.
@w-b-hivemind

w-b-hivemind Bot commented Jun 11, 2026

Copy link
Copy Markdown

HiveMind Sessions

2 sessions · 3h 18m · $308

Session Agent Duration Tokens Cost Lines
Refactor Plan Review for Weave SDK
019eb506-341c-7d72-86e5-fcb41344e597
codex 3m 101.0K $2.17 +0 -0
<system_instruction> You are working inside Conduc
be3f1cfa-cf25-48a8-9ca8-2aeb6746fba3
claude 3h 14m 556.2K $306 +4336 -1875
Total 3h 18m 657.2K $308 +4336 -1875

View all sessions in HiveMind →

Run claude --resume be3f1cfa-cf25-48a8-9ca8-2aeb6746fba3 or codex resume 019eb506-341c-7d72-86e5-fcb41344e597 to pickup where you left off.

@codecov

codecov Bot commented Jun 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@andrewtruong

Copy link
Copy Markdown
Collaborator Author

Superseded by the restructured stack #7177 + #7178 (RemoteHTTPTraceServer rebuilt in place on weave-server-sdk; no shared-code moves; no test-side type bridge; incremental import lint).

@github-actions github-actions Bot locked and limited conversation to collaborators Jun 11, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant