Skip to content

test(gateway): assert logout ordering instead of a one-second deadline in auth refresh - #168330

Merged
RomneyDa merged 1 commit into
mainfrom
test/auth-refresh-logout-ordering
Oct 10, 2026
Merged

RomneyDa merged 1 commit into
mainfrom
test/auth-refresh-logout-ordering

Conversation

@RomneyDa

Copy link
Copy Markdown
Member

What Problem This Solves

Fixes: models-auth-refresh.catalog.integration.test.ts > "retains same-account rows while renewing and discovers a replacement account" fails intermittently on loaded CI shards. It asserts that the logout round trip finishes in under 1 s while a discovery response is held; 2026.10.1 stable validation measured 1139 ms (job 114152409085).

User Impact

No user-visible change. Removes a wall-clock flake from the gateway server node lane; production code is unchanged.

Why This Change Was Made

The one-second deadline was standing in for an ordering contract: logout must revoke access without waiting for a held discovery reply. The test now asserts that contract directly:

  • exactly one discovery response is held (with pending tasks) while logout runs;
  • logout resolves { refreshed: true };
  • the revoked list has no available models and no account-two-learned row;
  • revocation publishes while the old response is still withheld (releasedHeldResponses === 0);
  • held replies are released in finally.

This is the test-only hunk from Peter's a1f6f523ad03, extracted from the still-open #165486 so it can land on its own, credited to the original author.

Evidence

  • On this branch (current main): the test passes 3/3 with node scripts/run-vitest.mjs. oxfmt and scoped oxlint are clean.
  • The test file is byte-identical on main and release/2026.10.1, and the hunk applies cleanly to both.

…e in auth refresh

The learned-catalog logout test bounded the logout round trip to 1s while a
discovery response was held, which failed on loaded CI shards (1139ms on
the 2026.10.1 stable validation). Assert the ordering the deadline stood in
for: exactly one held discovery response, logout resolves refreshed, the
revoked list has no available models or learned rows, and revocation
publishes before the held response is released.

Extracted from a1f6f52 (open PR #165486).
@clawsweeper

clawsweeper Bot commented Oct 10, 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.

@RomneyDa
RomneyDa marked this pull request as ready for review October 10, 2026 08:05
@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime size: XS labels Oct 10, 2026
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 10, 2026
@clawsweeper

clawsweeper Bot commented Oct 10, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR replaces a one-second logout assertion with checks that revocation completes before a held discovery response is released.

Example: Logout completes in 1139 ms while discovery for account-two is withheld.

  • Before: The test fails its 1000 ms deadline despite successful revocation.
  • After: The test checks that logout succeeds and account-two-learned disappears before releasing discovery, then remains absent afterward.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) A focused, source-supported test repair with meaningful boundary assertions; execution evidence is limited to the reported harness runs.
Proof confidence 🦐 gold shrimp (3/6) This MEMBER-authored, test-only PR is outside the ordinary contributor runtime-proof gate; its existing harness exercises real Gateway RPCs and HTTP discovery, and the body reports three passing runs that were not independently replayed.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Test only · Worth it: Yes · Fix scope: Complete
User problem: Loaded CI can reject correct logout behavior because a test substitutes a one-second deadline for the required ordering.
Reason: The focused change removes an arbitrary timing failure while strengthening observable revocation coverage.

Merge readiness

✅ Ready for maintainer review

Keep this PR: it makes a useful, focused test repair while preserving logout revocation coverage; no introduced defect was found.

Priority: P3
Reviewed head: fdff4e33ff95d44713c87a3d1e1170372974d565

Before merge

None.

Findings

None.

Agent review details

How this fits together

The integration test sends model RPCs through a real Gateway and controls a local HTTP discovery server to observe credential renewal, account replacement, and logout publication.

flowchart LR
  A[Test client] --> B[Gateway model RPCs]
  B --> C[Auth refresh owner]
  C --> D[Prepared model catalog]
  D --> E[HTTP discovery fixture]
  D --> F[Models list response]
Loading

Technical review

Best possible solution:

Retain the ordering-based assertions and land this focused test repair through the normal CI gates.

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

The body reports a 1139 ms CI failure, and current main contains the matching 1000 ms assertion; this read-only review did not execute tests or independently reproduce the timing failure.

Is this the best way to solve the issue?

The replacement checks the intended observable ordering through Gateway RPCs and retains the late-response rejection check without imposing a machine-speed deadline.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 7c0d4070a293.

Provenance checked

  • Logout timing assertion and held discovery response changes intended behavior with a stated reason (3d7d211: Ensure discovery cannot delay credential publication and logout rejects late account-model results.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Ayaan Zaidi: Raw commit 3d7d211 adds src/gateway/server-methods/models-auth-refresh.catalog.integration.test.ts:174 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 3d7d21166f09; files: src/gateway/server-methods/models-auth-refresh.catalog.integration.test.ts)
  • Peter Steinberger: Raw commit 4f71650 adds src/gateway/server-methods/models-auth-refresh.catalog.integration.test.ts:244 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 4f7165005bfd; files: src/gateway/server-methods/models-auth-refresh.catalog.integration.test.ts)

PR surface

Tests +14. Total +14 across 1 file. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 23 9 +14
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 23 9 +14

Labels

Label changes:

  • add P3: This is a test reliability repair with no production behavior change.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P3: This is a test reliability repair with no production behavior change.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only; repair and merge need explicit maintainer commands such as @clawsweeper autofix or @clawsweeper automerge.

Reviewed October 10, 2026, 4:10 AM ET / 08:10 UTC.

@RomneyDa
RomneyDa enabled auto-merge (squash) October 10, 2026 17:33
@RomneyDa
RomneyDa merged commit d476209 into main Oct 10, 2026
175 of 176 checks passed
@RomneyDa
RomneyDa deleted the test/auth-refresh-logout-ordering branch October 10, 2026 17:34
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 11, 2026
…e in auth refresh (openclaw#168330)

The learned-catalog logout test bounded the logout round trip to 1s while a
discovery response was held, which failed on loaded CI shards (1139ms on
the 2026.10.1 stable validation). Assert the ordering the deadline stood in
for: exactly one held discovery response, logout resolves refreshed, the
revoked list has no available models or learned rows, and revocation
publishes before the held response is released.

Extracted from a1f6f52 (open PR openclaw#165486).

Co-authored-by: Peter Steinberger <[email protected]>
RomneyDa added a commit that referenced this pull request Oct 12, 2026
…e in auth refresh (#168330)

The learned-catalog logout test bounded the logout round trip to 1s while a
discovery response was held, which failed on loaded CI shards (1139ms on
the 2026.10.1 stable validation). Assert the ordering the deadline stood in
for: exactly one held discovery response, logout resolves refreshed, the
revoked list has no available models or learned rows, and revocation
publishes before the held response is released.

Extracted from a1f6f52 (open PR #165486).

Co-authored-by: Peter Steinberger <[email protected]>
(cherry picked from commit d476209)
wheakerd pushed a commit to wheakerd/clawdbot that referenced this pull request Oct 22, 2026
…e in auth refresh (openclaw#168330)

The learned-catalog logout test bounded the logout round trip to 1s while a
discovery response was held, which failed on loaded CI shards (1139ms on
the 2026.10.1 stable validation). Assert the ordering the deadline stood in
for: exactly one held discovery response, logout resolves refreshed, the
revoked list has no available models or learned rows, and revocation
publishes before the held response is released.

Extracted from a1f6f52 (open PR openclaw#165486).

Co-authored-by: Peter Steinberger <[email protected]>
(cherry picked from commit d476209)
(cherry picked from commit 62084f6)
Co-authored-by: RomneyDa <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gateway Gateway runtime P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. 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.

2 participants