You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Align the Go loop harness with the LoopAgent portion of microsoft/agent-framework#7539 so NonStreamingReturnsLastResponseOnly still reports usage from every loop iteration. The loop middleware now accumulates usage across all iterations, removes per-iteration usage from the buffered final response, and reattaches the aggregated usage to the surfaced last response. I also added a regression test that exercises summed token counts and merged AdditionalCounts.
Upstream commit referenced: ec32e86646469585bf6d7be83b343c88bf606950 from microsoft/agent-framework. This PR ports only the LoopAgent behavior that maps to agent/harness/loop.
Breaking Changes
No. This corrects internal usage accounting for existing loop runs without changing exported Go API.
Tests and Examples
Ran go test ./agent/harness/loop
Added regression coverage in agent/harness/loop/loop_test.go for aggregated usage in last-response-only non-streaming runs
No example changes were needed for this internal behavior fix
Notes
This intentionally scopes the upstream port to the Go loop harness slice of microsoft/agent-framework#7539. The broader .NET PR also updated other looping components that do not map to this narrow Go change set.
This was originally intended as a pull request, but GitHub Actions is not permitted to create or approve pull requests in this repository.
The changes have been pushed to branch dotnet-port-fixes-loop-usage-aggregation-360e094fde178154.
To fix the permissions issue, go to Settings → Actions → General and enable Allow GitHub Actions to create and approve pull requests. See also: gh-aw FAQ
Summary
Align the Go loop harness with the LoopAgent portion of microsoft/agent-framework#7539 so
NonStreamingReturnsLastResponseOnlystill reports usage from every loop iteration. The loop middleware now accumulates usage across all iterations, removes per-iteration usage from the buffered final response, and reattaches the aggregated usage to the surfaced last response. I also added a regression test that exercises summed token counts and mergedAdditionalCounts.Ported .NET PRs
Upstream commit referenced:
ec32e86646469585bf6d7be83b343c88bf606950from microsoft/agent-framework. This PR ports only the LoopAgent behavior that maps toagent/harness/loop.Breaking Changes
No. This corrects internal usage accounting for existing loop runs without changing exported Go API.
Tests and Examples
go test ./agent/harness/loopagent/harness/loop/loop_test.gofor aggregated usage in last-response-only non-streaming runsNotes
This intentionally scopes the upstream port to the Go loop harness slice of microsoft/agent-framework#7539. The broader .NET PR also updated other looping components that do not map to this narrow Go change set.
Note
This was originally intended as a pull request, but GitHub Actions is not permitted to create or approve pull requests in this repository.
The changes have been pushed to branch
dotnet-port-fixes-loop-usage-aggregation-360e094fde178154.Click here to create the pull request
To fix the permissions issue, go to Settings → Actions → General and enable Allow GitHub Actions to create and approve pull requests. See also: gh-aw FAQ
Show patch preview (200 of 200 lines)