Skip to content

Fix completed reports returning null from the gateway - #1

Open
georgeatparallel wants to merge 1 commit into
render-examples:mainfrom
georgeatparallel:fix/completed-research-results
Open

Fix completed reports returning null from the gateway#1
georgeatparallel wants to merge 1 commit into
render-examples:mainfrom
georgeatparallel:fix/completed-research-results

Conversation

@georgeatparallel

@georgeatparallel georgeatparallel commented Sep 11, 2026

Copy link
Copy Markdown

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 use GET /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 results as a list containing one report dictionary. The gateway only accepted a dictionary directly, so it returned status: "completed" with result: 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.

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant