feat(github): explain throttle reasons with inline tips and a reference doc - #1072
Conversation
…ce doc A raw engine reason like "redo-aware 4 > 3" names a signal only its author recognizes. The throttle tooltip now appends a short tip saying what the pause protects, keyed on the reason's leading signal token, and the PR comment links a new docs/throttle.md that explains each signal and its remediation. Signals sharing a meaning share a tip, composite reasons join their tips, and an unrecognized signal renders the raw reason alone so a new engine signal degrades to raw text rather than a wrong explanation. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Adds operator-facing explanations for engine throttling so a slowed progress bar reads as intentional backpressure (and what it protects), with a linked reference doc for deeper remediation guidance.
Changes:
- Render throttle tooltips as
reason · tip(and add a docs link in PR comment markdown) when the reason’s leading signal token is recognized. - Introduce
pkg/uimapping logic for throttle-reason → operator tip, including composite reasons. - Add
docs/throttle.mdas the canonical reference for throttle signals and operator actions.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| TEMPLATES.md | Updates rendered-output examples to include the new reason · tip throttle text (and docs link in PR comment example). |
| pkg/webhook/templates/apply.go | Appends an inline tip + docs link to the markdown throttle tooltip when a tip is available; falls back to raw reason when unknown. |
| pkg/webhook/templates/apply_test.go | Updates PR-comment rendering assertions for the new throttle tooltip format. |
| pkg/ui/throttle.go | Adds ThrottleTip and ThrottleDocURL to translate engine throttle reasons into short operator tips. |
| pkg/ui/throttle_test.go | Tests throttle tip mapping, composite reasons, de-duping, and unknown-signal behavior. |
| pkg/cmd/internal/templates/progress.go | Adds the same reason · tip rendering to the CLI (without a docs link). |
| pkg/cmd/internal/templates/progress_states_test.go | Updates CLI-format assertions for the new throttle tooltip text. |
| docs/throttle.md | New reference documentation for throttle signals, what they mean, and when to act. |
Suppressed comments (1)
pkg/webhook/templates/apply_test.go:328
- This assertion also hardcodes the docs URL; prefer ui.ThrottleDocURL to avoid duplicating the link string.
assert.Contains(t, result, "- ℹ️ _Throttled: threads-running 130 > 128 · yielding to application query load on the database ([docs](https://github.com/block/schemabot/blob/main/docs/throttle.md))_")
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…election Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…b host Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
🤖 Review findings - created by Kiran's code review agent - for schemabot/pull/1072, 4ff2f65. Verdict: 9 findings — 2 blocking (the most likely tip names the wrong culprit, and a third of the doc covers a signal SchemaBot cannot emit), 5 non-blocking, 2 suggestions. Blocking1. The 2. The two Non-blocking3. In a composite reason, an unrecognized segment is dropped and the surviving tip silently binds to the whole pause. 4. 5. "On Aurora this signal often pairs with redo-aware" (:94) inverts Spirit's design. redo-aware subtracts exactly the threads parked on redo-log flush, so when the log saturates its count falls: "it will not self-limit if the extra write threads saturate the log, and commit-latency is then the only signal that would notice" (aurora_threads.go:192). An operator who looks for a co-occurring redo-aware reason, finds none, and concludes "not a load problem" skips the resize the throttle is asking for. 6. Three more doc claims do not hold. :9 promises the tooltip carries "a link to this document", but the CLI renders no link (progress.go:795 vs apply.go:996) — the PR body says the opposite of the doc. The asserted grammar 7. Two mutations survive green. Deleting the CLI's unknown-signal fallback render (progress.go:798) leaves all three packages passing — no CLI test ever passes an unrecognized signal, so a refactor could drop the reason from CLI output entirely. Dropping General suggestions8. Test precision. progress_states_test.go:419 was left at its pre-PR prefix while its sibling on :403 was updated, so the checksum-phase tooltip passes with or without the tip — its webhook twin ( 9. The one thing that could have broken, verifiedA wrong tip is worse than no tip, so the question was whether the mapping can mis-key. Token extraction is sound — Verified correct
This review was generated by Claude Code (claude-opus-5). |
A composite reason with any unrecognized signal now yields no tip at all, so a surviving tip can never silently bind to a signal it does not cover. The thread-budget tip no longer attributes the pause to application query load: the engine deliberately counts its own copy threads toward the budget, so the pause is not evidence of application overload. Drop the replica-lag tips and doc sections: the engine builds that throttler only when a replica DSN is configured, and nothing configures one, so the signal cannot render. Correct the throttle doc's remaining claims (no flag surface for the commit-latency threshold, realistic threads-running arithmetic, commit-latency fires alone when the redo log saturates, the docs link is PR-comment only) and add its docs-toc block. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
🤖 All nine addressed in 21a92ac. Both blocking findings were confirmed against source: the copy's own threads deliberately count toward the thread budget, so the tip now stays neutral ("backing off while the database's active threads exceed its budget") and the doc calls out that an idle instance can throttle on the copy's own footprint; and This reply was generated by Claude Code (claude-fable-5). |
Follows up on the throttle surfacing in #1039. A raw engine reason like
redo-aware 4 > 3names a signal only its author recognizes; an operator watching a paused bar should not need to read the throttler source to know what the pause protects.Inline tips. The throttle tooltip now appends a short tip keyed on the reason's leading signal token:
The full mapping:
redo-awarethreads-runningcommit-latencySignals that read the same to a user share a tip (
redo-awareandthreads-running, the same budget measured two ways), composite reasons split on;and join their distinct tips, and a reason containing any unrecognized signal renders raw with no tip at all — a partial explanation must never bind to a signal it does not cover. The thread-budget tip deliberately does not blame application load: the engine counts its own copy threads toward the budget, so the pause can occur on an idle instance. The CLI renders the samereason · tipline dimmed, without the link.Reference doc. New
docs/throttle.mdcarries the remediation prose the one-line tip cannot: what each signal measures, why the engine pauses on it, and when a sustained throttle warrants action (performance_schemaaccess to upgrade the thread signal, storage pressure, instance sizing). It covers exactly the signals SchemaBot's engine configuration can emit. The PR comment links it so the tip is a pointer, not the whole story.🤖 Generated with Claude Code