Skip to content

fix: preserve empty dict handler output#535

Open
chenlichao wants to merge 1 commit into
runpod:mainfrom
chenlichao:fix/empty-dict-handler-output
Open

fix: preserve empty dict handler output#535
chenlichao wants to merge 1 commit into
runpod:mainfrom
chenlichao:fix/empty-dict-handler-output

Conversation

@chenlichao

Copy link
Copy Markdown

Summary

  • Stop dropping an empty dict returned by a serverless handler from the normalized job result.
  • Add regression coverage for local /runsync and /status simulation paths returning output: {}.

Why this helps

Test Plan

  • pytest tests/test_serverless/test_modules/test_fastapi.py -q --no-cov (8 passed)

Note: a targeted run without --no-cov also had all 8 tests pass, but failed the repository-wide coverage threshold because only one test file was selected.

@capy-ai

capy-ai Bot commented Jul 9, 2026

Copy link
Copy Markdown

Capy auto-review is paused for this organization because the usage-cycle auto-review limit has been reached. Increase the limit or turn it off in billing settings to resume automatic reviews.

@promptless

promptless Bot commented Jul 9, 2026

Copy link
Copy Markdown

Promptless prepared a documentation update related to this change.

Triggered by runpod-python PR #535

Added a "Handler return values" section to the Serverless handler functions docs, explaining how a handler's return value maps to the job output field — dictionaries pass through directly, other types are wrapped, and an empty dictionary is a valid return that completes as COMPLETED with output: {}.

Review: Document Serverless handler return values

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Returning empty object from handler raises KeyError exception within framework

1 participant