Python CLI: corrupt compressed responses hide an unknown write outcome
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 72/100
Research direction
Start in the Python CLI request handling and the chat streaming handler, which already catches HTTPX DecodingError separately. Reproduce the malformed gzip response with the provided mocked httpx.Response; add regression coverage for write methods, GET recovery and exhaustion, and CLI text and JSON modes. Done means writes return the existing unknown-outcome guidance with exit code 3, while GET follows its retry policy and maps exhausted decoding failures to exit code 3.
Written by the indexing model from the issue text.
Description
On d4f4b788f176fcbc9dc4cb71333e0efaf159789f, a malformed gzip response makes the Python CLI report an unexpected error with exit code 1. For a POST, PATCH, or DELETE, the server may already have applied the write. The CLI should instead preserve its existing outcome unknown error and tell the caller to check the resource before retrying.
This is a local, synthetic reproduction; I am not claiming a production incident. HTTPX raises DecodingError while consuming the response body. It is not a subclass of httpx.TransportError, so the ordinary request handler misses it. The chat streaming handler already catches this exception separately.
Reproduction
Return the following response from a mocked endpoint called through OmiClient:
httpx.Response(
200,
headers={"Content-Encoding": "gzip"},
stream=httpx.ByteStream(b"not a gzip body"),
)
The stream ensures that HTTPX performs the decoding during the actual client request. Calling omi goal create synthetic --target 1 against the mocked endpoint prints an unexpected decompression error and exits 1, including in JSON mode. The write is not automatically replayed today; the defect is the missing unknown-outcome warning and the wrong error classification.
Proposed correction
- Keep POST, PATCH, and DELETE at one attempt when response decoding fails; use the shared unknown-write-outcome error, exit code 3, and existing check-before-retrying guidance.
- Let GET use the existing bounded retry policy. After four failed attempts, return a mapped API response-decoding error with exit code 3.
- Add hermetic regression coverage for all three write methods, GET recovery and exhaustion, and the real CLI entry point in text and JSON modes.
The local implementation adds 11 production lines, changes one existing line, and adds seven regression cases. All seven fail against the unmodified client and pass with the correction. The complete Python CLI suite passes on macOS with Python 3.12: 797 passed, 1 Windows-only test skipped. No live API or customer data was used.
Bounty request
@kodjima33, would you approve a US$50 bounty for this scoped correction and its regression tests? I can provide the patch as a PR if you approve the scope and amount. I understand that eligibility is discretionary and payment requires acceptance and merge under the contribution rules. PayPal is available for payment through the documented private claim process.
Prepared with AI assistance. The implementation and reported tests have been run locally; maintainer review and CI are still pending.
Reference: Omi contribution and bounty rules.
- Dominant language
- Python
- Stars
- 13.8k
- Forks
- 2.7k
- Avg merge
- 6h 4m
- Merged PRs (30d)
- 610
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from BasedHardware/omi
-
chore(gateway): emit INFO budget reserved/settled logs for proactivity v2 (chip task_2855f4ec)Possibly taken @ahmedcompk claimed this 17 days ago. Openbackend
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
BasedHardware/omi#20940 · 1 comment ·
Maintainers usually reply within 1 day
-
Ray-Ban Meta: a failed audio start is swallowed and capture shows recording with no audioPossibly taken @ocakciomursel-pixel claimed this 2 days ago. Openbug capture flutter p1
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
BasedHardware/omi#20782 · 1 comment ·
Maintainers usually reply within 1 day
-
[Bug]: Memory non-active routes lack blank string validation and timezone normalizationPossibly taken @brandonstensby-dotcom claimed this 25 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
BasedHardware/omi#20084 ·
Maintainers usually reply within 1 day
-
[Bug]: Memory apply store lacks identifier validation and deletion receipt limit clampingPossibly taken @brandonstensby-dotcom claimed this 25 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
BasedHardware/omi#20075 ·
Maintainers usually reply within 1 day
-
[Bug]: Sync backfill sequencer lacks query limit clamping and sequence index boundsPossibly taken @brandonstensby-dotcom claimed this 25 days ago. Open
Difficulty 2/5 1-2 days Newbie friendliness 76/100
BasedHardware/omi#20070 ·
Maintainers usually reply within 1 day
All issues in BasedHardware/omi
Similar issues
-
README.zh-CN/ja/es still hard-code 501 test counts after README.md went count-freePossibly taken @Aaqibhafeezkhan claimed this today. Openbeginner documentation good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
BistaDinesh03/critique#164 · 1 comment ·
Maintainers usually reply within 1 day
-
bug IO
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
MrNeRF/LichtFeld-Studio#3824 ·
Maintainers usually reply within 1 day
-
bug confirmed issue
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
open-webui/open-webui#33200 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
-
The changelog workflow excludes otelbot but not dependabot, so every Dependabot pull request fails the changelog checkPossibly taken @ocelotl claimed this today. Open
Difficulty 1/5 Under an hour Newbie friendliness 82/100
open-telemetry/opentelemetry-python#5825 ·
Maintainers usually reply within 2 days