Skip to content

fix(test): bound direct gateway server runs - #119184

Merged
steipete merged 1 commit into
mainfrom
codex/qa-gateway-worker-stability
Aug 4, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/qa-gateway-worker-stability

Conversation

@steipete

@steipete steipete commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Summary

  • bound config-only Gateway server Vitest runs to four sequential worker processes
  • preserve the project's intentional non-isolated semantics inside each process
  • centralize Gateway server test ownership across the config, full-suite planner, and hosted-CI planner
  • remove one hosted-CI shard that contained only files owned by the Gateway core project

Closes #119180

Root cause

The Gateway server project runs with isolate: false, so a config-only invocation retained the complete module graph in one worker. Heap grew from about 430 MB to 4.06 GiB before Vitest reported Worker exited unexpectedly. Full-suite and hosted-CI paths already bounded this project, but the direct wrapper path bypassed those process plans.

The file ownership rules had also drifted: the config and full-suite planner owned 175 files, while hosted CI additionally assigned src/gateway/server/** tests that the Gateway core project already owns.

Fix

The wrapper now resolves the canonical 175-file ownership set and runs it in four balanced, sequential processes. Explicit file runs, watch mode, coverage/output workflows, shards, and alternate roots keep their existing direct Vitest behavior. The ownership predicate and target planner are shared by all runner surfaces.

Production code delta: 0 lines. This change is test infrastructure only.

Proof

  • Reproduction on main a7cca37838ac002723d7f376fa751a6f8b4ae3e5: failed twice with Worker exited unexpectedly; instrumented peak was 4.06 GiB.
  • Blacksmith Testbox tbx_01kz647jwr2vyk9wb3bmcaa0xp: the original config-only command passed 175 files / 2,670 tests in four processes.
  • Testbox run: https://github.com/openclaw/openclaw/actions/runs/30899756993
  • The same lease passed pnpm check:changed, including script/test-root typechecks, script lint, formatting, declaration, dependency, patch, duplicate, and conflict guards.
  • Local focused proof: 449 wrapper/planner/config tests plus 21 hosted-CI planner tests passed.
  • AutoReview: clean, no accepted/actionable findings.

The branch was rebased onto current origin/main after this proof without content changes; hosted PR checks bind the rebased head.

Risk

Low-to-medium and limited to test orchestration. Config-only Gateway server runs take four fresh process startups, but they now finish reliably; focused runs and specialized output/coverage modes are unchanged.

@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts size: L maintainer Maintainer-authored PR labels Aug 4, 2026
@steipete

steipete commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

Land-ready proof for head 3e7ca220c5da364a5a553565b96f0d41a9909e49:

  • Symptom: current main reproduced Worker exited unexpectedly twice. An instrumented Blacksmith Testbox run showed the one non-isolated worker grow from about 430 MB to 4.06 GiB; the host was not OOM-killed.
  • Owner/root fix: config-only Gateway server runs now reuse the existing four-process lifetime bound, while one canonical 175-file predicate owns direct, full-suite, config, and hosted-CI selection.
  • Behavior proof: Blacksmith Testbox tbx_01kz647jwr2vyk9wb3bmcaa0xp ran the original command successfully across 175 files / 2,670 tests. Run: https://github.com/openclaw/openclaw/actions/runs/30899756993
  • Broader proof: the same lease passed pnpm check:changed, including script/test-root typechecks, script lint, formatting, declarations, dependency/pin/patch, duplicate, and conflict guards.
  • Exact-head hosted CI: https://github.com/openclaw/openclaw/actions/runs/30900729218 is green, including openclaw/ci-gate, all selected Node shards, build artifacts, type/lint/guard lanes, CodeQL, OpenGrep, dependency/security guards, and workflow sanity.
  • Focused regression proof: 449 wrapper/planner/config tests plus 21 hosted-CI planner tests passed locally.
  • Final branch AutoReview: clean; no accepted/actionable findings.
  • ClawSweeper: no review comment was posted, so there are no rank-up moves to apply.

The Testbox proof preceded a clean rebase onto one unrelated TUI-test commit; the candidate tree did not change, and exact-head hosted CI covers the rebased SHA. Remaining gaps: none.

@steipete
steipete merged commit b5d41f9 into main Aug 4, 2026
104 of 107 checks passed
@steipete
steipete deleted the codex/qa-gateway-worker-stability branch August 4, 2026 10:38
@steipete

steipete commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Aug 4, 2026
…tial-gate

* origin/main:
  fix(gateway): expose OAuth-backed tools to CLI agents (#119166)
  fix(plugins): preserve metadata reloads during models status (#119183)
  fix(test): bound direct gateway server runs (#119184)
vincentkoc added a commit that referenced this pull request Aug 4, 2026
…checkpoint

* origin/main: (46 commits)
  fix(agents): recover from invalid compaction summaries (#119137)
  fix(gateway): expose OAuth-backed tools to CLI agents (#119166)
  fix(plugins): preserve metadata reloads during models status (#119183)
  fix(test): bound direct gateway server runs (#119184)
  test(tui): prove command surfaces through PTY (#119165)
  fix(testbox): restore claims across path aliases (#119170)
  fix(message): preserve sends with incidental Telegram locations
  fix(perf): give each concurrency sample a full deadline (#119164)
  fix(testbox): remove changed-gate sync residue (#119163)
  fix(telegram): preserve later chunks after rejected sends
  fix(tui): block terminal controls in system messages (#118998)
  fix(auto-reply): suppress false no-reply fallback during continuations (#119154)
  fix(scripts): prevent gateway benchmarks from stalling on probes (#119063)
  test(channels): verify built sanitizer semantics (#119151)
  fix: prevent live updater from leaving Gateway offline indefinitely (#119116)
  test(qa): restore memory tools primary ownership (#119142)
  fix(agents): settle yielded fanout at harness boundary (#118703)
  fix(codex): cap compaction override warning cache via createDedupeCache (#101745)
  fix(daemon): skip unlabeled launchd plists (#119091)
  test(qa): repair QA catalog integrity (#119140)
  ...
vincentkoc added a commit that referenced this pull request Aug 4, 2026
* origin/main: (208 commits)
  fix(telegram): route reactions to their originating forum topics
  test(gateway): isolate scheduled service timers (#119218)
  test(qa): cover Canvas agent and node controls (#119047)
  fix(cli): avoid repeated migration scans during local agent turns (#119051)
  fix(gateway): keep agents list on prepared model facts (#119208)
  fix(telegram): retry update offset persistence
  fix(ci): accept profiled partial Kova gates (#119121)
  fix(qqbot): keep channel API calls on the active account [AI] (#118575)
  fix(agents): recover from invalid compaction summaries (#119137)
  fix(gateway): expose OAuth-backed tools to CLI agents (#119166)
  fix(plugins): preserve metadata reloads during models status (#119183)
  fix(test): bound direct gateway server runs (#119184)
  test(tui): prove command surfaces through PTY (#119165)
  fix(testbox): restore claims across path aliases (#119170)
  fix(message): preserve sends with incidental Telegram locations
  fix(perf): give each concurrency sample a full deadline (#119164)
  fix(testbox): remove changed-gate sync residue (#119163)
  fix(telegram): preserve later chunks after rejected sends
  fix(tui): block terminal controls in system messages (#118998)
  fix(auto-reply): suppress false no-reply fallback during continuations (#119154)
  ...
vincentkoc added a commit that referenced this pull request Aug 4, 2026
* origin/main: (23 commits)
  chore(tui): add Gateway boundary PTY coverage (#119191)
  fix(telegram): route reactions to their originating forum topics
  test(gateway): isolate scheduled service timers (#119218)
  test(qa): cover Canvas agent and node controls (#119047)
  fix(cli): avoid repeated migration scans during local agent turns (#119051)
  fix(gateway): keep agents list on prepared model facts (#119208)
  fix(telegram): retry update offset persistence
  fix(ci): accept profiled partial Kova gates (#119121)
  fix(qqbot): keep channel API calls on the active account [AI] (#118575)
  fix(agents): recover from invalid compaction summaries (#119137)
  fix(gateway): expose OAuth-backed tools to CLI agents (#119166)
  fix(plugins): preserve metadata reloads during models status (#119183)
  fix(test): bound direct gateway server runs (#119184)
  test(tui): prove command surfaces through PTY (#119165)
  fix(testbox): restore claims across path aliases (#119170)
  fix(message): preserve sends with incidental Telegram locations
  fix(perf): give each concurrency sample a full deadline (#119164)
  fix(testbox): remove changed-gate sync residue (#119163)
  fix(telegram): preserve later chunks after rejected sends
  fix(tui): block terminal controls in system messages (#118998)
  ...
vincentkoc added a commit that referenced this pull request Aug 4, 2026
…time

* origin/main: (177 commits)
  fix(telegram): route reactions to their originating forum topics
  test(gateway): isolate scheduled service timers (#119218)
  test(qa): cover Canvas agent and node controls (#119047)
  fix(cli): avoid repeated migration scans during local agent turns (#119051)
  fix(gateway): keep agents list on prepared model facts (#119208)
  fix(telegram): retry update offset persistence
  fix(ci): accept profiled partial Kova gates (#119121)
  fix(qqbot): keep channel API calls on the active account [AI] (#118575)
  fix(agents): recover from invalid compaction summaries (#119137)
  fix(gateway): expose OAuth-backed tools to CLI agents (#119166)
  fix(plugins): preserve metadata reloads during models status (#119183)
  fix(test): bound direct gateway server runs (#119184)
  test(tui): prove command surfaces through PTY (#119165)
  fix(testbox): restore claims across path aliases (#119170)
  fix(message): preserve sends with incidental Telegram locations
  fix(perf): give each concurrency sample a full deadline (#119164)
  fix(testbox): remove changed-gate sync residue (#119163)
  fix(telegram): preserve later chunks after rejected sends
  fix(tui): block terminal controls in system messages (#118998)
  fix(auto-reply): suppress false no-reply fallback during continuations (#119154)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 5, 2026
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 6, 2026
* origin/main: (23 commits)
  chore(tui): add Gateway boundary PTY coverage (openclaw#119191)
  fix(telegram): route reactions to their originating forum topics
  test(gateway): isolate scheduled service timers (openclaw#119218)
  test(qa): cover Canvas agent and node controls (openclaw#119047)
  fix(cli): avoid repeated migration scans during local agent turns (openclaw#119051)
  fix(gateway): keep agents list on prepared model facts (openclaw#119208)
  fix(telegram): retry update offset persistence
  fix(ci): accept profiled partial Kova gates (openclaw#119121)
  fix(qqbot): keep channel API calls on the active account [AI] (openclaw#118575)
  fix(agents): recover from invalid compaction summaries (openclaw#119137)
  fix(gateway): expose OAuth-backed tools to CLI agents (openclaw#119166)
  fix(plugins): preserve metadata reloads during models status (openclaw#119183)
  fix(test): bound direct gateway server runs (openclaw#119184)
  test(tui): prove command surfaces through PTY (openclaw#119165)
  fix(testbox): restore claims across path aliases (openclaw#119170)
  fix(message): preserve sends with incidental Telegram locations
  fix(perf): give each concurrency sample a full deadline (openclaw#119164)
  fix(testbox): remove changed-gate sync residue (openclaw#119163)
  fix(telegram): preserve later chunks after rejected sends
  fix(tui): block terminal controls in system messages (openclaw#118998)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR scripts Repository scripts size: L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Gateway server config-only tests exhaust the Vitest worker heap

1 participant