Skip to content

fix(auth): preserve the active session after a failed handoff - #4611

Merged
benjaminshafii merged 1 commit into
devfrom
fix/handoff-session-preservation
Sep 8, 2026
Merged

benjaminshafii merged 1 commit into
devfrom
fix/handoff-session-preservation

Conversation

@benjaminshafii

Copy link
Copy Markdown
Member

Summary

  • Do not treat failed sign-in/handoff events as sign-out: preserve the active local-server session and provider state.
  • Extend the existing atomic-handoff journey to check server identity after failed persistence and spent-grant replay, using distinct policy markers for each isolated organization.
  • Preserve explicit sign-out cleanup and its fail-closed managed-policy behavior.

Verification

Final head: f97838fb3.

  • OPENWORK_EVAL_ENGINE=v1 pnpm evals:e2e cross-server-handoff-atomic-commit --local — Passed; 1 passed, 0 failed, 0 skipped.
  • OPENWORK_EVAL_ENGINE=v2 pnpm evals:e2e cross-server-handoff-atomic-commit --local — Passed; 1 passed, 0 failed, 0 skipped.
  • pnpm --filter @openwork/app typecheck — Passed.
  • Placement: local (--local), isolated Electron, Node 24.15.0 and pnpm 11.4.0.

The new server-preservation assertion failed before the production change. Final-head evidence is being published below. This PR is intentionally independent of the broader engine-parity and steering/queue baseline; it does not claim those efforts are complete.

@vercel

vercel Bot commented Sep 8, 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 8, 2026 7:33am UTC
openwork-den Ready Ready Preview Sep 8, 2026 7:33am UTC
openwork-diagnostics Ready Ready Preview Sep 8, 2026 7:33am UTC
openwork-landing Ready Ready Preview, v0 Sep 8, 2026 7:33am UTC

@benjaminshafii

benjaminshafii commented Sep 8, 2026 •

Copy link
Copy Markdown
Member Author

Test evidence — atomic handoff — Passed on v1 and v2

Final PR head: f97838fb39eb21bda1e410b2db317e305e72dfda. Both runs used placement: local (--local), isolated real Electron, Node 24.15.0 and pnpm 11.4.0. No skips or pending judgments.

v1 — cross-server-handoff-atomic-commit — Passed

Command: OPENWORK_EVAL_ENGINE=v1 pnpm evals:e2e cross-server-handoff-atomic-commit --local

Result: 1 passed, 0 failed, 0 skipped; 7/7 machine-checkable expectations passed.
Source run: evals/results/test-runs/2026-09-08T07-27-30-197Z-a-cross-server-handoff-commits-origin-credential-and-organization-atomically-or/test-run.json

v2 — cross-server-handoff-atomic-commit — Passed

Command: OPENWORK_EVAL_ENGINE=v2 pnpm evals:e2e cross-server-handoff-atomic-commit --local

Result: 1 passed, 0 failed, 0 skipped; 7/7 machine-checkable expectations passed.
Source run: evals/results/test-runs/2026-09-08T07-29-29-737Z-a-cross-server-handoff-commits-origin-credential-and-organization-atomically-or/test-run.json

Assertion evidence from both completed runs

Claim Observable witness v1 v2
Initial A enrollment is usable Renderer identity A; managed-policy HTTP 200 with A false alpha-update marker; provider-sync hasSession=true Pass Pass
Failed bootstrap persistence preserves A Failed B handoff emits error, no success; durable origin stays A; 6 server samples over 3000ms retain A policy and provider session Pass Pass
Fresh handoff commits B Renderer and durable origin switch to B; managed-policy marker becomes true; provider session present Pass Pass
Spent grant cannot disturb B Replay rejected; 6 server samples over 3000ms retain B policy and provider session Pass Pass
Restart preserves B enrollment Full quit/relaunch at the same renderer origin restores B identity and credential presence Pass Pass
Default-organization handoff preserves access boundaries New account gets one owned organization, repeat handoff reuses it, grant remains single-use, existing memberships/invitation unchanged, invited organization remains inaccessible without acceptance Pass Pass
Explicit sign-out still clears identity Real Account Sign out removes renderer credential; provider-sync hasSession=false; managed-policy HTTP 403 policy_unavailable retains fail-closed restrictions Pass Pass

Additional check: pnpm --filter @openwork/app typecheck — Passed.

The new server-preservation assertion failed before the production fix. Earlier development runs are not used as final-head proof. This evidence covers this auth fix only, not the broader steering/performance/parity effort.

@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 (f97838fb39eb21bda1e410b2db317e305e72dfda). Automated clearance satisfies the required-review gate only — a human still reviews and merges. Analysis run

@benjaminshafii
benjaminshafii merged commit ff4c873 into dev Sep 8, 2026
27 checks passed

This branch was successfully deployed

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