Skip to content

chore(tests): speed up gateway session patch coverage - #118633

Merged
steipete merged 1 commit into
mainfrom
codex/test-perf-large5-gateway-core
Aug 3, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/test-perf-large5-gateway-core

Conversation

@steipete

@steipete steipete commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

The gateway-core test group spent roughly 24 seconds loading bundled provider policy artifacts inside the session-patch projection suite. That suite validates patch behavior, while the provider policy artifact resolver already has dedicated contract coverage.

Why This Change Was Made

The session-patch suite now supplies deterministic provider thinking profiles through its existing mocked dependency boundary. All patch cases and assertions remain intact, including OpenAI xhigh and runtime-sensitive Luna max/ultra behavior; the real bundled artifact and thinking-policy contracts remain covered by their owner suites.

User Impact

There is no product behavior change. The gateway-core test group completes substantially faster with unchanged test coverage.

Evidence

  • Focused file, same host: 88 tests, 38.37s before to 11.43s after.
  • Exact gateway-core owner group, two workers, same host: 180.65s before to 138.34s after (42.31s / 23.4% faster).
  • Gateway-core count unchanged: 258 files / 4,643 tests.
  • Gateway-client count unchanged: 71 files / 656 tests.
  • Auto Review: clean, no accepted/actionable findings.
  • Formatting: clean.
  • Changed gate remote delegation was unavailable. Local core test type checking reached two unrelated current-tree failures in packages/terminal-core/src/ansi.ts and ui/src/app-session-route-paths.ts; the changed file has no type errors.

@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime size: XS maintainer Maintainer-authored PR labels Aug 3, 2026
@steipete steipete self-assigned this Aug 3, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. labels Aug 3, 2026
@clawsweeper

clawsweeper Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 3, 2026, 7:11 AM ET / 11:11 UTC.

ClawSweeper review

What this changes

The PR replaces bundled provider-thinking artifact resolution in the gateway session-patch test suite with deterministic OpenAI profile mocks, reducing test runtime without changing production behavior.

Merge readiness

✅ Ready for maintainer review

This PR remains necessary: current main does not contain the test isolation, and the proposed mock preserves the session-patch suite’s validation cases while moving provider-policy behavior to its existing owner tests. The maintainer label requires explicit maintainer handling, but no patch defect or merge-specific risk was found.

Priority: P3
Reviewed head: c680cc09f024fcc360832f152b5564f5c26abfdc

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) This is a focused, owner-boundary-aligned test optimization with concrete benchmark evidence and no actionable correctness finding.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): The PR body provides same-host before/after focused and owner-group timing results with unchanged test counts, directly demonstrating the intended test-only performance improvement.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The PR body provides same-host before/after focused and owner-group timing results with unchanged test counts, directly demonstrating the intended test-only performance improvement.
Evidence reviewed 5 items PR test-boundary change: The branch adds a hoisted mock for the provider-thinking resolver and installs deterministic gpt-5.5 and runtime-sensitive gpt-5.6-luna profiles before each session-patch test, leaving the patch assertions intact.
Production owner boundary: Session patching delegates thinking-level behavior to shared thinking validation; that shared layer resolves provider profiles through the plugin-policy resolver rather than embedding provider policy in gateway code.
Provider-policy contract coverage: The OpenAI provider-policy suite already verifies GPT-5.5 xhigh support, GPT-5.6 Luna max support, and runtime-sensitive Ultra behavior, so the mocked gateway suite does not become the sole owner of those policy contracts.
Findings None None.
Security None None.

How this fits together

Gateway session patches update stored agent-session settings such as model and thinking level. The patch validator consults shared thinking-level logic, which reads provider profiles from plugin metadata and policy artifacts before accepting or rejecting a session update.

flowchart LR
  A[Gateway session patch request] --> B[Session patch projection]
  B --> C[Thinking-level validation]
  C --> D[Provider profile resolver]
  D --> E[Plugin metadata and policy artifacts]
  C --> F[Updated session or validation error]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests +35. Total +35 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 36 1 +35
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 36 1 +35

Review metrics

Metric Value Why it matters
Production vs. test LOC production +0, tests +35 The entire net change is test-only mock setup, matching the stated test-runtime objective without expanding runtime behavior.

Stored data model

Persistent data-model change detected: serialized state: src/gateway/sessions-patch.test.ts, unknown-data-model-change: src/gateway/sessions-patch.test.ts. Confirm migration or upgrade compatibility proof before merge.

Technical review

Best possible solution:

Land the focused test isolation after normal maintainer review and required checks, while retaining provider-specific profile contracts in extensions/openai/provider-policy-api.test.ts.

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

Not applicable: this PR optimizes test execution rather than reporting a user-facing defect. Its body supplies same-host before/after timings and unchanged test counts for the affected suite.

Is this the best way to solve the issue?

Yes. Mocking the provider-policy boundary in the gateway projection suite is the narrowest maintainable approach because dedicated OpenAI policy tests retain the real profile contract coverage.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against fe6fa891ea4e.

Labels

Label changes:

  • add P3: This is a narrow test-performance cleanup with no claimed user-facing or production behavior change.
  • add proof: sufficient: Contributor real behavior proof is sufficient. The PR body provides same-host before/after focused and owner-group timing results with unchanged test counts, directly demonstrating the intended test-only performance improvement.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body provides same-host before/after focused and owner-group timing results with unchanged test counts, directly demonstrating the intended test-only performance improvement.

Label justifications:

  • P3: This is a narrow test-performance cleanup with no claimed user-facing or production behavior change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body provides same-host before/after focused and owner-group timing results with unchanged test counts, directly demonstrating the intended test-only performance improvement.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body provides same-host before/after focused and owner-group timing results with unchanged test counts, directly demonstrating the intended test-only performance improvement.

Evidence

What I checked:

  • PR test-boundary change: The branch adds a hoisted mock for the provider-thinking resolver and installs deterministic gpt-5.5 and runtime-sensitive gpt-5.6-luna profiles before each session-patch test, leaving the patch assertions intact. (src/gateway/sessions-patch.test.ts:19, c680cc09f024)
  • Production owner boundary: Session patching delegates thinking-level behavior to shared thinking validation; that shared layer resolves provider profiles through the plugin-policy resolver rather than embedding provider policy in gateway code. (src/gateway/sessions-patch.ts:397, fe6fa891ea4e)
  • Provider-policy contract coverage: The OpenAI provider-policy suite already verifies GPT-5.5 xhigh support, GPT-5.6 Luna max support, and runtime-sensitive Ultra behavior, so the mocked gateway suite does not become the sole owner of those policy contracts. (extensions/openai/provider-policy-api.test.ts:51, fe6fa891ea4e)
  • Current-main and release check: The supplied current main commit is still fe6fa891, and the proposed head is not its ancestor; no local release tag contains the proposed commit. The performance isolation is therefore not already implemented or shipped. (src/gateway/sessions-patch.test.ts:3, fe6fa891ea4e)
  • Feature-history provenance: The current session-patch test and provider-thinking resolver lines trace to the recent gateway/provider-policy consolidation commit, while the proposed isolation is a follow-on commit by the same area contributor. (src/gateway/sessions-patch.test.ts:1, 8edfa5ee5250)

Likely related people:

  • steipete: Peter Steinberger introduced the recent session-patch/provider-thinking consolidation and authored this focused follow-up isolation. (role: recent gateway and provider-policy contributor; confidence: high; commits: 8edfa5ee5250, c680cc09f024; files: src/gateway/sessions-patch.test.ts, src/plugins/provider-thinking.ts, extensions/openai/provider-policy-api.test.ts)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@steipete
steipete merged commit 3c085c1 into main Aug 3, 2026
106 of 114 checks passed
@steipete
steipete deleted the codex/test-perf-large5-gateway-core branch August 3, 2026 11:17
@steipete

steipete commented Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

@clawsweeper

clawsweeper Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper status: review started.

I am starting a fresh review of this pull request: chore(tests): speed up gateway session patch coverage This is item 3/3 in the current shard. Shard 3/25.

This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking.

Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gateway Gateway runtime maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. 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.

1 participant