Skip to content

fix(endpoint): preserve empty input request envelopes - #666

Draft
allenflux wants to merge 2 commits into
runpod:mainfrom
allenflux:fix/preserve-empty-endpoint-input
Draft

allenflux wants to merge 2 commits into
runpod:mainfrom
allenflux:fix/preserve-empty-endpoint-input

Conversation

@allenflux

@allenflux allenflux commented Oct 31, 2026 •

Copy link
Copy Markdown

Endpoint.run and run_sync wrap an already formed request again when its input is an empty object. For example, {"input": {}, "webhook": "...", "policy": {...}} becomes nested under a second input, so the handler receives the envelope and the request loses its top-level controls.

Check for the presence of the input key when deciding whether to wrap raw handler data. This preserves empty input envelopes as well as existing nonempty envelopes; bare input dictionaries still wrap once. The two methods' docstrings now describe this existing dual input contract. The async endpoint API is unchanged.

The send-requests documentation describes input and top-level webhook/policy. Current CLI tests already accept an empty object as handler input.

Validation on macOS arm64 / Python 3.10.22:

  • Same eight public Endpoint regressions: two failures and six passing controls on main, then all pass. They inspect prepared request JSON without sending it, including raw/empty input and caller input immutability.
  • Current-main integration: complete stock suite has 3,465 passed and seven skipped, with 94.99% coverage against the unchanged 90% gate. The seven upstream skips require Python 3.14 deferred annotations.
  • Independent frozen-source review: 88 tests passed, covering the endpoint directory, 20 additional envelope controls, and the exact volume-cache regression that failed the earlier hosted run.
  • Wheel/sdist build, Twine and diff checks pass. Black passes for the new test and modified source lines. Whole-file Black was not rerun for this maintenance; a clean whole-file formatting check is not claimed.

The stock remote E2E exclusion was preserved. Full local tests used fake credentials and a test-process guard rejecting unexpected non-loopback connections. No live Runpod service, GPU, worker deployment or cluster was used. Python 3.11–3.14 and the Linux CI platform were not run locally.

AI assistance was used for implementation, regression testing and independent automated local review.

Maintenance integrates current main fd16b99 through a normal merge commit, without rewriting history. Main already includes #667's fix for the old volume-cache test fixture; that fix is not duplicated here. The PR's net change remains the same two files (88 additions, four deletions). The new-head hosted CI run is awaiting maintainer approval and has not executed tests; local success is not a hosted CI pass.

This branch has not been deployed

No deployments
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.

1 participant