Skip to content

test(gateway): align placement standing grant test with check-once approvals - #201911

Merged
obviyus merged 1 commit into
mainfrom
fix/approval-placement-grant-test
Nov 19, 2026
Merged

obviyus merged 1 commit into
mainfrom
fix/approval-placement-grant-test

Conversation

@obviyus

@obviyus obviyus commented Nov 19, 2026

Copy link
Copy Markdown
Collaborator

What problem this solves

src/gateway/operator-approval-placement-grants.test.ts > "skips the second launch and re-prompts after the placement generation changes" fails on main since #201812 ("check exec approval authority once at request start"). CI's changed-file shards did not select it for that PR.

The test closed the run's placement-grant authority after the approval request started and expected resolve(…, "allow-always") to return false. That refusal came from the resolve-time run re-check that #201812 deleted on purpose: isExecApprovalRuntimeActive called the record's placement-owner assertion.

Change

Test only.

  • The resolve now records the decision (true).
  • Kept: the started launch is still refused (DENIED). Grant retention still checks the placement owner (node-invoke-placement-grant.ts:124), so no stale standing grant survives.
  • New: a later request while the authority is still closed re-prompts without allow-always or a placement binding.
  • Every other assertion is unchanged.

Evidence

  • Before refactor(gateway): check exec approval authority once at request start #201812, exec-approval-manager.ts:196 reached node-invoke-plugin-approval.ts:163-164 through record.approvalAuthority. That is a mid-request check of the requesting run's authority.
  • ocx test over every approval, standing-grant, placement-grant and consumption test file (86 files, 2,163 tests): pass. No other test fails for this cause.
  • pnpm tsgo, pnpm check:test-types, oxlint, format, and the lifetime-check and line-cap ratchets: pass.

…provals

- #201812 removed the resolve-time run re-check, so resolving allow-always after
  the placement authority closes now records the decision.
- The started launch is still refused when the grant would be retained
  (node-invoke-placement-grant), so no stale standing grant survives.
- Assert that, plus a later request while authority is closed re-prompts without
  allow-always or a placement binding.
@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 gateway Gateway runtime size: XS labels Nov 19, 2026
@obviyus
obviyus merged commit 576b221 into main Nov 19, 2026
103 checks passed
@obviyus
obviyus deleted the fix/approval-placement-grant-test branch November 19, 2026 15:48
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 20, 2026
…provals (openclaw#201911)

Problem: operator-approval-placement-grants.test.ts "skips the second launch and re-prompts after the placement generation changes" failed on main since openclaw#201812. It expected resolve(allow-always) to be refused after the run's placement-grant authority closed mid-request, which came from the resolve-time run re-check openclaw#201812 deleted on purpose. CI's changed-file shards did not select it for that PR.

Fix: test only. The resolve now records the decision. The started launch is still refused because grant retention checks the placement owner (node-invoke-placement-grant.ts), so no stale standing grant survives. A later request while authority is closed re-prompts without allow-always or a placement binding. Every other assertion is unchanged.

Proof: the target test plus every approval, standing-grant, placement-grant and consumption test file (86 files, 2,163 tests) pass; tsgo, test types, oxlint, format and the lifetime-check and line-cap ratchets pass.

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 size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant