Repository navigation
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
|
Codex review: needs maintainer review before merge. What this changesThis PR records access-loss causes and stops terminal reconnects while pacing retries for known policy transitions. Example: A connected visitor loses their access grant and receives WebSocket close 4001.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR addresses a distinct post-connect reconnect loop that remains on main; no actionable introduced defect was found. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherGateway access owners enforce profile and plugin grant lifetimes, then send denial details to the shared protocol client and its browser and Node adapters. flowchart LR
A[Profile and plugin lifetimes] --> B[Gateway access owner]
B --> C[Handshake denial or socket close]
C --> D[Shared error contract]
D --> E[Browser and Node adapters]
E --> F[Pause or paced fresh admission]
Technical reviewBest possible solution: Keep cause recording in the existing access owners and retry classification in the shared protocol contract, with every retry undergoing fresh admission. Do we have a high-confidence way to reproduce the issue? Main's post-connect 4001 close lacks a classified connection error, allowing automatic retry; the supplied regressions target that path, but this read-only review ran no target code. Is this the best way to solve the issue? The change is a focused repair using existing authorization, protocol, and adapter owners; it addresses reconnect behavior without claiming to identify the original shared invalidation trigger. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against da5333972ac1. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +150, Tests +257, Docs +21, Other +2. Total +430 across 24 files. Added test files: 1. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. LabelsLabel changes: No label changes. Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReviewed November 11, 2026, 1:06 PM ET / 18:06 UTC (Revision 3). |
Keep the diagnostic codec in its existing protocol owner, preserve the received close message, and identify quiesced plugin lifetimes before lifecycle abort. Remove the extra extraction dependency and a redundant terminal-set guard. Keep access enforcement and the transient retry allowlist unchanged.
|
Addressed both open items on final head
The evidence boundary is explicit: the trusted-proxy Gateway fixture, lines 510–548 exercises real Gateway grant-revocation close emission; the two-person owner fixture, lines 14–82 covers shared profile/grant/retired/quiescing-instance causes. Native and browser client regressions separately cover terminal and paced recovery. The four browser E2E cases use a mock Gateway; the screenshots are not claimed as a combined real-Gateway/browser integration test. The original shared production trigger remains unproven pending coded-close evidence after deployment. @clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Merged via squash.
|
…97299) * fix: stop reconnect loops after Gateway access is revoked * fix: keep access diagnostics in the shared error contract Keep the diagnostic codec in its existing protocol owner, preserve the received close message, and identify quiesced plugin lifetimes before lifecycle abort. Remove the extra extraction dependency and a redundant terminal-set guard. Keep access enforcement and the transient retry allowlist unchanged.
What Problem This Solves
Fixes repeated failed turns when a connected client's access authority ends: post-connect 4001 closes previously reconnected automatically and hid different invalidation causes behind the same inactive-account message.
User Impact
Terminal access failures now show the existing access-denial recovery screen and wait for an explicit Connect action. Recognized policy transitions permit fresh admission with a minimum 30-second delay and existing jitter/backoff. Handshake admission and live enforcement remain fail closed; revoked work never regains authority.
Why This Change Was Made
The access owner records a bounded, identity-free cause before invalidation reaches clients. GatewayOperatorAccessDeniedError, handshake details, and 4001 close reasons/logs distinguish grant revocation, profile failure, plugin retirement, and unavailable or failed policy checks. Unknown failures remain terminal. Both client adapters use the same closed cause contract, while unrelated closes and the native client's existing clean pre-hello retry retain their behavior.
This does not identify the original shared invalidation trigger. The diagnostic distinction lets subsequent observations distinguish profile publication/fencing from plugin lifetime retirement. There are no configuration, cache, or database schema changes. The documented fail-closed Gateway-ingress boundary remains intact; retry is fresh admission, never restored authority for a revoked run.
Evidence
Focused regressions fail on the original owner/client paths and pass with this change. The trusted-proxy fixture covers inactive required access, missing policy, a briefly unavailable policy callback, retained independent grants, coded revocation, profile alias retirement, and staff access. Shared-owner fixtures invalidate two synthetic people together.
pnpm check:changed --base 3a6cc6597d1d1d32a4bef83fd3041fedf5f48e76completed on the final head: every check passed except 57 production plus 32 full-tree dead-export signatures, reproduced identically on exact parent3a6cc6597d1d1d32a4bef83fd3041fedf5f48e76, with zero added/removed signatures. These are main regressions, not noise; attribution is retained below. Other changed checks, including typechecks, UI boundaries, schema guards, and line allocations, passed.Healthy-owner overhead uses the existing committed access-authority callback benchmark: 40 real plugin instances, 64 caller scopes, 1/2/4/8 checks per operation, five paired samples with separate A/A controls and timing/allocation passes. Assertion and scope-entry counts are unchanged.
Final CPU changes range from -0.5% to +0.6%; sampled allocation from -0.5% to +1.3%. The one-check allocation increase (+52.4 B/op) is retained, as is the two-check wall p95 increase of 1.3%. Separate A/A CPU medians varied by -2.1% to +0.5%; host load ranged 16.9–26.3. This is an in-memory owner measurement, not a performance improvement claim. Production-shaped 35 GiB/thousands-session/62k-file btrfs proof remains uncovered: existing scale drivers do not exercise these auth failures against their storage. No unused synthetic ballast or production data was used. Production confirmation requires the new cause codes in subsequent 4001s after deployment.
The first CI run found a missing extracted-wrapper dependency and a startup-size overage. The repaired candidate folds the codec into the existing connect-error contract, deleting the added module/re-export edge; all 23 extraction tests pass. Native quiescence now has an explicit cause regression. The final-head CI performance gate passes: startup gzip 91,847 → 92,051 B (+204), below the unchanged 92,137 B limit, with 3 requests before and after. Local macOS startup gzip is 92,142 B, five bytes above that limit; this is retained as a local measurement, not claimed as a local pass. The initial CI candidate was 92,292 B versus its base's 91,847 B. Exact-parent local startup is 91,905 B. CSS totals are identical on the exact parent and candidate (326,942 B gzip / 1,686,681 B raw); the comparison contract permits holding that inherited overage. No performance budget was increased.
Production LOC grows by 150 for the missing shared diagnostic contract and its owner/transport integration; tests add 257 lines, documentation 21, and test allocation configuration 2. No new access scan, cache, or authority check is introduced.
Inherited dead-export attribution on the exact parent
The 89 signatures match the exact-parent replay. Introducers were traced through the exported symbols and their owner history:
9b7dcdc7a66dc1bbcb0767b8109e798eb826954e/ #196767b22f35f7ed76552778bc185cc65a6177e8ad8b02/ #1969912c4e34a72f490c710bc155319fcabf872f482b3e/ #1967245f2f21a7ee193fdd4aa8ac42a407eefc04905255/ #196388625945b7ae01d5eea91aba5285da1a327b2a5f9f/ #192552f63e5cd0f6d38f1d0438978255d9e244183864c3/ #190205964fa991c0aff81e2ae46a0c9f99ebc0ab349d1a/ #132716071f606eae77a13f6c4c161da009dd2ba31a1c10/ #13991133d8f24c9926f8b291b71785c5b4dea4181a8128/ #129184a7436c8b4a93bff59d099661d2b206bb0627ac2b(direct commit)cf1ae7bb6a729a7f13a28ca2ef9d6f108c00566f/ #190544c7152f3bda8e52c24fc2fda83911e7e1c24fb0f2/ #19620780ba593b8b14bb3f5ddd6634a92805e04707b25c/ #19625256617cd00086481212d29745ed71f5feb8a40b9e/ #19132637a3b162a0c58aaceb1634aaef726d0e178a529c/ #196380Separate main repairs #197260, #197271, and #196862 have landed. This PR does not duplicate those repairs.