fix(updates): report backend update failures truthfully - #82658
fix(updates): report backend update failures truthfully#82658alexgunsberg wants to merge 1 commit into
Conversation
Riccardo-Vecchi
left a comment
There was a problem hiding this comment.
The new structured status is a good direction, but the fallback currently erases the ownership/permission failure it is meant to surface.
| # via ls-remote against the official HTTPS remote. No local writes. | ||
| checked = _check_via_rev(head_rev) | ||
| if checked is not None: | ||
| return checked, None, head_rev |
There was a problem hiding this comment.
[P1] Preserve fetch ownership/permission failures after the read-only compare
When fetch fails, this return converts any successful ls-remote comparison into (checked, None, head_rev), discarding fetch_error. A deterministic ownership case is: the ownership-relaxed HEAD probe succeeds; fetch without safe.directory fails with dubious ownership; the public ls-remote succeeds; this branch returns an available/current result with no error. If the install is writable despite the owner mismatch (for example root or group-writable), repo_install_writable() is also true, so /api/hermes/update/check still reports can_apply=true even though the update command cannot pass Git's ownership guard. Preserve the fetch error/capability failure while still returning the read-only availability fact, and add coverage for a successful ls-remote following a git-ownership/git-permission fetch failure.
|
Superseded by #83181 which integrates this PR's structured Closing as duplicate/superseded so the two patches cannot overwrite each other. Branch/head preserved if anything needs cherry-picking. |
|
Superseded by #83181 (integrated + shallow safety v2). |
Summary
Backend update checks now distinguish “already current” from “could not determine update state.” This preserves the independent Backend status needed by Desktop PR #82608.
What changed
Scope
Backend only: hermes_cli/banner.py, hermes_cli/web_server.py, and three focused Python test files. Desktop UI changes remain isolated in PR #82608.
Verification at exact head 9d0e565
244d296646909aca1dd16c9759491da0ef4cd163(missing structured checker), proving it detects the old behaviorgit diff --checkpassedbehind=0,repo_writable=true; root-owned/opt/hermes-agentreturned the intentional update-available-without-count sentinel withrepo_writable=false, which the API maps toupdate_available=true,can_apply=false