Skip to content

fix: settle HarnessAgent telemetry correctly for failed and aborted turns - #21947

Merged
n1ckoates merged 7 commits into
mainfrom
bugfix-21936-20261001220417478130
Oct 2, 2026
Merged

n1ckoates merged 7 commits into
mainfrom
bugfix-21936-20261001220417478130

Conversation

@ai-sdk-factory

@ai-sdk-factory ai-sdk-factory Bot commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

Background

Failed and caller-aborted HarnessAgent turns left OpenTelemetry root and inference spans unfinished because integrations could not correlate terminal telemetry.

Root Cause

The harness lifecycle passed a bare error to onError, provided no abort dispatcher, and routed aborted failures through error handling. The original reproduction confirmed start events occurred while no spans finished.

Summary

Error telemetry now includes callId, abort telemetry includes callId, completed steps, and reason, and runPrompt routes caller aborts through the abort lifecycle. Added a patch changeset for @ai-sdk/harness.

Testing

Added lifecycle regression tests for correlated errors, completed-step abort events, terminal settlement, and runPrompt abort-versus-error telemetry routing.

End-to-end Validation

Related Issues

Fixes #21936

Closes #21940

ai-sdk-factory and others added 3 commits October 1, 2026 22:10
Co-authored-by: doneumark <23178875+doneumark@users.noreply.github.com>
Co-authored-by: doneumark <23178875+doneumark@users.noreply.github.com>

@vercel vercel Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additional Suggestion:

createFileReporter's onError handler treats its argument as a raw Error, but it now receives the { callId, error } event object, so the recorded JSONL error payload is a wrapper object instead of the extracted { name, message }.

Fix on Vercel

@n1ckoates
n1ckoates enabled auto-merge (squash) October 2, 2026 17:26
@n1ckoates
n1ckoates merged commit e7da240 into main Oct 2, 2026
54 checks passed
@n1ckoates
n1ckoates deleted the bugfix-21936-20261001220417478130 branch October 2, 2026 17:36
@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

🚀 Published in:

Package Version
ai 7.0.128 github npm
@ai-sdk/alibaba 2.0.61 github npm
@ai-sdk/amazon-bedrock 5.0.106 github npm
@ai-sdk/angular 3.0.128 github npm
@ai-sdk/anthropic 4.0.72 github npm
@ai-sdk/anthropic-aws 2.0.64 github npm
@ai-sdk/assemblyai 3.0.54 github npm
@ai-sdk/azure 4.0.91 github npm
@ai-sdk/baseten 2.1.41 github npm
@ai-sdk/black-forest-labs 2.0.55 github npm
@ai-sdk/bytedance 2.0.57 github npm
@ai-sdk/cartesia 3.0.49 github npm
@ai-sdk/cerebras 3.0.63 github npm
@ai-sdk/code-mode 1.0.85 github npm
@ai-sdk/cohere 4.0.55 github npm
@ai-sdk/deepgram 3.1.25 github npm
@ai-sdk/deepinfra 3.0.63 github npm
@ai-sdk/deepseek 3.0.59 github npm
@ai-sdk/devtools 1.0.31 github npm
@ai-sdk/elevenlabs 3.0.55 github npm
@ai-sdk/fal 3.0.55 github npm
@ai-sdk/fireworks 3.0.66 github npm
@ai-sdk/fish-audio 3.0.32 github npm
@ai-sdk/gateway 4.0.104 github npm
@ai-sdk/gladia 3.0.54 github npm
@ai-sdk/gmicloud 3.0.34 github npm
@ai-sdk/google 4.0.88 github npm
@ai-sdk/google-vertex 5.0.102 github npm
@ai-sdk/groq 4.0.55 github npm
@ai-sdk/harness 1.0.139 github npm
@ai-sdk/harness-acp 1.0.78 github npm
@ai-sdk/harness-claude-code 1.0.143 github npm
@ai-sdk/harness-cline 1.0.66 github npm
@ai-sdk/harness-codex 1.0.141 github npm
@ai-sdk/harness-cursor 1.0.53 github npm
@ai-sdk/harness-deepagents 1.0.139 github npm
@ai-sdk/harness-fx 1.0.53 github npm
@ai-sdk/harness-github-copilot 1.0.35 github npm
@ai-sdk/harness-grok-build 1.0.77 github npm
@ai-sdk/harness-opencode 1.0.141 github npm
@ai-sdk/harness-pi 1.0.141 github npm
@ai-sdk/huggingface 2.0.63 github npm
@ai-sdk/hume 3.0.54 github npm
@ai-sdk/klingai 4.0.56 github npm
@ai-sdk/langchain 3.0.128 github npm
@ai-sdk/llamaindex 3.0.128 github npm
@ai-sdk/luma 3.0.55 github npm
@ai-sdk/mcp 2.0.67 github npm
@ai-sdk/minimax 3.0.49 github npm
@ai-sdk/mistral 4.0.57 github npm
@ai-sdk/moonshotai 3.0.63 github npm
@ai-sdk/open-responses 2.0.59 github npm
@ai-sdk/openai 4.0.84 github npm
@ai-sdk/openai-compatible 3.0.63 github npm
@ai-sdk/otel 1.0.128 github npm
@ai-sdk/perplexity 5.0.6 github npm
@ai-sdk/policy-opa 1.0.128 github npm
@ai-sdk/prodia 2.0.55 github npm
@ai-sdk/provider 4.0.22 github npm
@ai-sdk/provider-utils 5.0.54 github npm
@ai-sdk/quiverai 2.0.55 github npm
@ai-sdk/react 4.0.131 github npm
@ai-sdk/replicate 3.0.55 github npm
@ai-sdk/revai 3.0.54 github npm
@ai-sdk/rsc 3.0.128 github npm
@ai-sdk/sandbox-just-bash 1.0.139 github npm
@ai-sdk/sandbox-vercel 1.0.139 github npm
@ai-sdk/svelte 5.0.128 github npm
@ai-sdk/togetherai 3.0.64 github npm
@ai-sdk/topaz 3.0.1 github npm
@ai-sdk/tui 1.0.129 github npm
@ai-sdk/typesafe-ai 3.0.13 github npm
@ai-sdk/valibot 3.0.54 github npm
@ai-sdk/voyage 2.0.54 github npm
@ai-sdk/vue 4.0.128 github npm
@ai-sdk/workflow 2.0.59 github npm
@ai-sdk/workflow-harness 1.0.139 github npm
@ai-sdk/xai 5.0.15 github npm
@ai-sdk/zai 3.0.25 github npm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

@ai-sdk/harness turn telemetry dispatches onError without callId and never dispatches onAbort

2 participants