Skip to content

fix(app): recover Connect after transient startup failures - #4782

Merged
reachjalil merged 1 commit into
devfrom
fix/connect-startup-recovery
Sep 10, 2026
Merged

reachjalil merged 1 commit into
devfrom
fix/connect-startup-recovery

Conversation

@reachjalil

@reachjalil reachjalil commented Sep 10, 2026 •

Copy link
Copy Markdown
Member

Problem

A transient startup outage can outlast the initial Connect maintenance attempt and its 1s/3s retries. The workspace then keeps showing Needs attention until another lifecycle trigger or the five-minute maintenance tick. Authentication can also recover without changing the signed-in boolean.

Changes

  • Keep the quick retries, then back off by 10s, 30s, and 60s: six attempts total, stopping on success or explicit terminal denial. The ordinary five-minute interval is unchanged.
  • Wake a pending backoff when connectivity returns without starting a duplicate maintenance run.
  • Observe authentication status and account-setting changes; pin settings to each run and cancel obsolete waits.
  • Fence probes, token mints, registrations, and readiness-marker updates against stale workspace/account context.
  • Preserve structured authorization errors. Cancellation inherited from an obsolete shared repair does not cancel its current replacement.
  • Extend the existing maintenance tests and Connect-readiness journey.

No updater change, policy bypass, forced engine reload loop, or permanent high-frequency polling is introduced. This addresses an existing recovery gap, not a demonstrated updater or network root cause. The short retry burst traces to #2779 / #2796; adjacent policy, registration, and Automation changes are not established causes.

Verification — Incomplete

Current signed head: 66fa2b65a465743c4194a1098fd0e60f855d05d5.
Rebased onto dev@d37c72280b0bf4547e6ec6b41b2e5bcfc437c293, preserving the intended five-file patch.

Passed on this head:

corepack pnpm --config.verify-deps-before-run=false --filter @openwork/app exec bun test --isolate ./tests/session-mcp-maintenance.test.ts ./src/react-app/domains/connections/use-session-mcp-maintenance.managed-degraded.test.ts
# exit 0; 18 passed, 0 failed, 0 skipped; 67 assertions
corepack pnpm --config.verify-deps-before-run=false --filter @openwork/app typecheck
# exit 0
git diff --check d37c72280b0bf4547e6ec6b41b2e5bcfc437c293...HEAD
# exit 0

The focused tests cover post-burst recovery, bounded persistent failure, explicit policy/auth denials, token-endpoint denial, online wake-up, stale cancellation and late mint, shared-repair cancellation, deduplication, and disabled intent. The earlier retry-schedule mutation demonstrated that the new recovery assertion fails with the old schedule; that is supporting component evidence, not installed-desktop proof.

Missing proof: pnpm evals:e2e connect-readiness-preseeded remains unrun. No cold-boot covering journey is claimed for this head. The extended journey sustains token-mint 503s past the old burst, restores transport, observes UI Ready before health probing, requires the task route to remain unchanged, and retains real tool/skill execution assertions. Final local review is also deferred.

Evidence clarification: the earlier 6-test/7-assertion evidence at 8f9f6d6230da9c574a6d4ac9486e640a95547b65 covers packaged boot, first launch, activation, and updater gating. It does not prove Connect startup-outage recovery and is historical after this rebase. Generic packaged-smoke evidence must not be presented as the covering recovery journey.

Earlier investigation-only static-check failures were not rerun or clean-control classified in this refresh; they are not current-head passing claims.

Remaining boundary

Server policy fetching still maps some upstream denials and transport failures to 403 policy_unavailable. The client cannot reconstruct that hidden classification: those failures remain blocked and receive bounded retries. Explicit client/token-endpoint denials stop the burst. Already-dispatched requests cannot be recalled; server policy and identity enforcement remain authoritative.

@vercel

vercel Bot commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
openwork-app Ready Ready Preview Sep 10, 2026 7:27pm UTC
openwork-den Ready Ready Preview Sep 10, 2026 7:27pm UTC
openwork-diagnostics Ready Ready Preview Sep 10, 2026 7:27pm UTC
openwork-landing Ready Ready Preview, v0 Sep 10, 2026 7:27pm UTC

@github-actions

github-actions Bot commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

Warden review summary — Clear

Native findings: 0. Blocking policy matches before consolidation: 0. Full finding text remains in Warden's native checks and review threads. This comment retains only native IDs, severity, skill attribution, and safe locations. Analysis run

Reported trigger coverage (not proof of complete repository or context coverage): diff-security-review (89467 ms), confidentiality-review (54815 ms), spec-provenance-review (91694 ms), desktop-den-sync-review (109548 ms).

Blockers

  • None.

Advisories

  • None.

Needs recheck

  • None.

Observed review-thread metrics

  • Unique observed run attempts in retained window: 2
  • Distinct heads in retained window: 2
  • Current unresolved Warden threads: 0 of 0 observed
  • Observed resolved/unresolved transitions in retained snapshots: 0 / 0
  • First observed resolved/unresolved (state at first collection, not event time): 0 / 0
  • Precision: unavailable (no adjudications; no TP/FP values are inferred)
  • Observation window: 2/20 run attempts retained; truncated: false
  • Transition snapshot: 0/0 current attributed threads retained (limit 500); truncated: false

Thread states are read-only collection snapshots. These metrics are neither lifetime totals nor exact resolution times, and this summary is not clearance authority.

@diff-warden diff-warden Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warden security clearance: clear. No blocking findings (security or desktop↔den sync) in this diff (8f9f6d6230da9c574a6d4ac9486e640a95547b65). Automated clearance satisfies the required-review gate only — a human still reviews and merges. Analysis run

@github-actions

github-actions Bot commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

Passed · 12/12 tests · 18/18 assertions · 8 images

Commit 66fa2b65a465743c4194a1098fd0e60f855d05d5 · selected evidence

Open review report

@diff-warden diff-warden Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warden security clearance: clear. No blocking findings (security or desktop↔den sync) in this diff (66fa2b65a465743c4194a1098fd0e60f855d05d5). Automated clearance satisfies the required-review gate only — a human still reviews and merges. Analysis run

This branch was successfully deployed

4 active deployments
Preview – openwork-landing — 66fa2b65 Deployed Sep 10, 2026 by vercel[bot]
Preview – openwork-app — 66fa2b65 Deployed Sep 10, 2026 by vercel[bot]
Preview – openwork-den — 66fa2b65 Deployed Sep 10, 2026 by vercel[bot]
Preview – openwork-diagnostics — 66fa2b65 Deployed Sep 10, 2026 by vercel[bot]
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.

1 participant