Skip to content

refactor: consolidate provider streaming and discovery tests - #114475

Merged
steipete merged 1 commit into
mainfrom
codex/test-dedup-provider-phase3-b461
Aug 9, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/test-dedup-provider-phase3-b461

Conversation

@steipete

@steipete steipete commented Jul 27, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Bedrock discovery/runtime and Google transport tests repeated equivalent profile, cache, payload, replay, and streaming fixtures. Ollama’s original scope has already been superseded by #118419.

Why This Change Was Made

Rebuild three current provider-owner suites on main, extend the existing Bedrock summary fixture, and reuse Google helpers landed by #114424. Ordered one-shot responses, cache reset, fresh streams, SSE framing, abort, usage, and tool-order cases remain.

User Impact

No provider runtime behavior changes. All 214 current cases remain while tests are 446 lines smaller.

Evidence

  • Baseline and exact-head candidate both pass 3 files / 214 tests (61.03s including 46s lock wait vs 13.75s).
  • Initial focused run exposed skipped Bedrock helper definitions; restored owner-local payload/converse helpers and reran clean.
  • node scripts/check-changed.mjs passed extension typecheck, formatting, 245-rule lint and all guards. Testbox tbx_01kzke1kyr4r05acm36n47xjb7; run.
  • Autoreview clean after one round; git diff --check passed.
  • Scope: three provider tests, production +0/-0, tests +472/-918 (net -446). Ollama excluded.

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. labels Jul 27, 2026
@clawsweeper

clawsweeper Bot commented Jul 27, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 3, 2026, 6:12 AM ET / 10:12 UTC.

ClawSweeper review

What this changes

This PR consolidates private fixture and invocation helpers across Amazon Bedrock, Google, and Ollama streaming and discovery tests without changing production provider code.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

This is a useful test-only cleanup with strong submitted validation, but GitHub reports the branch as merge-conflicted and current main now has 19 additional declarations across the same provider test paths. Keep it open for a rebase that preserves those newer regressions before merge.

Priority: P3
Reviewed head: 3cc5485c5f892d6d7c9e12b0a91e9f146d9e5a5a

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The fixture refactor has strong test-preservation evidence and a bounded scope; its only material blocker is reconciling it with newer current-main regression coverage.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): The PR body provides an isolated Testbox comparison of the frozen and candidate test blobs, matching declaration/coverage totals, and a hosted changed-path validation result.
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 an isolated Testbox comparison of the frozen and candidate test blobs, matching declaration/coverage totals, and a hosted changed-path validation result.
Evidence reviewed 5 items Test-only implementation: The candidate commit changes exactly four colocated provider test files; its Bedrock discovery helpers only construct mocked model/profile responses for test cases.
Shared helpers preserve test boundaries: The candidate keeps provider-specific helpers local to each test file, including the Bedrock converse wrapper and Ollama successful-stream fixture; no production API or plugin boundary is changed.
Candidate scenario inventory retained: The ordered it/test declaration lists are identical between the frozen parent and candidate for all four files (200 declarations total), and git diff --check reports no whitespace errors.
Findings None None.
Security None None.

How this fits together

Provider plugins convert model requests into vendor-specific discovery and streaming calls, then return normalized results to OpenClaw’s shared agent runtime. These tests cover the provider boundaries for discovery, authentication, response streams, cancellation, and request handling.

flowchart LR
  A[Provider test cases] --> B[Private fixture helpers]
  B --> C[Bedrock Google and Ollama test harnesses]
  C --> D[Mocked discovery and stream responses]
  D --> E[Provider behavior assertions]
  E --> F[Regression coverage for plugin runtime]
Loading

Before merge

  • Resolve merge risk (P1) - A conflict resolution that replaces current-main test bodies with the older branch version could drop the 19 declarations added after the candidate snapshot; revalidate the resolved four-file set before merge.
  • Complete next step (P2) - GitHub reports a dirty merge and the PR carries a protected maintainer label, so the next step is an explicit maintainer-reviewed rebase rather than automated repair dispatch.
Agent review details

Security

None.

PR surface

Tests -709. Total -709 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 4 941 1650 -709
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 941 1650 -709

Review metrics

Metric Value Why it matters
Regression declarations candidate 200; current main 219 The rebase must retain the 19 provider-test declarations added after the candidate branch snapshot.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Retain the private-helper consolidation, rebase it onto current main, preserve every newer provider regression case, and validate the resolved four-file test surface on the new head.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Retain the private-helper consolidation, rebase it onto current main, preserve every newer provider regression case, and validate the resolved four-file test surface on the new head.

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

Not applicable: this PR refactors existing regression tests rather than addressing a separately reproducible user-facing bug.

Is this the best way to solve the issue?

Yes, conditionally: consolidating repeated private test setup follows the repository’s test guidance, but the branch must be rebased so the resulting helper structure retains later current-main cases.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P3: This is a test-maintenance refactor with no production, configuration, dependency, or user-visible behavior change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster 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 an isolated Testbox comparison of the frozen and candidate test blobs, matching declaration/coverage totals, and a hosted changed-path validation result.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body provides an isolated Testbox comparison of the frozen and candidate test blobs, matching declaration/coverage totals, and a hosted changed-path validation result.

Evidence

What I checked:

  • Test-only implementation: The candidate commit changes exactly four colocated provider test files; its Bedrock discovery helpers only construct mocked model/profile responses for test cases. (extensions/amazon-bedrock/discovery.test.ts:26, 3cc5485c5f89)
  • Shared helpers preserve test boundaries: The candidate keeps provider-specific helpers local to each test file, including the Bedrock converse wrapper and Ollama successful-stream fixture; no production API or plugin boundary is changed. (extensions/amazon-bedrock/index.test.ts:240, 3cc5485c5f89)
  • Candidate scenario inventory retained: The ordered it/test declaration lists are identical between the frozen parent and candidate for all four files (200 declarations total), and git diff --check reports no whitespace errors. (extensions/google/transport-stream.test.ts:105, 3cc5485c5f89)
  • Current-main coverage moved after the branch: The same four paths contain 219 declarations on current main versus 200 on the candidate, and current main history includes subsequent Google and Ollama behavior repairs. The supplied GitHub context reports this PR as mergeable state dirty. (extensions/ollama/src/stream-runtime.test.ts:1403, 3f3e59b54d1c)
  • Feature-history ownership: File history is dominated by Peter Steinberger, including the candidate refactor and the later Google/Ollama regression repairs; adjacent Ollama lifecycle coverage also has prior contributions from wahaha1223. (extensions/ollama/src/stream-runtime.test.ts:397, c2b0def1375e)

Likely related people:

  • steipete: Peter Steinberger authored the proposed consolidation and most of the recent current-main changes across these provider test paths, including Google and Ollama streaming repairs. (role: feature owner and recent area contributor; confidence: high; commits: 3cc5485c5f89, 3cadc085932a, d2047364a8fb; files: extensions/amazon-bedrock/discovery.test.ts, extensions/amazon-bedrock/index.test.ts, extensions/google/transport-stream.test.ts)
  • wahaha1223: This contributor previously changed the Ollama stream test surface for oversized-record handling, making them a relevant secondary contact for preserving that regression coverage. (role: adjacent Ollama regression contributor; confidence: medium; commits: a28219bcee4a; files: extensions/ollama/src/stream-runtime.test.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Rebase onto current main and preserve all four paths’ current regression cases.
  • Post focused validation output for the resolved head, with private values redacted.

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.

History

Review history (3 earlier review cycles)
  • reviewed 2026-07-27T09:20:37.945Z sha 3cc5485 :: needs real behavior proof before merge. :: none
  • reviewed 2026-07-31T19:13:51.655Z sha 3cc5485 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-02T12:12:39.834Z sha 3cc5485 :: needs maintainer review before merge. :: none

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Jul 31, 2026
@steipete
steipete force-pushed the codex/test-dedup-provider-phase3-b461 branch from 3cc5485 to de9f909 Compare August 9, 2026 14:26
@steipete

steipete commented Aug 9, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 9, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@steipete
steipete merged commit fc9905e into main Aug 9, 2026
95 checks passed
@steipete
steipete deleted the codex/test-dedup-provider-phase3-b461 branch August 9, 2026 14:37
@steipete

steipete commented Aug 9, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extensions: amazon-bedrock extensions: google 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: XL 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