Skip to content

control: accurate HTTP status codes for model actions#20

Merged
REPPL merged 1 commit into
mainfrom
fix/model-endpoint-status-codes
Jul 18, 2026
Merged

control: accurate HTTP status codes for model actions#20
REPPL merged 1 commit into
mainfrom
fix/model-endpoint-status-codes

Conversation

@REPPL

@REPPL REPPL commented Jul 18, 2026

Copy link
Copy Markdown
Owner

Cleanup from the round-9 WebUI review. The download and delete handlers
mapped every App error to 409 Conflict — including a malformed model id
(should be 400) and deleting a model that isn't in the registry (should be 404).

Adds an app.ErrInvalidRepoID sentinel and a small modelErrorStatus mapper:
400 for a bad id, 404 for an absent model, 409 for a genuine conflict
(already-downloading, or busy serving a request). Tests assert the 400 and 404
cases (both returned 409 before).

Note on the other round-9 WebUI findings: on closer inspection the rest are
intentional or defensible, so I did not change them —

  • the download "Cancel" using delete is a deliberate design choice (its comment
    says cancel abandons the download outright rather than leaving a failed row);
  • Registry.Remove not broadcasting when os.RemoveAll fails correctly keeps
    the still-present model visible;
  • bytes(0) rendering "—" treats 0 as "unknown", which is reasonable.
    The one genuine UX gap — the Load button lacks a loading state — is frontend-only
    with no test harness; happy to do it (with a browser check) if you want it.

Assisted-by: Claude:claude-fable-5

The download and delete handlers mapped every App error to 409 Conflict,
including a malformed model id (a 400 Bad Request) and deleting a model that
isn't present (a 404 Not Found). Add an ErrInvalidRepoID sentinel and a small
mapper so the endpoints report 400 / 404 / 409 as appropriate; a genuine
conflict (already downloading, busy serving) stays 409. Tests assert an invalid
id is 400 and an absent-model delete is 404 (both were 409 before).

Assisted-by: Claude:claude-fable-5
@REPPL
REPPL merged commit da1893f into main Jul 18, 2026
6 checks passed
@REPPL
REPPL deleted the fix/model-endpoint-status-codes branch July 18, 2026 13:40
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