Repository navigation
Recover unattended sessions, Gmail refresh and crashed Runtime writers - #14
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Preserve exact source and Host authority checks while persisting routing enrollment only through the existing authenticated v2 custody transition. Restore completed enrollment across lost ACKs and restart, and use the current registration for service reacquisition. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Change
Recover unattended OAuth Runtime channels after real session expiry or terminal stale-session renewal denial. Renew 5–6 minutes early, and reconcile current operator-configured registrations through the Host service-credential endpoint. Transient failures retry indefinitely with exponential jitter capped at five minutes; permanent service denial emits reconnect_required. Fresh sessions travel through the existing authenticated installer, persist encrypted, replace old workers and reconcile lost ACKs. No Send/start/result effect is retried.
Gmail refresh now keeps durable transport/verification reconciliation under the account lock, retains the last usable refresh token, and commits received credentials before later authority checks and identity GETs. Restart resumes verification with the newest credentials. invalid_grant and identity mismatch require reconnect; Microsoft uncertain rotating-token responses retain their fence.
Replace orphan-only writer ownership with a lifetime SQLite OS file lock. Hard crashes release ownership automatically; encrypted atomic row commits and Send uncertainty journals remain intact. Preserve existing file line endings, update reviewed provider adaptations/provenance, and package the new modules and regressions.
Validation
Host dependency: Maneek21/Deft#401 must release first. Existing explicit finite permissions and unreviewed upgrades keep their prior authority boundaries. This PR does not merge, release, deploy or change demo.deft.ing. See runtime/UNATTENDED-RECOVERY.md for the design and legacy-writer rollout boundary.
Final validation: latest-head CI at 61b3019 is green, including exported-artifact startup: https://github.com/Maneek21/deft-email/actions/runs/39500194997 . Writer bootstrap/read/commit and shutdown/restart checks pass (21 tests); observation latency checks pass (14); refresh, reconnect and credential-repair fences pass (22). The broad Windows run also caught an obsolete process-fixture assumption, which was corrected and rerun successfully (5 tests). Existing unchanged lines were checked byte-for-byte, including CRLF.
Connect-once integration
Require Host preview.131. Preserve the exact Host service-registration fence by teaching the Runtime to route the current registration after an authenticated v2 custody transition. Index prepared transitions before acknowledging prepare, and enroll only a connected journal with an exact receipt and matching local source/successor sessions. Reconstruct enrollment after restart and use it for data, channel installation, local jobs and service reacquisition. Operator files and secret handling remain unchanged.
The previous dispatcher failed
EMAIL_RUNTIME_REGISTRATION_DENIEDfor a Host-authorized successor unless tests first edited operator registrations and restarted. Regressions now cover two upgrades without config edits, data after restart, crash after connected journal before ACK, changed principals/Host denial, and an actual server installing both action/observation channels then reacquiring after simulated twenty-minute expiry. The Host still authorizes every operation. No provider effects are retried.Validation: provenance, App build/tests/UI, focused Runtime preview suite, v2 reattachment/installer tests, and standalone exported artifact closure/startup passed locally. Windows artifact verification used Windows bsdtar ahead of Git Bash tar, which cannot parse native drive paths. Linux CI is required before merge.
The real demo retains legacy action channel files. A second regression reproduced healthy current sessions being reinstalled repeatedly because an unrelated unattributed legacy action had ended. Scope that legacy fallback to registrations without an authenticated complete installation; the actual-server test now includes an ended legacy file and proves no reinstallation loop before or after expired-session restart.
🤖 Generated with Claude Code