Skip to content

test(gateway): exercise profile authorization in lifetime fixture - #146536

Closed
steipete wants to merge 1 commit into
mainfrom
codex/ws-profile-lifetime-fixture
Closed

steipete wants to merge 1 commit into
mainfrom
codex/ws-profile-lifetime-fixture

Conversation

@steipete

@steipete steipete commented Sep 12, 2026 •

Copy link
Copy Markdown
Contributor

Withdrawn: the original diagnosis was incorrect

The auxiliary test.lifetime method already requires profile authorization. At both affected head 8da309b61d8d0af965402d83105bf5e7d54ea081 and current main, src/gateway/methods/registry.ts defaults non-core method descriptors to profileAccess: "required". The original claim that this method skips identity synchronization was wrong.

Changing the fixture to sessions.list passes all 11 focused lifetime/registry tests and exact-head CI, but that does not demonstrate a repair of the original shared-worker timeout. This PR is withdrawn rather than landing an unsupported fix. Production LOC is unchanged; test LOC is +2.

The original failure remains recorded in the profile-authorization lifetime job. The canonical investigation associated with #146508 is examining an in-flight Vitest mock/unmock resolution race. Its applicability to this particular failure still requires proof in the original execution order.

This also addresses the latest review's request to reconcile the root-cause claim before merge.

@clawsweeper

clawsweeper Bot commented Sep 12, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime size: XS maintainer Maintainer-authored PR labels Sep 12, 2026
@steipete
steipete marked this pull request as ready for review September 12, 2026 22:39
@steipete
steipete requested a review from a team as a code owner September 12, 2026 22:39
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 12, 2026
@clawsweeper

clawsweeper Bot commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 12, 2026, 6:46 PM ET / 22:46 UTC.

ClawSweeper review

What this changes

Changes the Gateway request-lifetime fixture to use the profile-dependent sessions.list method through its existing handler override.

Merge readiness

⛔ Blocked before merge - 2 items remain

Keep open: the fixture change is valid and preserves the lifetime assertions, with no introduced correctness defect found. However, the stated timeout mechanism conflicts with current source and needs clarification; maintainer-protected work is not eligible for automatic closure.

Priority: P3
Reviewed head: cff39b9235454fb2802699258d41028db8ae1933

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A small, sound fixture change preserves meaningful assertions, although its failure explanation needs reconciliation with current source.
Proof confidence 🌊 off-meta tidepool Not applicable: The supplied maintainer-author context exempts this test-only PR from contributor runtime proof; the reported 11 passing cases are test validation, not independently observed production behavior.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The supplied maintainer-author context exempts this test-only PR from contributor runtime proof; the reported 11 passing cases are test validation, not independently observed production behavior.
Evidence reviewed 7 items Verified introduced change: The pinned merge-base-to-head diff changes only the fixture method and its handler registration. All four delay cases and the completion/state-selection assertions remain intact; the read-only diff check passed.
Supported authorization and override path: The router awaits profile synchronization when the registry requires a profile. Its existing registry builder explicitly permits local harnesses to override classified core handlers while retaining their policy descriptors.
Current source contradicts the reported mechanism: Current main defaults non-core descriptors, including auxiliary handlers, to required profile access. Therefore the old test.lifetime registration should also enter identity synchronization; the claimed auxiliary-method bypass is not established by current source.
Findings None None.
Security None None.

How this fits together

The Gateway dispatches authenticated WebSocket requests through method authorization before invoking their handlers. This fixture checks that dispatch remains pending until asynchronous preparation and handler work finish, preserving the caller’s selected state directory.

flowchart LR
  A[Fixture request] --> B[WebSocket dispatcher]
  B --> C[Method registry]
  C --> D[Profile synchronization]
  D --> E[Controlled handler]
  E --> F[Dispatch completes]
  F --> G[Caller restores state selection]
Loading

Before merge

  • Resolve merge risk (P2) - The historical timeout’s cause remains unresolved: current source requires profiles for the original auxiliary method, and the linked failure log was inaccessible through the reviewer’s allowed network.
  • Complete next step (P2) - Reconcile the PR body’s timeout explanation with the current auxiliary-method profile requirement and identify the affected failing revision.
Agent review details

Security

None.

PR surface

Tests +2. Total +2 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 4 2 +2
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 4 2 +2

Review metrics

None.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Keep the existing dispatch-lifetime coverage and supported core-method override, with a failure explanation that accurately identifies the affected revision and cause.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Keep the existing dispatch-lifetime coverage and supported core-method override, with a failure explanation that accurately identifies the affected revision and cause.

Do we have a high-confidence way to reproduce the issue?

No high-confidence current-main reproduction was established: the original auxiliary method already requires profile synchronization, and the historical failure trace could not be inspected.

Is this the best way to solve the issue?

Yes for explicitly exercising a profile-dependent core method through the existing override; whether it fixes the reported timeout is unclear because the stated cause conflicts with the inspected registry.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 9717a7635a0e.

Labels

Label changes:

  • add P3: This is a focused test-fixture adjustment with no production behavior change or demonstrated current user impact.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The supplied maintainer-author context exempts this test-only PR from contributor runtime proof; the reported 11 passing cases are test validation, not independently observed production behavior.

Label justifications:

  • P3: This is a focused test-fixture adjustment with no production behavior change or demonstrated current user impact.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The supplied maintainer-author context exempts this test-only PR from contributor runtime proof; the reported 11 passing cases are test validation, not independently observed production behavior.

Evidence

What I checked:

  • Verified introduced change: The pinned merge-base-to-head diff changes only the fixture method and its handler registration. All four delay cases and the completion/state-selection assertions remain intact; the read-only diff check passed. (src/gateway/server/ws-connection/authenticated-request-dispatch.lifetime.test.ts:65, cff39b923545)
  • Supported authorization and override path: The router awaits profile synchronization when the registry requires a profile. Its existing registry builder explicitly permits local harnesses to override classified core handlers while retaining their policy descriptors. (src/gateway/server-methods.ts:195, cff39b923545)
  • Current source contradicts the reported mechanism: Current main defaults non-core descriptors, including auxiliary handlers, to required profile access. Therefore the old test.lifetime registration should also enter identity synchronization; the claimed auxiliary-method bypass is not established by current source. (src/gateway/methods/registry.ts:46, 9717a7635a0e)
  • Latest-release comparison: The supplied latest release, v2026.9.4, contains the same non-core profile requirement. Main still contains the original fixture method, so the exact fixture change is not already incorporated; these checks do not establish that the reported timeout remains reproducible. (src/gateway/methods/registry.ts:46, 3a9d69db306c)
  • Existing registry coverage: Registry tests explicitly require profiles for sessions.list and an auxiliary method. The proposed method therefore exercises an existing policy contract without adding production policy or a new test seam. (src/gateway/methods/registry.test.ts:152, cff39b923545)
  • Validation evidence and inspection boundary: The captured PR body reports 11 passing lifetime/registry cases. GitHub confirms the linked job failed at revision 8da309b, but its log download redirected to a blocked artifact host, so the specific failure trace was not inspected. No tests were executed during this read-only review. (8da309b61d8d)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • vincentkoc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Clarify the PR body’s timeout diagnosis against the affected CI revision, acknowledging that current auxiliary methods already require profiles.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@steipete

Copy link
Copy Markdown
Contributor Author

Closing with a correction: the original auxiliary method already requires profile authorization, so the stated root cause was incorrect. Green tests and CI for the replacement fixture do not prove the original timeout is fixed. The body now records the source evidence and the separate canonical Vitest investigation (#146508); no production or test workaround from this PR will land.

@steipete steipete closed this Sep 12, 2026
@RomneyDa
RomneyDa deleted the codex/ws-profile-lifetime-fixture branch October 22, 2026 00:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gateway Gateway runtime maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant