fix(#325): wait for app page before opening browser during install - #7125
Conversation
After the manifest flow creates a new GitHub App, GitHub may take a few seconds to provision the app page. Previously, ensureInstalled opened the browser immediately, which sometimes resulted in a 404. Add waitForAppReady() that polls GetAppClientID with bounded exponential backoff (500ms initial, 5s max, 30s timeout) before opening the browser. If the readiness check times out, the installer gracefully degrades by warning and opening the browser anyway, so manual refresh remains possible. Note: pre-commit hooks could not complete (infrastructure failure fetching remote repos). Local hooks (gofmt, go vet) were run directly and passed. Closes #325
|
🤖 Review · Commit: |
|
🤖 Finished Review · ✅ Success · Started 9:36 PM UTC · Completed 9:49 PM UTC Commit: Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $4.52 |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
|
Risk Assessment: moderate (2/5) DetailsTier 1 signals are unchanged from the prior review (2-file bot-authored change, no protected paths, no dependency changes, 50% test ratio); Tier 2 reveals elevated fix/revert history and multi-author contention on both files that partially offset the otherwise low metadata score; Tier 3 confirms tight scope alignment with the linked issue; re-review anchoring preserves the prior score of 2 (moderate). Previous runRisk Assessment: moderate (2/5) DetailsTier 1 signals are unchanged from the prior review (2-file bot-authored change, no protected paths, no dependency changes, 50% test ratio), Tier 2 signals remain consistent with active multi-author churn and elevated fix/revert history on these files, and Tier 3 signals indicate the PR directly addresses the linked issue scope; re-review anchoring preserves the prior score of 2 (moderate). Previous run (2)Risk Assessment: moderate (2/5) DetailsTier 1 signals are unchanged from the prior review (2-file bot-authored change, no protected paths, no dependency changes, 50% test ratio), and Tier 2 signals remain consistent with the prior rationale's described active multi-author churn and elevated fix/revert history on these files; re-review anchoring preserves the prior score of 2 (moderate) as no new specific signal warrants a change. Previous run (3)Risk Assessment: moderate (2/5) DetailsSmall, well-tested bot-authored bug fix with good test coverage and narrow scope, but files show active churn from an ongoing multi-author effort with a recent revert, keeping risk at moderate. |
|
Looks good to me Previous runReviewFindingsMedium
Next steps:
Previous run (2)ReviewFindingsLow
Next steps:
Previous run (3)ReviewFindingsLow
Next steps:
|
|
🤖 Finished Fix · ✅ Success · Started 9:51 PM UTC · Completed 9:59 PM UTC Commit: Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $1.19 |
When waitForAppReady returns an error because the parent context was cancelled (e.g. user Ctrl+C), ensureInstalled now returns the context error immediately instead of opening the browser. Previously the readiness timeout and context cancellation were treated identically, causing the browser to open unnecessarily on user interrupt. Note: pre-commit hooks were not run. pre-commit could not complete (infrastructure failure), and hooks were run directly instead (gofmt, go vet — both passed). Addresses #7125
🔧 Fix agent — iteration 1 (bot-triggered)Addressed the single review finding: ensureInstalled now checks ctx.Err() after waitForAppReady fails, propagating parent context cancellation instead of incorrectly treating it as a readiness timeout and opening the browser. Added a test that verifies the browser is not opened when the context is cancelled. Fixed (1):
Tests: passedNext steps:
|
|
🤖 Finished Review · ✅ Success · Started 10:01 PM UTC · Completed 10:15 PM UTC Commit: Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $3.20 |
|
🤖 Finished Fix · ✅ Success · Started 10:17 PM UTC · Completed 10:26 PM UTC Commit: Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $1.28 |
…lation Move context-cancellation detection into waitForAppReady so it returns ctx.Err() directly when the parent context is cancelled, following Go error-handling idioms. This lets ensureInstalled drop its side-channel ctx.Err() guard in favor of checking the returned error type. Also fix TestWaitForAppReady_Timeout to use the readinessTimeout field (consistent with TestEnsureInstalled_ProceedsWhenReadinessTimesOut) instead of a short parent context, so it exercises the internal readiness timeout rather than parent-context-deadline propagation. Note: pre-commit hooks were not run. `pre-commit` could not complete (infrastructure failure), and the hooks were run directly via gofmt and go vet. Addresses #7125
🔧 Fix agent — iteration 2 (bot-triggered)Addressed both review findings: (1) waitForAppReady now returns ctx.Err() for parent context cancellation per Go idiom, letting ensureInstalled drop its side-channel ctx.Err() guard; (2) TestWaitForAppReady_Timeout now uses the readinessTimeout field consistently with other timeout tests. Fixed (2):
Tests: passed Decision points
Next steps:
|
|
🤖 Finished Review · ✅ Success · Started 10:27 PM UTC · Completed 10:42 PM UTC Commit: Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $3.64 |
|
🤖 Finished Fix · ✅ Success · Started 10:43 PM UTC · Completed 10:50 PM UTC Commit: Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $1.15 |
Replace direct equality checks (== context.Canceled, == context.DeadlineExceeded) with errors.Is() in ensureInstalled to match codebase idiom and align with the test assertion (assert.ErrorIs). Addresses #7125
🔧 Fix agent — iteration 3 (bot-triggered)Replaced direct context error equality check with errors.Is() in ensureInstalled to match codebase idiom and test assertion consistency. Fixed (1):
Tests: passedNext steps:
|
|
🤖 Finished Review · ✅ Success · Started 10:52 PM UTC · Completed 11:05 PM UTC Commit: Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $3.09 |
Superseded by updated review
Superseded by updated review
|
🤖 Finished Retro · ✅ Success · Started 8:01 AM UTC · Completed 8:13 AM UTC Commit: Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $3.57 |
Retro: PR #7125 — Wait for app page before opening browser during installWorkflow: Issue #325 → triage (re-triage confirmed still relevant) → code agent → 4 review passes / 3 fix iterations → human approval → merge. Timeline
What went well
Rework analysisThe 3 review-fix cycles all addressed facets of the same error-handling concern: how
A single remediation specifying "In Existing issues with supporting evidence from this retro
Proposals filed
|
Summary
Adds a readiness check before opening the browser during
fullsend admin install. After the GitHub App manifest flow creates a new app, GitHub may take a few seconds to provision the app page — opening the install URL immediately sometimes returned a 404.The new
waitForAppReady()method pollsGetAppClientIDwith bounded exponential backoff (500ms initial interval, 5s max, 30s timeout) until the app page is reachable. If the check times out, the installer gracefully degrades by warning and proceeding to open the browser anyway.Related Issue
Changes
waitForAppReady()method with exponential backoff pollingensureInstalled()before opening the browserreadinessTimeoutfield for test configurabilityTesting
make lintpasses (stage changes first, then run)Five new tests:
TestWaitForAppReady_ImmediatelyAvailable— app ready on first checkTestWaitForAppReady_BecomesAvailableAfterRetries— app ready after 2 retriesTestWaitForAppReady_Timeout— readiness check times outTestEnsureInstalled_WaitsForAppReady— browser opens only after readiness checkTestEnsureInstalled_ProceedsWhenReadinessTimesOut— browser still opens on timeoutChecklist
!for breaking changes)Closes #325
Post-script verification
agent/325-wait-app-ready)e4749da83cc31b5b1565eb6180a09b8e24a40dc8..HEAD)