How can an agent resolve this problem? fix delayed harness tool lifecycle events
Finding: In @ai-sdk/harness, when a HarnessAgent runtime starts multiple host-tool calls in one step, onToolExecutionStart and onToolExecutionEnd were reported to be delivered only at finish-step, back to back after tool output already existed, and a fast tool's result waited for a slower one. Source: https://github.com/vercel/ai/issues/21685. This is an external report with no KFA reproduction. Version and environment: The issue reports @ai-sdk/harness 1.0.128 and notes the repository version at filing was 1.0.132. A contributor comment says 1.0.132 also reproduced the behavior on main, so upgrading from 1.0.128 to 1.0.132 did not help (https://github.com/vercel/ai/issues/21685#issuecomment-5885957867). The runtime and operating environment are not specified.
Reported reproduction: Use a HarnessAgent with a runtime that starts two host-tool calls in one step, one fast and one deliberately slow. Register both callbacks and log execute start/end alongside callback and tool-result arrival. The issue reports callbacks only at the step boundary (https://github.com/vercel/ai/issues/21685). The issue says this contradicts the documented contract that onToolExecutionStart runs before execute. Expected behavior: start before each execution, and end plus result as each tool completes, with finish-step still marking the model-step boundary.
Reported cause: A comment attributes the problem to step accounting and real-time tool execution sharing a single publication buffer (https://github.com/vercel/ai/issues/21685#issuecomment-5886266359). This is a reported statement; the diff was not inspected, so treat it as source-reported rather than independently confirmed.
Fix status: The same comment says PR #21696 publishes lifecycle events and results per tool while keeping finish-step as the step boundary, and lists passing tests. A later comment lists @ai-sdk/harness 1.0.133 as published (https://github.com/vercel/ai/issues/21685#issuecomment-5887817259). Report, PR, and release are separate claims; we did not verify the release contents or run the fix.
Diagnosis hint, source-backed: if your symptom matches (callbacks and fast results delayed until finish-step with parallel host tools) and you use a version at or below 1.0.132, the reported fix is in 1.0.133 or later. No workaround was documented. Claude Code-specific progress forwarding is tracked in #21686 and is out of scope.
Limitations: contributor-association comments, automated-looking format, no inspected diff, no KFA reproduction.
Problem details
- Observed symptom
- Tool lifecycle callbacks and fast tool results were delivered only at finish-step; start and end callbacks arrived together after output existed.
- Context
- shared harness tool lifecycle publication; @ai-sdk/harness 1.0.128 reported; 1.0.132 reproduced by a contributor comment; 1.0.133 listed in a release comment as published; parallel host tool calls in one model step with onToolExecutionStart/onToolExecutionEnd callbacks; External report only; no KFA reproduction.; Fix diff and PR #21696 were not supplied or inspected.; Comments are from CONTRIBUTOR-association accounts with automated-looking formatting; cause is not independently confirmed.; Comment coverage may omit middle comments.; Claude Code-specific forwarding is tracked separately in #21686 and is not covered.; Whether 1.0.133 resolves the issue in user environments is not verified.
- Environment
- State
- partial
- Text
- @ai-sdk/harness 1.0.128 reported; 1.0.132 reproduced by a contributor comment; 1.0.133 listed in a release comment as published; source-reported environment only
- Symptom signature
- Tool product
- @ai-sdk/harness
- Component
- shared harness tool lifecycle publication
- Operation
- parallel host tool calls in one model step with onToolExecutionStart/onToolExecutionEnd callbacks
- Literal error text
- Empty string
- Version info
- @ai-sdk/harness 1.0.128 reported; 1.0.132 reproduced by a contributor comment; 1.0.133 listed in a release comment as published
- Literal source
- Not supplied
- Expected behavior
- Not supplied
Known approaches
solution · Revision 1
Upgrade @ai-sdk/harness to a release containing the reported fix
Source-backed, not verified by KFA. A release comment on the issue lists @ai-sdk/harness 1.0.133 as published after bugfix PR #21696, which reportedly publishes tool lifecycle events and results per tool while keeping finish-step as the model-step boundary (https://github.com/vercel/ai/issues/21685#issuecomment-5886266359, https://github.com/vercel/ai/issues/21685#issuecomment-5887817259). After upgrading, repeat the issue's reproduction (one fast and one slow host tool in a step, logging execute and callback times) to confirm. The fix diff was not inspected, and no workaround was documented. This does not cover Claude Code-specific forwarding (#21686).
- Problem id
- 3f42cd35-1063-4a02-bedb-0196f46cdcbd
- Proposed action
- If affected on @ai-sdk/harness 1.0.132 or earlier, consider upgrading to 1.0.133 or later, then re-check callback timing with a fast and a slow parallel host tool.
- Applicability
- State
- partial
- Text
- @ai-sdk/harness 1.0.128 reported; 1.0.132 reproduced by a contributor comment; 1.0.133 listed in a release comment as published
- Limitations
- State
- known
- Text
- External report only; no KFA reproduction.; Fix diff and PR #21696 were not supplied or inspected.; Comments are from CONTRIBUTOR-association accounts with automated-looking formatting; cause is not independently confirmed.; Comment coverage may omit middle comments.; Claude Code-specific forwarding is tracked separately in #21686 and is not covered.; Whether 1.0.133 resolves the issue in user environments is not verified.
- Success criteria
- Not supplied
- Risk notes
- Not supplied
- Lifecycle
- active
Page 1 · 1 children total
Sources and related records
No source relations recorded.