fix(server): a provider probe timeout no longer marks the provider broken #7232
Closedbtsouth(GitHub profile, opens in a new tab)wants to merge 1 commit into
main fromrefs/pull/7232/headopened View on GitHubgithub-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:L
- @@ -121,4 +173,15 @@121173 return yield* Ref.get(snapshotStateRef).pipe(Effect.map((state) => state.snapshot));122174 }123175124- const nextSnapshot = yield* input.checkProvider;176+ const checkOutcome = yield* input.checkProvider.pipe(177+ Effect.tap(() => Ref.set(hasCompletedCheck, true)),178+ Effect.catchTag("ProviderProbeTimeoutError", (error) =>179+ Effect.logWarning("Provider status probe timed out.").pipe(180+ Effect.annotateLogs({181+ "provider.name": error.provider,182+ "provider.probe": error.probe,183+ "provider.probe.timeout_ms": error.timeoutMs,184+ }),185+ Effect.as(error),186+ ),187+ ),
- apps/server/src/provider/makeManagedServerProvider.ts line 163OutdatedResolvedby cursor[bot](GitHub profile, opens in a new tab)@@ -112,0 +143,21 @@143+ const checkedAt = DateTime.formatIso(yield* DateTime.now);144+ const checkedBefore = yield* Ref.get(hasCompletedCheck);145+ const next = yield* Ref.modify(snapshotStateRef, (state) => {146+ const snapshot: ServerProvider = checkedBefore147+ ? {148+ ...state.snapshot,149+ checkedAt,150+ message: `${error.message} Showing the last known status.`,151+ }152+ : {153+ ...state.snapshot,154+ checkedAt,155+ installed: error.installed,156+ status: "error",157+ message: error.message,158+ };159+ return [snapshot, { ...state, snapshot }] as const;160+ });161+ yield* PubSub.publish(changesPubSub, next);162+ return next;163+ });apps/server/src/provider/makeManagedServerProvider.ts line 177OutdatedResolvedby cursor[bot](GitHub profile, opens in a new tab)@@ -121,4 +173,5 @@121173 return yield* Ref.get(snapshotStateRef).pipe(Effect.map((state) => state.snapshot));122174 }123175124- const nextSnapshot = yield* input.checkProvider;176+ const checkOutcome = yield* input.checkProvider.pipe(177+ Effect.tap(() => Ref.set(hasCompletedCheck, true)),apps/server/src/provider/Layers/GrokProvider.ts line 275OutdatedResolvedby cursor[bot](GitHub profile, opens in a new tab)@@ -276,16 +270,6 @@276270 if (Option.isNone(discoveryExit.value)) {277- yield* Effect.logWarning(278- `Grok ACP model discovery timed out after ${GROK_ACP_MODEL_DISCOVERY_TIMEOUT_MS}ms.`,279- );280- return buildServerProvider({281- presentation: GROK_PRESENTATION,282- enabled: grokSettings.enabled,283- checkedAt,284- models: fallbackModels,285- probe: {286- installed: true,287- version,288- status: "error",289- auth: { status: "unknown" },290- message: `Grok CLI is installed but ACP startup timed out after ${GROK_ACP_MODEL_DISCOVERY_TIMEOUT_MS}ms.`,291- },271+ return yield* new ProviderProbeTimeoutError({272+ provider: "Grok",273+ probe: "ACP model discovery",274+ timeoutMs: GROK_ACP_MODEL_DISCOVERY_TIMEOUT_MS,275+ installed: true,
juliusmarminge added labelsmacroscope-review
github-actions[bot](GitHub profile, opens in a new tab) removed labelsvouch:unvouched
github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted
coderabbitai[bot](GitHub profile, opens in a new tab) approved these changes
maria-rcks closed this
maria-rcks reopened this
maria-rcks closed this
Sign in to join this conversation.


No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
⚙️ Run configuration
ab23d4a4-610e-4197-9562-3f9552fc537e📥 Commits
Reviewing files that changed from the base of the PR and between d81afa0a6f403bd6e5562ffcee2484089a1fdc3f and bb7eacceb277c9ab0d4b92dad23864f4197849d3.
📒 Files selected for processing (10)
apps/server/src/provider/ClaudeProvider.tsapps/server/src/provider/CodexProvider.tsapps/server/src/provider/CursorProvider.test.tsapps/server/src/provider/CursorProvider.tsapps/server/src/provider/GrokProvider.tsapps/server/src/provider/ProviderRegistry.test.tsdocs/internals/providers.mdpackages/provider-core/src/server/managedProvider.test.tspackages/provider-core/src/server/managedProvider.tspackages/provider-core/src/server/snapshotProbe.tsIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
📝 Walkthrough
Walkthrough#
Provider status checks now raise a typed error when a probe times out. Managed providers publish a timeout snapshot and preserve the last usable status when available. Tests cover timeout details, snapshot updates, and interrupted enrichment.
Changes#
Provider probe timeout handling
packages/provider-core/src/server/snapshotProbe.ts,apps/server/src/provider/{ClaudeProvider,CodexProvider,CursorProvider,GrokProvider}.ts,apps/server/src/provider/{CursorProvider,ProviderRegistry}.test.tsProviderProbeTimeoutErroron timeout, with provider, probe, timeout, and installation details. Tests check timeout errors and process cleanup.packages/provider-core/src/server/managedProvider.ts,packages/provider-core/src/server/managedProvider.test.ts,docs/internals/providers.mdPriority: ➖ Normal
Estimated code review effort: 3 (Moderate) | ~20 minutes
Change: Bug fix · Severity of issue fixed: Medium
Sequence Diagram(s)#
Suggested reviewers:
juliusmarmingeMerge Risk: ⚪ Minimal · up to
bb7eaA timed-out provider status check now keeps the last known good status instead of marking a working provider broken. No merge-blocking risk was identified. A first-ever check that times out on a slow machine can still show an error, as the PR describes.
Security Architecture Review#
Security architecture risk: 🔵 Low · up to
bb7eaSlow checks no longer erase usable provider status. No new privilege or credential access was established, but previously reported authentication can remain visible during repeated timeouts, and restart behavior has limitations.
Retained concerns No architecture-level concerns identified.
Security review details
Security Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
Hardening Proposals
🚥 Pre-merge checks | ✅ 3 | ❌ 1
❌ Failed checks (1 warning)#
makeManagedServerProviderpublishes the prior snapshot with a newcheckedAtand timeout message, cancels enr…✅ Passed checks (3 passed)
ProviderProbeTimeoutError, managed-provider handling, tests, and provider documentation all support#7230's timeout and persistence behavior. The implementation leaves O…Full details: Linked Issues check
Explanation
The implementation satisfies the carry-forward path after a successful non-error probe.
makeManagedServerProviderpublishes the prior snapshot with a newcheckedAtand timeout message, cancels enrichment, and leaves settings eligible for a later probe. However,hasUsableStatusstarts asfalseeven wheninitialSnapshotis a hydrated cached ready or warning snapshot. A first timeout therefore changes that snapshot tostatus: "error"and can cache the error. This does not meet#7230's requirement that every timed-out check leave the provider as it was, including after restart. The new first-boot test documents this exception instead of preventing it.✨ Finishing Touches
🧪 Generate unit tests (beta)
Comment `@coderabbitai help` to get the list of available commands.