fix: match dev server webhook payload to cloud format - #585
Open
Swigler wants to merge 1 commit into
Open
Conversation
…npod#410) The local dev server (--rp_serve_api) sent only {"output": ...} to webhooks, while the cloud sends the full payload with id, status, input, webhook, delayTime and executionTime. Additionally, webhooks were never triggered when jobs failed because the error path returned before reaching the webhook code. - Build cloud-parity webhook payload in _sim_runsync, _sim_stream, _sim_status - Send webhook on both COMPLETED and FAILED status - Track execution time with time.time() - Add tests asserting payload structure and error-path webhook delivery Closes runpod#409 Closes runpod#410
Swigler
force-pushed
the
fix/webhook-payload-parity
branch
from
September 3, 2026 17:56
a0f4404 to
c050478
Compare
Author
|
Friendly ping — the dev server returns a different webhook shape than cloud, which breaks local testing. This aligns them. Ready for review. |
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.
Summary
id,status,input,webhook,delayTime, andexecutionTimefields alongsideoutput/errortime.time()soexecutionTimereports real milliseconds (delayTimeis always0in local dev since there's no queue)Fixes #409
Fixes #410
What was wrong
The three simulation endpoints (
_sim_runsync,_sim_stream,_sim_status) inrp_fastapi.pyhad two issues:Incomplete webhook payload — only the raw handler output (
{"output": ...}) was sent to the webhook URL, while the cloud API sends a full envelope with job metadata. Developers building webhook handlers against the local dev server would see breakage on deploy.No webhook on failure — in
_sim_runsyncand_sim_status, the error check returned early before the webhook code, so failed jobs never triggered a webhook callback. In production, RunPod sends a webhook with"status": "FAILED".What changed
import timeandjob_start/execution_timetracking in each methodTest plan
pytest tests/test_serverless/test_modules/test_fastapi.py— 8/8)id,status,input,webhook,delayTime,executionTime,output"status": "FAILED"when handler raises an exception