Skip to content

fix: align Goal authority proof with admitted-run policy - #201567

Merged
steipete merged 1 commit into
mainfrom
steipete/perf-micro-main-red-goal-authority-timeout-20260919
Nov 19, 2026
Merged

steipete merged 1 commit into
mainfrom
steipete/perf-micro-main-red-goal-authority-timeout-20260919

Conversation

@steipete

@steipete steipete commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

The Goal authority E2E test timed out for 120 seconds after #201377 because its provider fixture waited for revocation to cancel an already-admitted turn before releasing that turn's response. That cancellation expectation contradicts the admission-time authority contract from #197557.

User Impact

No runtime behavior changes. The test now proves that admitted Goal work finishes, a revoked requester gets no subsequent automatic Goal turn, and explicit Stop still cancels promptly with a visible paused/interruption outcome. Existing sibling-agent restrictions and revoked-client disclosure checks remain.

Why This Change Was Made

Reuse the existing real Gateway, identified clients, provider transport, child settlement, and persisted history fixture. Release the admitted response after role revocation; separately require Stop to close the real provider socket before the Gateway drain settles and before the fixture releases its response. Policy refusal leaves the stored Goal active; Stop pauses it. Production LOC delta: 0; test delta: +51 / −30.

Thanks @obviyus for #201377, which correctly fixed occurrence authority after admission. This updates the stale downstream test rather than restoring mid-run policy checks.

Evidence

The unchanged test on 053fb62c6141c801fdd0f9bb2dfc3060a6fed912 times out at 120 seconds. The updated product test passes against the identical production tree. It checks persisted admitted completion, zero successor turns after revocation, prompt provider cancellation on Stop, and the persisted interruption note. Identical final-source A/A runs took 17.767 and 12.857 seconds of test time; it reuses one Gateway for three lifecycle scenarios. This is test timing, not a production performance claim.

All 174 focused tests passed across Goal continuation, scheduled operator recovery, and cron active-job suites, including current-policy rejection at the next admission. Codex autoreview of the complete local patch against the commit above is scoped-clean through P2, with no actionable findings. No schema, configuration, cache, or UI-imported module changes.

pnpm check:changed passed, including the timeout-race guard, targeted typecheck/lint/format, architecture guards, and both unused-export scans.

The Goal product test waited for role revocation to cancel an admitted
provider request, which #201377 correctly keeps alive under #197557.
Release that response, prove it persists while the next Goal turn is
refused, and separately verify Stop closes the provider and pauses the
Goal with its interruption note. Preserve disclosure and scope checks.

Production behavior is unchanged. Thanks @obviyus for #201377.

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

clawsweeper Bot commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@openclaw-barnacle openclaw-barnacle Bot added the gateway Gateway runtime label Nov 19, 2026
@steipete
steipete marked this pull request as ready for review November 19, 2026 02:04
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-19T02:06:40.701248Z d81be0f Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Please review final head d81be0f. The patch only updates the stale Goal authority product proof to the admission-time contract from #197557 / #201377; production LOC delta is zero. Final real-Gateway proof passed twice, all 174 focused authority/lifecycle tests passed, the full final pnpm check:changed passed, and Codex autoreview found no actionable P0–P2 findings. Explicit Stop is checked through the provider socket cancellation and persisted paused/interruption outcome using the existing Gateway drain owner.

@clawsweeper

clawsweeper Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@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. 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. 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 19, 2026
@clawsweeper

clawsweeper Bot commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

Updates the Goal authority test to allow admitted work to finish after revocation, reject subsequent turns, and verify explicit Stop cancellation separately.

Example: An operator loses their role while a delegated Goal return is awaiting its provider response.

  • Before: The test waits for provider cancellation that admission-time policy intentionally no longer triggers.
  • After: The test releases the response, verifies its persisted completion and zero successor turns, then checks Stop cancellation in a separate scenario.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Useful, focused test repair with coherent production-boundary assertions; validation is reported harness evidence and exact-head CI is still pending.
Proof confidence 🦐 gold shrimp (3/6) No user-visible runtime behavior changes; the author reports passing in-process Gateway runs using real clients and HTTP transport with a scripted provider, not a hosted model or shipped-process 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: Goal authority validation times out because its fixture expects an already-admitted turn to be cancelled by role revocation.
Reason: The maintainer-directed patch aligns coverage with the accepted request-start authority contract and preserves distinct Stop, scope, and disclosure boundaries.

Merge readiness

✅ Ready for maintainer review

This PR is a focused correction to stale Goal authority coverage; no actionable introduced defect was found, and exact-head CI remains pending.

Priority: P3
Reviewed head: d81be0f988f9d1f6394e36fcd2ce6af3cda75282

Before merge

None.

Findings

None.

Agent review details

How this fits together

The Gateway test drives authenticated WebSocket clients through Goal creation, delegated child settlement, provider HTTP transport, continuation admission, and persisted session history.

flowchart TD
 A[Identified clients] --> B[Gateway RPC]
 B --> C[Goal and child settlement]
 C --> D[Provider HTTP transport]
 D --> E[Continuation admission]
 E --> F[Session state and history]
 B --> G[Explicit Stop]
 G --> D
Loading

Technical review

Best possible solution:

Keep the focused test correction using existing admission and cancellation owners, preserving sibling restrictions and revoked-client nondisclosure.

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

The base fixture waits for cancellation before releasing an admitted response, while the production recovery owner deliberately retains admitted authority; the author reports the corresponding base timeout, and this review ran no target code.

Is this the best way to solve the issue?

The patch corrects the stale fixture contract at its existing owner and preserves cancellation through a separate real-provider-socket Stop scenario without adding production machinery.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Revocation-driven cancellation and unchanged transcript expectations changes intended behavior with a stated reason (9e86c84: The original Goal regression exercised delegated return authority, sibling denial, cancellation, and nondisclosure; the newer admission-time contract explicitly supersedes its mid-run cancellation expectation.)
  • Paused Goal outcome changes intended behavior with a stated reason (a1f9924: Stopped Goals became paused, so the earlier test expected revocation-induced cancellation to pause the Goal; this patch retains that outcome for explicit Stop.)
  • Consumed child delivery and forbidden sibling result keeps the original intent (bbefb54: The prior repair preserved delivered/consumed child state; the revised test retains that assertion and the structured forbidden result established by earlier test maintenance.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit bbefb54 adds src/gateway/chat-goal-created-authority.e2e.test.ts:433 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: bbefb54141af; files: src/gateway/chat-goal-created-authority.e2e.test.ts)
  • Heming Zeng: Raw commit 9e86c84 adds src/gateway/chat-goal-created-authority.e2e.test.ts:436 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 9e86c84aada4; files: src/gateway/chat-goal-created-authority.e2e.test.ts)

PR surface

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

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 51 30 +21
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 51 30 +21

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 LOC Production +0/-0; tests +51/-30 The growth adds distinct explicit-Stop coverage while reusing one Gateway and retaining admission and disclosure assertions.

Labels

Label changes:

  • add P3: This repairs test coverage without changing runtime behavior.
  • 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 repairs test coverage without changing runtime behavior.
  • 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 18, 2026, 9:23 PM ET / November 19, 2026, 02:23 UTC.

@steipete
steipete merged commit 1b778b6 into main Nov 19, 2026
202 of 203 checks passed
@steipete
steipete deleted the steipete/perf-micro-main-red-goal-authority-timeout-20260919 branch November 19, 2026 02:25
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 19, 2026
…1567)

The Goal product test waited for role revocation to cancel an admitted
provider request, which openclaw#201377 correctly keeps alive under openclaw#197557.
Release that response, prove it persists while the next Goal turn is
refused, and separately verify Stop closes the provider and pauses the
Goal with its interruption note. Preserve disclosure and scope checks.

Production behavior is unchanged. Thanks @obviyus for openclaw#201377.

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