Skip to content

fix(context): reject app shells for binary downloads#86

Merged
madtank merged 1 commit intomainfrom
codex/context-download-shell-guard
Apr 22, 2026
Merged

fix(context): reject app shells for binary downloads#86
madtank merged 1 commit intomainfrom
codex/context-download-shell-guard

Conversation

@madtank
Copy link
Copy Markdown
Member

@madtank madtank commented Apr 22, 2026

Summary

  • validate non-text context downloads against the actual HTTP response before writing bytes to disk
  • reject HTML, JSON, and other suspicious text responses when a binary artifact was requested
  • surface a clear error that includes the returned content type and a short response preview
  • add a regression test covering the app-shell case

Validation

  • pytest tests/test_context_commands.py -q
  • live smoke against a known broken prod upload key now raises a clear ValueError instead of writing an HTML page as image.png

Context

When a gateway or upload URL resolves to an app shell or error page, axctl context download should fail loudly instead of silently saving garbage bytes. This is a guardrail in the CLI; it does not replace the backend/platform fix for missing upload blobs.

@madtank madtank force-pushed the codex/context-download-shell-guard branch from 3f307f9 to 5fb1850 Compare April 22, 2026 16:24
@madtank madtank changed the base branch from dev/staging to main April 22, 2026 16:24
@madtank
Copy link
Copy Markdown
Member Author

madtank commented Apr 22, 2026

Focused validation on the current branch:

  • python3 -m py_compile ax_cli/commands/context.py tests/test_context_commands.py
  • pytest -q tests/test_context_commands.py
  • python3 -m build
  • result: 9 passed; sdist + wheel built successfully

QA packet to run before merge:

  1. Run axctl context download against a known broken upload key that currently resolves to HTML/JSON.
  2. Confirm the CLI errors clearly and does not write garbage bytes to disk.
  3. Confirm a normal binary download still succeeds unchanged.

@madtank madtank marked this pull request as ready for review April 22, 2026 22:35
@madtank madtank merged commit 783a705 into main Apr 22, 2026
@madtank madtank deleted the codex/context-download-shell-guard branch April 22, 2026 23:05
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