Skip to content

test(gateway): delete stale mid-run refusal tests after one-time admission - #204081

Merged
obviyus merged 1 commit into
mainfrom
fix/admission-stale-tests
Nov 23, 2026
Merged

obviyus merged 1 commit into
mainfrom
fix/admission-stale-tests

Conversation

@obviyus

@obviyus obviyus commented Nov 23, 2026

Copy link
Copy Markdown
Collaborator

Result

Closes the main-CI part of R6 A-class (one-admission) per ONE-ADMISSION-PLAN.md.

Scheduled main CI run 45175216085 (head e6b910b, the first run with all R6 PRs) is red in the 31 test files below (plus 8 support files they use). Each red case asserts a refusal that the one-time-admission work removed on purpose: a permission, role, scope, device or membership change after the request or run started. AGENTS.md "Check authority one time": a started request may finish; queued and replayed work is checked again when it starts.

This PR deletes those cases and the helpers only they used. Refusals at admission, refusals of the next request, Stop, run-close and data-fence refusals stay. Where only the refusal text changed, the expected text is updated.

  • 39 test files changed, +314 / −2092 (net −1778). No production change.
  • Files with deleted cases: 35. Files kept with updated expectations only: 4 (member-profile-role-recovery, server.plugin-reload-send-revocation.product.test-support, question.communication, chat.abort-session-fence.rpc).

Per file

File Action Why
server-methods/stop.test.ts deleted 3 cases caller loses authority during client invalidation / transport / Stop preparation (#203488). Signal cancellation and admission stay.
server-methods/presence.test.ts deleted 1 sub-case authority loss after the location lookup (#203488). Connection refresh stays.
server-methods/system-event-routing.test.ts deleted 3 cases recheck after target capture; revocation during automation discovery / commit (#203488).
server-methods/question.own-run.test.ts deleted 2 cases + 2 assertions answer fence after client invalidation / revocation (#203488). Foreign-root isolation and next-producer admission stay.
server-methods/question.session-access.test.ts deleted 4 cases request authority closes during worker preparation; held answer recheck (#203488). Observer close and session identity stay.
server-methods/question.recovery.test.ts deleted 1 case stopped observer refused when its client authority closes (#203488).
server-methods/question.communication.test.ts kept, 1 assertion deleted creator/admin vs. assignee is a real boundary; only the direct-handler invalidation assertion went. Admission still refuses invalidated callers (method-authorization.ts).
server-methods/sessions-groups.create.test.ts deleted 3 cases scope / connection revocation at transaction or commit (#203488).
server-methods/tool-usage.test.ts deleted 1 case authority expires during catalog preparation (#203488).
server-methods/sessions-title.test.ts deleted 3 cases connection change during profile preparation; role / agent access revoked during inference (#203488). Disconnect, replacement, abort stay.
server-methods/environments.suggested-profile.test.ts deleted 1 case adoption refused after revocation (#203488). Config-conflict case stays.
server-methods/chat.abort-authorization.test.ts deleted 7 cases revocation after synchronous cancellation; original source/target fence ×5 (#203488).
server-methods/chat.abort-cascade.test.ts deleted 1 case caller revoked during parent cancellation (#203488).
server-methods/chat.abort-persistence.test.ts deleted 1 case revocation fences later worker cancellation (#203488).
server-methods/chat.abort-session-fence.rpc.test.ts kept, updated exact target, foreign requester and unreadable-state Stop fences stay; the read-only caller is now refused at Stop admission instead of during the session read.
server-methods/sessions.abort-native-descendants.test.ts deleted 1 variant + 2 assertions revocation during native cancellation (#203488). Foreign requester refused at admission stays.
server-methods/chat-pending-inputs-dismiss-handler.test.ts deleted 1 case session write revoked after admission (#203488).
server-methods/agents-create.test-support.ts (agents-mutate.test.ts) deleted 1 case recheck after workspace preparation (#203488).
server-methods/agent.reset-and-identity.test-utils.ts, agent.base.test-utils.ts (agent.test.ts) deleted 1 case + 1 assertion prepared identity after the client loses authority; injected hasCurrentClientAuthority: () => false (#203488). Owner cancellation stays.
worker-environments/provider-create-authority.test.ts deleted 3 cases caller refused after installation / provider preparation / provisioning (#203488).
worker-environments/provider-destroy-authority.test.ts deleted 4 cases revoked queued deletion ×2, forced-cleanup upgrade, terminal discard. Lifecycle, durable discard, admission stay.
github-publication-imported-actions.test.ts deleted 4 cases "rechecks explicit … requester before the write". Admission and data conflict stay.
agents-create.inference-authority.integration.test.ts deleted 1 sub-case revocation during the inference probe. Scope admission and detached-request admission stay.
mcp-http.async-scope.test.ts deleted 1 sub-case captured-requester liveness inside a started run (#203892). Grant ceilings and token revocation stay.
mcp-http.personal-authority.test.ts deleted 2 checks 401 after a mid-run revocation and after turn completion: the removed grant receipt re-check (#203892).
server.chat-membership-authority.product.test.ts deleted 2 sub-cases membership revoked during authorization; caller profile replaced during authorization. Session-replacement data fence, next-request refusal and admitted-turn completion stay.
server.config-security-policy.test.ts deleted 2 cases revoked requester before publishing prepared root / include config. Close-ordering cases stay.
server.plugins-install-authority.test.ts deleted 4 rows staged / disconnected / index / runtime revocation during a started install, and the index-write probe only they used. Authorized and reconnect rows stay.
server.openclaw-id-member-suspension.test.ts deleted 1 marker steered input joins the running turn (#202513). Queued follow-up and automation start refusals stay.
server.plugin-reload-send-revocation.product.test-support.ts kept, text updated the replay-start refusal stays; the expected text is the current message "Restart recovery could not admit this input. Start a new user turn." (#204037).
openclaw-id/member-profile-role-recovery.test.ts kept, expectation updated recovery is a start, so a member demoted to read-only is refused when the recovered chat starts (#203521: a start needs operator.sessions.write). Running work keeps going.
server-http.openai-compat.test.ts deleted 3 cases "… stream=false: policy changed" (#203590). Completion and disconnect stay.
server.guest-history-http.test.ts deleted 2 scenarios membership re-read during JSON / SSE delivery (#203847). Unauthorized admission and next-request refusal stay.
worker-environments/local-workspace-projection.test.ts + local-workspace-{cancellation,incremental,recovery,reuse}.test-support.ts deleted 12 cases + helpers authority closure during projection, warm reuse, guest receipts and interrupted checkpoints (#203760/#203788). Stop, cancellation, disposal, replacement, conflict stay.

Not in this PR

Evidence

  • Red on main: scheduled run 45175216085, every file in the table.
  • Head: PR CI on this branch (see checks).
  • Local vitest-source: the touched files pass, except cases that time out under host load. Those cases pass in main CI and this PR does not change them.
  • oxfmt and oxlint clean on changed files.

…ssion

Closes the main-CI part of R6 A-class (one-admission). Deletes test cases that assert a refusal after a permission, role, scope, device or membership change during a started request or run. Admission, next-request, Stop, run-close and data-fence refusals stay; their expected text follows the current messages.

Co-authored-by: obviyus <[email protected]>
@clawsweeper

clawsweeper Bot commented Nov 23, 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: XL labels Nov 23, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. 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. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 23, 2026
@clawsweeper

clawsweeper Bot commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR removes obsolete mid-request permission-refusal tests and updates retained admission and recovery expectations.

Example: Carol is removed from a session after opening its HTTP history stream.

  • Before: The test expects the existing stream to stop publishing.
  • After: The test preserves successful streaming coverage and verifies that Carol’s next history request returns 404.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Useful, focused test cleanup supported by source and harness checks; broad CI is still incomplete.
Proof confidence 🦐 gold shrimp (3/6) This PR changes tests only; exact-head CI exercises retained Gateway harnesses, and no new shipped behavior requires contributor demonstration.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Test only · Worth it: Yes · Fix scope: Complete
User problem: Contributors encounter false CI failures when selected Gateway tests still expect retired mid-request permission refusals.
Reason: The maintainer-authored cleanup implements the documented and already-merged admission direction without changing runtime behavior.

Merge readiness

✅ Ready for maintainer review

Keep open: this useful test cleanup follows the accepted one-time admission contract, and no actionable patch defect was found.

Priority: P2
Reviewed head: cada11478f1ec3c7bf372857791b20cdf1bf0a8b

Before merge

None.

Findings

None.

Agent review details

How this fits together

Gateway tests send RPC and HTTP requests through admission and handler fixtures, then check responses, cancellation, recovery, and persisted effects.

flowchart TD
A[Gateway test fixtures] --> B[RPC and HTTP admission]
B --> C[Admitted request handlers]
C --> D[Cancellation and data fences]
D --> E[Response and state assertions]
Loading

Technical review

Best possible solution:

Land the focused test cleanup once the existing required CI gate passes.

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

Source inspection confirms that removed expectations require permission rechecks deliberately retired by merged admission changes; historical discussion records matching base failures, but no local reproduction was run.

Is this the best way to solve the issue?

Removing obsolete expectations and unused helpers is appropriate because the existing admission owners remain authoritative and distinct cancellation, next-request, session-identity, and recovery coverage remains.

AGENTS.md: found and applied where relevant.

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

Provenance checked

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit fdd81a2 adds src/gateway/worker-environments/local-workspace-projection.test.ts:142 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: fdd81a257108; files: src/gateway/worker-environments/local-workspace-projection.test.ts)
  • Josh Avant: Raw commit c89a8d5 adds src/gateway/worker-environments/provider-destroy-authority.test.ts:21 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: c89a8d5c85ba; files: src/gateway/worker-environments/provider-destroy-authority.test.ts)

PR surface

Tests -1778. Total -1778 across 39 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 39 314 2092 -1778
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 39 314 2092 -1778

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Review metrics

Metric Value Why it matters
Production versus test changes Production +0/−0; tests and support +314/−2092 The reduction removes obsolete refusal cases and their scaffolding without adding runtime machinery.

Labels

Label changes:

  • add P2: Stale admission expectations create false CI failures for Gateway work, warranting normal-priority repair.
  • 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:

  • P2: Stale admission expectations create false CI failures for Gateway work, warranting normal-priority repair.
  • 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 execution lanes are retired.

Reviewed November 23, 2026, 8:59 AM ET / 13:59 UTC.

@obviyus
obviyus merged commit 6587c9f into main Nov 23, 2026
143 checks passed
@obviyus
obviyus deleted the fix/admission-stale-tests branch November 23, 2026 14:14
@obviyus

obviyus commented Nov 23, 2026

Copy link
Copy Markdown
Collaborator Author

Landed as 6587c9f. Proof: all 31 test files (and agent, agents-mutate, plugin-reload product tests through the changed support files) were red on main in scheduled run 45175216085, and they pass in PR CI run 45186590679 with 0 failures. Tests only; local review clean.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 24, 2026
…ssion (openclaw#204081)

Closes the main-CI part of R6 A-class (one-admission) per ONE-ADMISSION-PLAN.md. Deletes test cases that assert a refusal after a permission, role, scope, device or membership change during a started request or run. Admission, next-request, Stop, run-close and data-fence refusals stay; their expected text follows the current messages. Tests only.

Co-authored-by: Ayaan Zaidi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gateway Gateway runtime P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: XL 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