Repository navigation
demo: its harness wrappers declare modelCalls up front (one chat span per model call) - #16
Merged
Merged
Conversation
… per model call) The demo's harness wrappers (`byHands`, `lazyHarness`) build the real harness on its first drive, and declared only `name` and `lanes` up front. durable-harness's tracing reads `modelCalls` from the harness when a drive starts, before that build, so it took every demo harness for an `effects` one: each model call got an extra empty `chat` span from its `model` effect (finish reason unknown, no usage) next to the one the harness records itself. Agent Runs' turn view hid it; the raw trace showed two chat spans per step. Every harness the demo wraps records its own model calls (`modelCalls: 'self'`), so the wrappers now declare it up front (`UpFront`: `lanes` and `modelCalls`), and warn when the harness they build says otherwise. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
Collaborator
Author
|
Checked on this PR's preview ( |
This branch was successfully deployed
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.
On the demo, every model call shows up twice in its Agent Runs trace: an empty
chatspan (finish reasonunknown, no usage) next to the real one. The turn view in Agent Runs hides the empty span, but the raw trace has twochatspans per step. For example, a Pi tool turn has 2 steps and 4chatspans.Cause: the demo's harness wrappers (
byHandsinlib/hands.ts,lazyHarnessinlib/sessions.ts) build the real harness on its first drive. They declared onlynameandlanesup front. durable-harness's tracing readsmodelCallsfrom the harness when a drive starts, before that build. With nomodelCallson the wrapper, it treated each demo harness as aneffectsharness and recorded achatspan from everymodeleffect, on top of the call the harness records itself.Fix: every harness the demo wraps records its own model calls (
modelCalls: 'self'): Pi, fx, the hybrid harnesses, the CLIs and the reference CLI behind the Gateway proxy, and the AI SDK.UpFront, which islanesandmodelCalls.modelCalls: 'self'.The package is unaffected. Its own wrapper,
pi()indurable-harness/pi, already declaresmodelCalls: 'self'.Tests:
lib/hands.test.tsadds one case: the wrapper declaresmodelCallsbefore its first build, and warns when the built harness disagrees. Demo typecheck passes, andcheck-publicpasses.Check on this PR's preview: a Pi tool turn should have one
chatspan per step (2 steps, 2chatspans) and the same usage in Agent Runs.🤖 Generated with Claude Code