Skip to content

test(gateway): prepare tool invocation state snapshots - #174645

Merged
steipete merged 1 commit into
mainfrom
fix/gateway-tools-invoke-snapshot-fixtures-20261016
Oct 16, 2026
Merged

steipete merged 1 commit into
mainfrom
fix/gateway-tools-invoke-snapshot-fixtures-20261016

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What problem this solves

Main CI fails four HTTP tool-invocation cases and five authorization cases because their fixtures seed durable sessions without a prepared runtime-config snapshot. The session-store reader intentionally stopped importing config IO in #174414; production prepares the snapshot before request admission.

What changed

The tools-invoke test-state helper now prepares the canonical runtime snapshot inside the isolated state lifetime before running the fixture callback. Both HTTP and WebSocket authorization suites use it. Every existing assertion is preserved, including role denial, member revocation, memory-session closure, and result publication after credential revocation. Production behavior is unchanged.

This extracts the fixture repair already identified in the still-open mixed-engine PR #174387 after the red-main repair checkpoint. Sharing setup in the existing test-support owner keeps the HTTP test from growing beyond its line-cap baseline. Its only two importers are both covered below.

Proof

On main a1c6b9e820b9, the complete files reproduced 4 failures / 36 passes and 5 failures / 18 passes. After the fix, using the native gateway-database-workers config with --maxWorkers=1:

  • src/gateway/tools-invoke-http.test.ts: 40/40 passed, 203.92 seconds wall time.
  • src/gateway/tools-invoke-authorization.test.ts: 23/23 passed, 258.42 seconds wall time.
  • Targeted Gateway test typecheck, typed lint, focused boundary guards, formatting, and P2 independent review passed.
  • Import-cycle/Madge, line-cap, assertion safety, SQLite worker/dialect, timeout/mock, package/dependency, plugin-boundary, schema and Kysely checks passed.

Broader scans retain unrelated baseline failures: three UI max-lines suppressions, deprecated delivery API references, retired-state sentinel references, and existing Knip unused exports outside these three files. No baseline or suppression was changed. The full 496-file Gateway database config and original shard replays were not rerun; focused config proof covers every importer of the changed helper.

The rebases preserve patch identity. Three attempted direct main updates were refused because another commit advanced the main ref during publication; none published this patch or reran CI. This READY PR is the standing direct-push fallback.

Prepare the canonical runtime-config snapshot inside the tools-invoke state
fixture before seeding sessions. Keep all HTTP, WebSocket, revocation and
result-publication assertions unchanged while preserving the narrow snapshot
reader introduced by #174414.

Extract the fixture-only repair from still-open #174387 after the CI repair
checkpoint. The shared fixture keeps the existing HTTP test from growing past
its line cap; both of its importers are covered by the focused proof.

Native focused proof (--maxWorkers=1): tools-invoke-http 40/40, 203.92s wall;
tools-invoke-authorization 23/23, 258.42s wall. Before: 4 and 5 failures.
P2 autoreview: no actionable findings. Targeted test types passed.
Typed lint and focused boundary guards passed for all three changed files.
Additional broad guards reported existing UI max-lines suppressions and
legacy delivery API references outside this repair's scope.
@clawsweeper

clawsweeper Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review in progress

ClawSweeper is reviewing this revision. This supersedes any previous blocked status.

View the workflow run.

@steipete
steipete marked this pull request as ready for review October 16, 2026 20:31
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-16T20:34:30.036474Z e253507 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.

@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime size: XS labels Oct 16, 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. labels Oct 16, 2026
@steipete
steipete merged commit 3a19f51 into main Oct 16, 2026
188 of 192 checks passed
@steipete
steipete deleted the fix/gateway-tools-invoke-snapshot-fixtures-20261016 branch October 16, 2026 20:44
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 17, 2026
Prepare the canonical runtime-config snapshot inside the tools-invoke state
fixture before seeding sessions. Keep all HTTP, WebSocket, revocation and
result-publication assertions unchanged while preserving the narrow snapshot
reader introduced by openclaw#174414.

Extract the fixture-only repair from still-open openclaw#174387 after the CI repair
checkpoint. The shared fixture keeps the existing HTTP test from growing past
its line cap; both of its importers are covered by the focused proof.

Native focused proof (--maxWorkers=1): tools-invoke-http 40/40, 203.92s wall;
tools-invoke-authorization 23/23, 258.42s wall. Before: 4 and 5 failures.
P2 autoreview: no actionable findings. Targeted test types passed.
Typed lint and focused boundary guards passed for all three changed files.
Additional broad guards reported existing UI max-lines suppressions and
legacy delivery API references outside this repair's scope.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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. gateway Gateway runtime size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant