You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
A branch whose diff times out or fails reports prose or raw git stderr in error, so clients can't tell a timeout from other failures #126
The design spec asks for a diff timeout to be reported as its own per-branch failure, the equivalent of a 504 for that branch:
Plan: docs/superpowers/specs/2026-08-19-gitbranchstatecache-design.md L213-L217 in ktsu-dev/GitLfsCache``
A git diff exceeding DiffTimeout returns 504 for that branch only; other branches in the same request still answer. A partial answer is explicitly labelled so a client never mistakes it for "nothing changed".
What exists today:
Per-branch isolation and partial: true both work (GitBranchStateCache/Endpoints/BranchStateHandler.cs, BuildStateAsync). Test: Post_State_WhenADiffTimesOut_TheOtherBranchesStillAnswer.
GitBranchStateCache/Diffs/DiffOutcome.cs records TimedOut, but the handler never reads it.
BranchStateHandler.cs:258 sets the branch's error to diff.Failure:
On a timeout that is the sentence "The diff for this branch exceeded its time budget." (DiffOutcome.cs:35).
On any other failure it is the git stderr summary (DiffSource.cs:67, DiffOutcome.Failed(result.Summary)).
The only machine-readable per-branch code is no-merge-base (BranchStateHandler.cs:248).
What's missing: a stable, documented per-branch error code. A client that wants to retry a timed-out branch, but not one with a corrupt object, has to match on English prose or on git's own stderr. Both can change with a reworded message or a different git version. Raw stderr in a response body also exposes mirror paths and git internals to the client.
Failure scenario
A UE editor plugin queries 20 branches, and one large branch exceeds DiffTimeout. The response is 200, partial: true, and that branch carries error: "The diff for this branch exceeded its time budget.". To decide "retry later" rather than "warn the user that something is broken", the client has to compare against that exact sentence. A different branch failing with fatal: bad object … carries that stderr text in the same field, and nothing in the shape of the response separates the two.
Acceptance criteria
A timed-out diff reports error: "timeout" on its branch.
Any other diff failure reports a distinct fixed code, for example diff-failed. Git's stderr goes to the log (as EndpointLog.BranchFailed already does) or to a separate optional message field, never to error.
no-merge-base stays as it is.
Post_State_WhenADiffTimesOut_TheOtherBranchesStillAnswer asserts the code, and a new test covers the non-timeout failure.
The README lists the per-branch error codes.
Dependencies
#69 (git timeouts in merge-base and the commit check are reported as no-merge-base or unknown-base) suggests mapping a merge-base timeout to "the branch-level timeout error the diff path already uses", but no such code exists yet. Land this first so #69 can reuse it, or widen #69 to cover both.
Area / suggested assignee:Endpoints/BranchStateHandler.cs (:248, :258) and Diffs/DiffOutcome.cs, plus the README's response section. Owner: @matt-edmondson
Next step: add the fixed codes timeout and diff-failed, read DiffOutcome.TimedOut in the handler, and move stderr to the log or an optional message field. Update the existing timeout test and add one for the non-timeout failure.
Activity
matt-edmondson commentedon Nov 7, 2026
Triage
erroralso exposes mirror paths. Per-branch isolation andpartial: truealready work, so nothing is silently wrong. A git timeout or failure is reported as "no-merge-base" or 409 "unknown-base" (and counted in unknown_base) instead of as a timeout or server error #69 is blocked on thetimeoutcode this issue adds.Endpoints/BranchStateHandler.cs(:248, :258) andDiffs/DiffOutcome.cs, plus the README's response section. Owner: @matt-edmondsontimeout. When a diff times out, every coalesced follower re-runs the same diff-tree: 10 concurrent requests start 10 processes, and each follower waits up to 2×DiffTimeout #63 (timeout follower re-runs) is in the same code path but is a separate concern. No open PR covers it (Refuse a timer-backed timing longer than about 49.7 days [patch] #122, Take each upstream's allow-list whole from the source that wins it [patch] #123 and Match a backwards bracket range's first character, as git branch --list does [patch] #125 are unrelated).timeoutanddiff-failed, readDiffOutcome.TimedOutin the handler, and move stderr to the log or an optionalmessagefield. Update the existing timeout test and add one for the non-timeout failure.Generated by Claude Code