-
-
Notifications
You must be signed in to change notification settings - Fork 113
Fix sources metadata unavailable during streaming #838
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: OskarStark <[email protected]>
Co-authored-by: OskarStark <[email protected]>
|
@copilot fix the CI |
Co-authored-by: OskarStark <[email protected]>
Fixed in 2bb7b3a - removed trailing whitespace from test file Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
I checked and this indeed fixed it! @OskarStark |
|
@copilot looks like the tests are failing: There was 1 error:
/home/runner/work/ai/ai/src/agent/src/Toolbox/StreamResult.php:41 ERRORS! |
Co-authored-by: OskarStark <[email protected]>
Fixed in 74f8a8a - added check for iterable content before using |
Co-authored-by: OskarStark <[email protected]>
Co-authored-by: OskarStark <[email protected]>
Co-authored-by: OskarStark <[email protected]>
Co-authored-by: OskarStark <[email protected]>
Co-authored-by: chr-hertel <[email protected]>
Description
Fixed issue where sources metadata was inaccessible when using streaming with the Agent. When using
stream: truewith the Agent andincludeSources: trueon AgentProcessor, the sources metadata was alwaysnullafter consuming the stream.Root Cause
The metadata (including sources) was being set on the inner result returned by the tool call callback in
AgentProcessor::handleToolCallsCallback(), but was never propagated to the outerStreamResultobject that users access.Solution
Modified
StreamResult::getContent()insrc/agent/src/Toolbox/StreamResult.phpto:yield fromChanges Made
yield fromtestSourcesEndUpInResultMetadataWithStreaming()to verify metadata is accessible after stream consumptionUsage Example
Testing
The fix is minimal and surgical, changing only what's necessary to resolve the streaming metadata propagation issue.
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.