Skip to content

refactor: factor transport stream fixtures#106006

Merged
steipete merged 2 commits into
mainfrom
codex/factor-transport-stream-fixtures
Jul 13, 2026
Merged

refactor: factor transport stream fixtures#106006
steipete merged 2 commits into
mainfrom
codex/factor-transport-stream-fixtures

Conversation

@steipete

Copy link
Copy Markdown
Contributor

Closes #105965

What Problem This Solves

Large OpenAI transport and dispatch test suites repeated thousands of lines of model, stream-chunk, dispatcher, and mock construction. That repetition made high-value regression coverage harder to review and maintain.

Why This Change Was Made

Adds typed model and completion-chunk factories, folds repeated reasoning cases into named tables, and moves the dispatch suite's common mock graph and dispatcher into its existing shared harness. Responses events remain inline because their event shapes are heterogeneous; src/gateway/server-methods/agent.test.ts is intentionally untouched.

The three touched files shrink by 2,390 lines overall (1,392 additions, 3,782 deletions), while preserving every collected test.

User Impact

No user-visible runtime change. Maintainers get smaller, more legible regression suites with one canonical fixture-construction path.

Evidence

  • Blacksmith Testbox tbx_01kxcs4fmk1t3z8f4zzc4napye
  • corepack pnpm test src/agents/openai-transport-stream.test.ts: 331 before, 331 after
  • corepack pnpm test src/auto-reply/reply/dispatch-from-config.test.ts: 267 before, 267 after
  • Shared-harness sibling suites: 39 before, 39 after
  • Combined affected proof: 637 passed
  • corepack pnpm tsgo:core:test: passed
  • Targeted oxfmt --check: passed
  • Targeted scripts/run-oxlint.mjs: 0 warnings, 0 errors
  • Fresh autoreview: clean after correcting the shared-harness routability default
  • pnpm check:changed reaches the repository-wide TypeScript LOC ratchet, then stops on stale baseline entries outside these touched files

AI-assisted refactor; reviewed and validated against exact before/after test counts.

@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: XL maintainer Maintainer-authored PR labels Jul 13, 2026
@steipete

steipete commented Jul 13, 2026

Copy link
Copy Markdown
Contributor Author

Land-ready proof for head 18da0a60c7221c3074053e97ea4e808a76f7b581:

  • Blacksmith Testbox tbx_01kxcs4fmk1t3z8f4zzc4napye
  • corepack pnpm test src/agents/openai-transport-stream.test.ts src/auto-reply/reply/dispatch-from-config.test.ts src/auto-reply/reply/dispatch-from-config.acp-abort.test.ts src/auto-reply/reply/dispatch-from-config.stale-recovery.test.ts src/auto-reply/reply/dispatch-from-config.reply-dispatch.test.ts — 637 passed
  • Exact before/after counts: transport 331/331, dispatch 267/267, shared-harness siblings 39/39
  • corepack pnpm tsgo:core:test — passed
  • targeted oxfmt --check — passed
  • targeted scripts/run-oxlint.mjs — 0 warnings, 0 errors
  • fresh autoreview rerun — no accepted/actionable findings
  • net diff: 1,392 additions, 3,782 deletions (-2,390 lines)

Known gap: aggregate pnpm check:changed stops at the repository-wide TypeScript LOC ratchet because its baseline is stale for unrelated files; touched-file type, format, lint, and test proof are clean.

Update after hosted CI completed: repo-native scripts/pr prepare-run 106006 was blocked because CI run 29223610538 failed. The failing surfaces were outside this PR: both QA smoke profiles also failed on current main run 29223771886; check:test-types failed in extensions/qa-lab/src/suite.test.ts because the mock lacked artifactPointerPath and generation; and deadcode:exports reported four unused exports in ui/src/components/app-sidebar-nav-menus.ts. None of those paths were touched here. With the maintainer's explicit instruction to ignore CI and land, this PR was squash-merged as commit 5084280d55570bac6b5997f92acf3797df3cd3ff.

@steipete steipete self-assigned this Jul 13, 2026
@steipete
steipete merged commit 5084280 into main Jul 13, 2026
127 of 135 checks passed
@steipete
steipete deleted the codex/factor-transport-stream-fixtures branch July 13, 2026 05:02
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 13, 2026
* test: factor OpenAI transport fixtures

* test: share dispatch config harness
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling maintainer Maintainer-authored PR size: XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor transport stream test fixtures and shared dispatch harness

1 participant