Repository navigation
fix(server-utils): Keep pi-durable 1.6 runs from faulting - #26718
Merged
Merged
Conversation
pi-durable 1.6.0 finds the state it keeps for a task runtime by the runtime object. The integration handed task phases a Proxy of the runtime, so every run faulted before its first model request. The phases now get the runtime itself, with `commit` and `agent` replaced on it for the time of the phase. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Contributor
size-limit report 📦Compared: 15dd93f (PR test merge using develop at 3950f4a) Against: 3950f4a (develop) · base run #67492 ✅ Baseline matches: this diff contains only this PR's changes.
|
Contributor
Optional E2E testsSome optional checks were not successful. They do not block the merge. 1 not successful, 63 successful. See the run.
Successful checks
|
sergical
marked this pull request as ready for review
November 21, 2026 16:47
andreiborza
self-requested a review
November 23, 2026 10:06
andreiborza
approved these changes
Nov 23, 2026
andreiborza
left a comment
Member
There was a problem hiding this comment.
Thanks for the fix @sergical!
andreiborza
added a commit
that referenced
this pull request
Nov 23, 2026
…26719) ## What `piDurableIntegration` now traces the tool calls that a tool makes with `api.executeTool()`. Each one gets a `gen_ai.execute_tool` span under the span of the calling tool, with its arguments and result. This is what a pi-durable code mode script does. Until now a script was one `execute_tool codemode` span, and the calls inside it did not appear in the trace. ## Why pi-durable resolves a model-issued call among `agent.tools` and a nested call among `agent.callable` (since 1.2.0). The integration wrapped only `agent.tools`. A nested call is a `pi.tool` task of its own, so its span would otherwise sit next to the calling tool under the run. It gives its result to the calling tool and commits no result entry, so the span records what `execute()` returned. Checked with pi-durable 1.6.0 code mode: one run with 4 scripts shows 21 nested tool spans, each under its script and with its result. Stacked on #26718, which touches the same lines. --------- Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com> Co-authored-by: Andrei Borza <andrei.borza@sentry.io>
51 tasks done
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.
What
Agent runs on
@earendil-works/pi-durable1.6.0 work again withpiDurableIntegration. With SDK 11.16.0, every run ended asunansweredbefore its first model request:Why
pi-durable 1.6.0 finds the state it keeps for a task runtime (provider sessions, the close signal) by the runtime object. The integration gave task phases a
Proxyof the runtime, so those lookups returnedundefined. The phases now get the runtime itself, withcommitandagentreplaced on it while the phase runs.Both are put back when the phase ends. Without that,
scenario-retentionfails: pi-durable keeps the runtime after the phase, and the runtime would keep the run and its spans alive.The integration tests use pi-durable 1.4.0 and still pass. I checked 1.6.0 by hand with this build: a run with tool calls completes and is traced. In CI, the
test:build-latestvariant ofnode-pi-durablecovers 1.6.0.