Skip to content

feat(config): make gate reconcile timings configurable - #862

Open
scs0209 wants to merge 6 commits into
kunchenguid:mainfrom
scs0209:fix/gh-available-auth-error-wrap
Open

feat(config): make gate reconcile timings configurable#862
scs0209 wants to merge 6 commits into
kunchenguid:mainfrom
scs0209:fix/gh-available-auth-error-wrap

Conversation

@scs0209

@scs0209 scs0209 commented Aug 27, 2026

Copy link
Copy Markdown

Intent

Make the parked approval-gate reconcile interval and per-attempt timeout configurable via global config (gate_reconcile_interval / gate_reconcile_timeout), so operators can raise the budget for slow gh auth probes without hardcoding 2m/30s in the executor.

Fixes #833

What Changed

  • Adds global-only gate_reconcile_interval (default 2m) and gate_reconcile_timeout (default 30s) so operators can raise the parked approval-gate reconcile budget without hardcoding timings in the executor.
  • Wires those values through config merge into the pipeline executor’s gate reconcile loop.
  • Makes gh auth status availability probes report timeout, interruption, and missing-binary failures distinctly from authentication failure, with docs updated for the new knobs and error distinction.

Risk Assessment

✅ Low: Global-only duration knobs are parsed fail-closed, merged into Config, and applied by NewExecutor with the prior 2m/30s defaults preserved, while the gh Available change only clarifies timeout/cancel/missing-binary errors without altering success paths.

Testing

Verified global config parsing/defaults, repo-config inertness, invalid rejection, and that config.yaml timings are applied by NewExecutor to the reconcile interval/timeout path. Targeted tests and an operator example load (5m/2m) all passed.

Evidence: operator global config example (5m / 2m)
# ~/.no-mistakes/config.yaml (global-only)
# Raise parked approval-gate reconcile budget for slow gh auth probes.
gate_reconcile_interval: "5m"
gate_reconcile_timeout: "2m"
Evidence: LoadGlobal+Merge operator path transcript

operator config.yaml loaded: gate_reconcile_interval=5m0s gate_reconcile_timeout=2m0s

=== sample operator ~/.no-mistakes/config.yaml ===
# ~/.no-mistakes/config.yaml (global-only)
# Raise parked approval-gate reconcile budget for slow gh auth probes.
gate_reconcile_interval: "5m"
gate_reconcile_timeout: "2m"

=== LoadGlobal + Merge for raised slow-auth budget (5m / 2m) ===
=== RUN   TestLoadGlobal_GateReconcileTimings_OperatorSlowAuthBudget
    config_global_test.go:269: operator config.yaml loaded: gate_reconcile_interval=5m0s gate_reconcile_timeout=2m0s
--- PASS: TestLoadGlobal_GateReconcileTimings_OperatorSlowAuthBudget (0.00s)
PASS
ok  	github.com/kunchenguid/no-mistakes/internal/config	0.505s

=== invalid values are rejected at load time ===
=== RUN   TestLoadGlobal_InvalidGateReconcileTimings
--- PASS: TestLoadGlobal_InvalidGateReconcileTimings (0.00s)
PASS
ok  	github.com/kunchenguid/no-mistakes/internal/config	0.248s

=== repo .no-mistakes.yaml cannot widen the budget (global-only) ===
=== RUN   TestLoadRepo_GateReconcileTimingsAreNotRepoSettings
--- PASS: TestLoadRepo_GateReconcileTimingsAreNotRepoSettings (0.00s)
PASS
ok  	github.com/kunchenguid/no-mistakes/internal/config	0.246s

=== shipped defaults stay 2m / 30s ===
=== RUN   TestDefaultConfigYAML_MatchesGoDefaults
--- PASS: TestDefaultConfigYAML_MatchesGoDefaults (0.00s)
PASS
ok  	github.com/kunchenguid/no-mistakes/internal/config	0.236s
Evidence: NewExecutor applies config timings to reconcile

PASS TestExecutor_AppliesGateReconcileTimingsFromGlobalConfig; PASS TestExecutor_AppliesGateReconcileIntervalFromGlobalConfig

=== NewExecutor applies config.yaml timings to parked-gate reconcile ===
(no SetGateReconcileTimings override — production wiring only)

=== RUN   TestExecutor_AppliesGateReconcileTimingsFromGlobalConfig
--- PASS: TestExecutor_AppliesGateReconcileTimingsFromGlobalConfig (0.06s)
=== RUN   TestExecutor_AppliesGateReconcileIntervalFromGlobalConfig
--- PASS: TestExecutor_AppliesGateReconcileIntervalFromGlobalConfig (0.08s)
PASS
ok  	github.com/kunchenguid/no-mistakes/internal/pipeline	0.440s

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

✅ **Review** - passed

✅ No issues found.

✅ **Test** - passed

✅ No issues found.

  • go test -count=1 ./internal/config/ -run 'GateReconcile|DefaultConfigYAML_MatchesGoDefaults|LoadRepo_GateReconcile' -v
  • go test -count=1 ./internal/config/ -run 'TestLoadGlobal_GateReconcileTimings_OperatorSlowAuthBudget' -v
  • go test -count=1 ./internal/pipeline/ -run 'TestExecutor_AppliesGateReconcile(Timings|Interval)FromGlobalConfig' -v
  • go test -count=1 ./internal/pipeline/ -run 'AppliesGateReconcile|GateRecheckIsBounded|ReconcilesParkedGate' -v
  • Operator example gate_reconcile_interval: 5m / gate_reconcile_timeout: 2m load+Merge verification recorded as evidence
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

Wrap Available() failures so context deadlines and a missing gh binary
are not reported as "gh CLI is not authenticated".

Co-authored-by: Cursor <cursoragent@cursor.com>
@greptile-apps

greptile-apps Bot commented Aug 27, 2026

Copy link
Copy Markdown

Confidence Score: 5/5

The PR appears safe to merge.

The previously reported cancellation misclassification is fixed by reporting a canceled context as an interruption while preserving context.Canceled, and no blocking failure remains.

Reviews (4): Last reviewed commit: "no-mistakes: apply agent fixes" | Re-trigger Greptile

Comment thread internal/scm/github/github.go Outdated
scs0209 and others added 5 commits August 27, 2026 19:48
Expose gate_reconcile_interval and gate_reconcile_timeout as global-only
settings (defaults 2m / 30s) so operators can raise the parked-approval
reconcile budget for slow host probes without changing the executor.

Co-authored-by: Cursor <cursoragent@cursor.com>
@scs0209 scs0209 changed the title fix(scm): distinguish gh availability failures feat(config): make gate reconcile timings configurable Aug 27, 2026
@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate:

First look at HEAD 15d0e9d0 (Fixes #833). Inspected Available(): deadline → timed out, other ctx → interrupted, missing binary → not on PATH, else wrapped auth with stderr. Global-only gate_reconcile_interval/gate_reconcile_timeout default to prior 2m/30s; repo config cannot widen. Greptile 5/5. Corrective + opt-in config; not a default gate-pass change. First-time fork CI approved. Waiting on hosted CI before merge.

VISION.md:

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.

Available() reports "gh CLI is not authenticated" for any gh auth status failure, including a timeout

2 participants