Skip to content

fix(desktop): recover credentials before engine readiness - #4718

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

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

Conversation

@reachjalil

@reachjalil reachjalil commented Sep 10, 2026 •

Copy link
Copy Markdown
Member

Summary

Recover trusted desktop credentials before engine readiness without starting provider materialization, and keep startup failures actionable instead of leaving an empty window. Follow-up to #4711.

  • Add a host-only identity-delivery endpoint that verifies managed policy while suspending provider synchronization. Full session delivery and provider synchronization remain readiness-gated.
  • Keep identity delivery separate from successful full-session delivery. Preserve endpoint/identity/runtime isolation, cancel obsolete work, and avoid premature fallback on older servers that do not support the new endpoint.
  • Preserve existing credentials and configuration on same-identity resume; do not force disposal of a busy engine. Actual identity changes and sign-out retain cleanup.
  • Render startup content before the entry bundle mounts, show progress while bootstrap/architecture/sign-in checks are pending, and expose Reload on loading/error screens. Bootstrap rejection reaches the existing error boundary without bypassing sign-in or policy gates.
  • Extend existing component, server, and journey coverage; no new journey files or dependency changes.

Compatibility and containment

  • Remote, hostless, non-loopback, and gateway exclusions remain enforced.
  • Legacy full-session delivery continues to start synchronization. An older server's identity-endpoint 404 does not trigger the full-session endpoint before readiness.
  • The server-boundary test asserts no early provider config/environment/engine writes, later materialization, and unchanged config/environment with zero non-GET engine requests during same-identity resume while busy.
  • Reload preserves the current route and retained profile; the desktop journey requires an editable composer after recovery.
  • This does not change upstream authorization/rate-limit error classification or interrupted-sign-out inventory cleanup. Those remain separate concerns.

Verification — Incomplete

Candidate: c8cfcdd7def1b8a1d9c054387483a1d1a9b4a2ec
Base and merge base: 00b0a1613bba00c785ae74934c0b6ed6cb5b2d8d (dev)

Passed on the committed, rebased candidate (all exit 0; no failures or skips):

Check Result
pnpm --filter @openwork/app exec bun test --isolate ./tests/session-provider-auth-server-sync.test.ts ./tests/cloud-provider-sync-gateway.test.ts ./tests/app-error-boundary.test.tsx ./tests/boot-state.test.ts 72 passed
pnpm --filter openwork-server exec bun --conditions=development test src/cloud-provider-sync.e2e.test.ts src/cloud-provider-sync-reload-guard.test.ts 21 passed
pnpm evals:pr specs/managed-provider-env-delivery-reload.test.ts 1 passed; isolated local HTTP boundary
pnpm evals:e2e app-render-crash-recovery --local 1 passed
pnpm evals:e2e reliable-app-recovery --local 1 passed
pnpm --filter @openwork/app typecheck Passed
pnpm --filter openwork-server typecheck Passed
git diff --check origin/dev...HEAD Passed

Both desktop runs reported: selection: engine=legacy surface=legacy case=all; placement: local (--local).

Remaining clearance

  • Final-head evidence publication was attempted with the three saved journey runs, but the publisher exited 1 because OPENWORK_REVIEW_URL is not configured. Test results above passed locally; their full evidence reports are not published. Configure the review endpoint and publish the existing runs without rerunning them.
  • pnpm warden:check failed with exit 1 because the configured review authentication was unavailable. The scope was 17 changed files/60 chunks. Expected: diff-security-review, confidentiality-review, spec-provenance-review, desktop-den-sync-review. No applicable skill established completed coverage; skipped output is not clearance. No validated finding IDs were produced. Head/base were unchanged before and after the attempt.
  • Review run: a2cec4f1-2026-09-10T00-13-35-547Z.
  • Pending/rejected startup promises are covered at component level. The desktop journeys verify actual render-crash reload and fatal-startup recovery, not every entry-bundle/bootstrap-IPC stall or every operating-system failure.
  • A full cross-platform/enterprise deployment matrix was not run. Passing focused checks are not a zero-regression guarantee.
  • Clear when the applicable final policy review completes without blockers and final-head journey evidence is inspectable on this PR. This PR is ready for review, not a merge or deployment authorization.

@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 12:16am UTC
openwork-den Ready Ready Preview Sep 10, 2026 12:16am UTC
openwork-diagnostics Ready Ready Preview Sep 10, 2026 12:16am UTC
openwork-landing Ready Ready Preview, v0 Sep 10, 2026 12:16am UTC

@github-actions

Copy link
Copy Markdown
Contributor

Passed · 3/3 tests · 4/4 assertions · 2 images

Commit c8cfcdd7def1b8a1d9c054387483a1d1a9b4a2ec · selected evidence

Open review report

@reachjalil
reachjalil enabled auto-merge (squash) September 10, 2026 00:20
@github-actions

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 (138540 ms), confidentiality-review (216466 ms), spec-provenance-review (249589 ms), desktop-den-sync-review (318040 ms).

Blockers

  • None.

Advisories

  • None.

Needs recheck

  • None.

Observed review-thread metrics

  • Unique observed run attempts in retained window: 1
  • Distinct heads in retained window: 1
  • 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: 1/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 (c8cfcdd7def1b8a1d9c054387483a1d1a9b4a2ec). Automated clearance satisfies the required-review gate only — a human still reviews and merges. Analysis run

@reachjalil
reachjalil merged commit 1c455cf into dev Sep 10, 2026
28 checks passed
yomgui added a commit that referenced this pull request Sep 10, 2026
…e-delivered

Since #4718 the desktop pushes its Den session twice per launch or reload
(identity, then sync). Each PUT bumped the managed-policy generation, so any
enforcement check in flight failed with 409 policy_identity_changed even though
the account never changed; the restricted member's opencode-config write came
back 409 instead of the policy's 403. Bump the generation only when the
baseUrl, token, or orgId actually differ.
yomgui added a commit that referenced this pull request Sep 11, 2026
…implified Library add flow (#4741)

* fix(app): hide the Dialog popup synchronously on dismiss

Base UI keeps a closing Dialog mounted until its exit animation ends, so the
Library add picker and the Add workspace MCP modal stayed visible for the
100 ms fade-out after Escape. Hide the overlay and popup with data-closed:hidden
(entrance motion unchanged), matching the AlertDialog and command palette fix.

* fix(server): keep policy checks alive when the same Den identity is re-delivered

Since #4718 the desktop pushes its Den session twice per launch or reload
(identity, then sync). Each PUT bumped the managed-policy generation, so any
enforcement check in flight failed with 409 policy_identity_changed even though
the account never changed; the restricted member's opencode-config write came
back 409 instead of the policy's 403. Bump the generation only when the
baseUrl, token, or orgId actually differ.

* test(evals): observe the account menu closing before asserting its absence

The dropdown menu has no exit motion, yet its unmount is still a React commit
away from the Escape key event; on Daytona the first notSee inspection landed
33 ms later while the menu was still mounted. Follow command-palette-search:
wait for the menu popup to leave the DOM, then hold the strict absence window.

This branch was successfully deployed

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