gabriel / muse public
fix patch task/mist-read-path-fix #1 / 1
AI Agent gabriel · 60 days ago · Jul 5, 2026 · Diff

fix: mist read owner/ID form builds wrong API path

run_read constructed /api/{owner}/mists/{id} for owner-qualified input, but the server has no such route — the real route is /api/mists/{id}, since owner is not part of the path (every other mist subcommand already handles this correctly). Wrong path -> unmatched route -> misleading 'Server returned invalid JSON' error instead of a real HTTP status.

Also hardens _hub_api's 404 branch to include the HTTP status code in its error message (was '❌ Not found: ...', now '❌ Hub returned HTTP 404: ...'), consistent with every other status branch, so a 404 with a valid JSON body is never confused with a JSON-parse failure.

Closes #44.

sha256:96c357b8148f911540e02341f1f5ce7cbd553117ab3430bd7fb5c9f203f9b590 sha
+16 ~2 symbols
sha256:4f19865f0741a978730fe6939751c664ec7c1fe90864d955db3267ba89bdd3f8 snapshot
+16
symbols added
~2
symbols modified
0
dead code introduced
Semantic Changes 18 symbols
~ tests/test_mist_read_api_path.py .py 16 symbols added
+ TestHubApi404Message class class TestHubApi404Message L115–135
+ test_404_surfaces_http_status_not_json_parse_error method method test_404_surfaces_http_status_not_json_parse_error L116–135
+ TestRunReadApiPath class class TestRunReadApiPath L31–112
+ test_bare_id_and_owner_qualified_id_produce_identical_output method method test_bare_id_and_owner_qualified_id_produce_identical_output L91–112
+ test_bare_id_uses_mists_path method method test_bare_id_uses_mists_path L52–68
+ test_owner_is_discarded_not_embedded_in_path method method test_owner_is_discarded_not_embedded_in_path L70–89
+ test_owner_qualified_id_uses_mists_path_not_owner_path method method test_owner_qualified_id_uses_mists_path_not_owner_path L32–50
+ _args function function _args L23–24
+ _fake_identity function function _fake_identity L27–28
+ IdentityEntry import import IdentityEntry L19–19
+ TransportError import import TransportError L20–20
+ annotations import import annotations L11–11
+ argparse import import argparse L13–13
+ mock import import mock L15–15
+ pathlib import import pathlib L14–14
+ pytest import import pytest L17–17
~ muse/cli/commands/mist.py .py 2 symbols modified
← Older Oldest on task/mist-read-path-fix
All commits
Newer → Latest on task/mist-read-path-fix

0 comments

No comments yet. Be the first to start the discussion.

To add a comment, use the Muse CLI: muse hub commit comment sha256:96c357b8148f911540e02341f1f5ce7cbd553117ab3430bd7fb5c9f203f9b590 --body "your comment"