Fix stray empty output on payload upload/delete CLI#322
Merged
Conversation
`limacharlie payload upload` echoed a stray `b''` and `payload delete`
rendered an empty "Field / Value" table on top of the human-readable
confirmation line. Both commands were passing an empty SDK return value
to _output():
- upload() returns the storage backend's PUT response body, which is
empty bytes (b'') on success.
- delete() returns the API's empty response body ({}) on success.
Only render the SDK return value when it actually carries content, so the
confirmation line ("Payload 'X' uploaded/deleted.") stands alone. Adds
regression tests reproducing both reported cases.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01C6ug17pCvjJYLveQv6iz81
lcbill
previously approved these changes
Jul 24, 2026
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01C6ug17pCvjJYLveQv6iz81
maximelb
enabled auto-merge (squash)
July 24, 2026 16:27
lcbill
approved these changes
Jul 24, 2026
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
A customer reported two cosmetic output glitches in the v2 CLI payload commands (both operations actually succeeded):
payload uploadprinted a strayb''after the confirmation line.payload deleteprinted an emptyField / Valuetable after the confirmation line.Root cause
Both commands print a friendly confirmation and then pass the raw SDK return value to
_output(), but for these two verbs that value is empty/meaningless:Payloads.upload()returns the storage backend'sPUTresponse body, which is empty bytes (b'') on a successful upload. In a TTY this echoedb''; in non-TTY (JSON) mode it actually raisedTypeError: Type is not JSON serializable: bytes.Payloads.delete()returns the API's emptyDELETEresponse body ({}), which the table formatter renders as a bareField / Valueheader.Fix
Only render the SDK return value when it actually carries content (
if data:), so the confirmation line stands alone. No functional change to upload/delete behavior.Tests
Added
TestPayloadCommandsregression tests reproducing both reported cases (the delete test forces--output tableto match the customer's TTY scenario). Both new tests fail onmasterand pass with this change; fulltest_cli_commands.py+test_sdk_payloads.pysuite (60 tests) passes.🤖 Generated with Claude Code
https://claude.ai/code/session_01C6ug17pCvjJYLveQv6iz81