Fix completed reports returning null from the gateway - #1
Open
georgeatparallel wants to merge 1 commit into
Open
Fix completed reports returning null from the gateway#1georgeatparallel wants to merge 1 commit into
georgeatparallel wants to merge 1 commit into
Conversation
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.
The gateway is the HTTP entry point for the research agent. You submit a question with
POST /research, which starts a Render Workflow and returns a run ID. You then useGET /research/{run_id}to check its status and retrieve the finished report.That last step was losing the report. In the hosted test, Render SDK 1.1.0 returned
resultsas a list containing one report dictionary. The gateway only accepted a dictionary directly, so it returnedstatus: "completed"withresult: null. The research had succeeded, but someone following the documented API flow couldn't get the answer.This change unwraps a one-item results list before checking for the report dictionary. The endpoint now returns the report, sources, and other metadata in
result. Direct dictionary responses still work. Empty lists, non-dictionary values, and lists with multiple results still return null rather than choosing a result; unfinished runs also keep returning null.Four HTTP regression tests cover those cases and passed with Render SDK 1.0.1 and 1.1.0. Replaying the saved response from the hosted run through the fixed endpoint also returned the full report and its metadata. The patch hasn't been redeployed to Render.