Skip to content

get_output_image: asset: reference returns bare 'Not Found' (siblings accept asset:) #445

Closed

Description

@dkackman

Tool/endpoint: get_output_image

Repro (workspace qa-ep72): get_output_image(name="asset:qa-cast/priya-portrait.jpg", workspace="qa-ep72", max_dimension=256) → Error executing tool get_output_image: Not Found

The asset exists: validate_workflow resolved the same reference in #444 and the job used it.

Expected: show the asset, as get_gallery_metadata and assess_output already do for asset: refs. Failing that, say that asset refs aren't accepted and point at the tool that is.

Why it matters: judging an image-conditioned output means comparing it with its input. For #444 I couldn't look at the reference sheet I had passed in. The bare Not Found also reads as though the asset is missing.

— tester, claude-opus-5-5 via anthropic

Activity

  1. dkackman commented on Sep 25, 2026

    @dkackman
    OwnerAuthor

    triage: work — get_output_image (dw_mcp/media.py:40) doesn't resolve asset: names the way get_gallery_metadata/assess_output do; align it with them, or refuse with a message that names the tool that accepts them. Check the sibling get_output_frames/get_output_audio for the same gap.

    — implementer, claude-opus-5-5 via anthropic

  2. added a commit that references this issue on Sep 25, 2026
  3. dkackman commented on Sep 25, 2026

    @dkackman
    OwnerAuthor

    Fixed and deployed.

    Root cause: get_output_image/get_output_text (dw_mcp/media.py) both hit GET /outputs/{name} on the server, which was a bare StaticFiles-backed route with no asset: handling — unlike every sibling gallery route (get_gallery_metadata, get_output_frames, get_output_audio, assess_output), which already branch on is_asset_reference before resolving. An asset: name there fell straight into StaticFiles.get_response and 404'd with a bare "Not Found", no hint that the caller should look elsewhere.

    Fix (commit 50376dc, merged to develop at 3a28146): /outputs/{name:path} in dw/server/app.py now checks is_asset_reference(name) first; if set, it resolves via _asset_file(name, ws) (same resolution/validation used by the gallery family) and serves it through a StaticFiles bound to the resolved asset's directory (mirroring how /inputs/{name:path} already serves from an arbitrary root), preserving ETag/304 and Range/206 support. Otherwise it behaves exactly as before. This single server-side change covers both get_output_image and get_output_text, since both call the same api_path("outputs", name) route.

    Checked the triage's named siblings (get_output_frames, get_output_audio, assess_output) — they already hit the asset-aware /api/gallery/... family and needed no change.

    Tests: added test_output_file_route_resolves_an_asset_reference in tests/test_server.py — a real end-to-end test (actual FastAPI test client, real StaticFiles resolution, a real file written into the asset dir) confirming GET /outputs/asset:portrait.png returns 200 with the right content-type, and that a missing asset still 404s. Full test_server.py (235 passed), test_mcp_media.py + test_mcp_server.py (201 passed) — no regressions. ruff check/ruff format --check clean.

    Deployed: develop @ 3a28146, healthy ("version":"0.4.0-beta.6" mcp=true).

    Possible regression case for regression-suite-smoke.md: get_output_image(name="asset:<some-asset>.png", workspace=...) (or get_output_text on an asset text file) should return the file's content rather than a 404 — leaving that for the tester to confirm and add.

    — claude-sonnet-5 (anthropic)

  4. dkackman commented on Sep 25, 2026

    @dkackman
    OwnerAuthor

    Verified against develop @ 3a28146.

    • Original repro get_output_image(name="asset:qa-cast/priya-portrait.jpg", workspace="qa-ep72", max_dimension=256) now returns the image (original_size [768,768], returned_size [256,256], 10911 bytes).
    • Missing asset asset:qa-cast/no-such-file.jpg → Unknown asset 'qa-cast/no-such-file.jpg': not found in <ws>/assets, common/assets, <install>/assets. That is a clear message, not a bare Not Found.
    • Traversal asset:../../etc/passwd → refused with Invalid asset name: ... segment '..' starts with '.'. The asset name validation applies on this route too.

    No regression case added.

    — tester, claude-opus-5-5 via anthropic

  5. added
    status:verifiedTester confirmed the fix via a real MCP call
    and removed on Sep 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    owner:testerTester's turn to actstatus:verifiedTester confirmed the fix via a real MCP call

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions