Skip to content

chore(ai): reduce duplicate Anthropic stream tests - #132462

Merged
RomneyDa merged 2 commits into
mainfrom
cleanup/tests-provider-duplicates
Aug 29, 2026
Merged

RomneyDa merged 2 commits into
mainfrom
cleanup/tests-provider-duplicates

Conversation

@RomneyDa

Copy link
Copy Markdown
Member

What Problem This Solves

Removes redundant Anthropic stream regressions that made the provider test suite repeat coverage already owned by the canonical transport stream suite.

Why This Change Was Made

The provider suite duplicated three transport-owned cases: mid-stream Fable fallback reconstruction, interleaved content-block routing, and start-event ordering after message_start. The matching cases remain in packages/ai/src/transports/anthropic-transport-stream.test.ts, where the behavior is implemented and exercised through the guarded transport boundary.

Root cause: provider-level regression coverage was added alongside equivalent lower-level transport coverage and survived later fixture deduplication. This change consolidates proof at the canonical owner without changing runtime code, fixtures, or behavior.

Production LOC: +0/-0 (net 0) | Tests: +0/-208

User Impact

No user-visible behavior changes. Contributors get a smaller, less repetitive Anthropic test suite while retaining the same owner-boundary regression coverage.

Evidence

  • node scripts/run-vitest.mjs packages/ai/src/providers/anthropic.test.ts packages/ai/src/transports/anthropic-transport-stream.test.ts — 2 files passed, 224 tests passed.
  • Verified the three named cases remain in packages/ai/src/transports/anthropic-transport-stream.test.ts.
  • git diff --check — passed.
  • Targeted oxlint for packages/ai/src/providers/anthropic.test.ts — passed.
  • node scripts/check-changed.mjs -- packages/ai/src/providers/anthropic.test.ts — all gates before core-test typecheck passed; typecheck stopped on the checkout's existing missing pako declaration (ui/vite.config.ts:9, TS7016), unrelated to this test-only deletion.
  • Structured autoreview — clean, no accepted/actionable findings.

@clawsweeper

clawsweeper Bot commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@openclaw-barnacle openclaw-barnacle Bot added size: M maintainer Maintainer-authored PR labels Aug 29, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 29, 2026
@clawsweeper

clawsweeper Bot commented Aug 29, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 29, 2026, 6:10 PM ET / 22:10 UTC.

ClawSweeper review

What this changes

The branch first removed and then restored three direct Anthropic provider stream regression tests, leaving no net change.

Merge readiness

⚠️ Needs maintainer review before merge - 2 items remain

No blocking findings: the current head introduces no diff and restores the direct-provider regressions raised in the prior review. Because this is a member-authored PR with the protected maintainer label, its no-op disposition requires a maintainer decision rather than automated closure.

Priority: P3
Reviewed head: 4d2c925c95a10481f18100617bd7bdc5f4d307fe
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🌊 off-meta tidepool The final head contains no remaining patch to assess.
Proof confidence 🌊 off-meta tidepool Not applicable: The member-authored PR has no current behavior change to exercise: the original deletion was undone and the verified introduction delta is empty.
Patch quality 🌊 off-meta tidepool No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The member-authored PR has no current behavior change to exercise: the original deletion was undone and the verified introduction delta is empty.
Evidence reviewed 4 items Verified PR introduction delta: The host-verified merge-base-to-head introduction contains zero files and an empty patch; a local name-status comparison produced no paths.
Direct-provider coverage remains on current main: Current main retains the fallback-boundary and interleaved-block tests that invoke the direct provider entry point.
The two parsers are separate owners: The provider path iterates raw SDK events, while the managed transport calls its own stream client and processes that event stream independently; the earlier test deletion would therefore have reduced distinct coverage.
Findings None None.
Security None None.

How this fits together

Anthropic provider streaming processes SDK response events into OpenClaw stream output, while the managed transport has a separate stream parser. Their tests cover similar server events at different ownership boundaries.

flowchart LR
A[Anthropic SDK response] --> B[Provider stream parser]
C[Managed transport response] --> D[Transport stream parser]
B --> E[OpenClaw stream output]
D --> E
E --> F[Regression tests]
Loading

Decision needed

Question Recommendation
Should this member-owned no-op PR be closed now that the direct-provider tests have been restored? Close the no-op PR: Close it as the earlier test-removal proposal was fully withdrawn and the current branch changes nothing.

Why: The final branch has no merge-base-to-head contribution, but the author association and protected maintainer label prohibit automated closure.

Before merge

  • Complete next step (P2) - A maintainer must decide whether to close the protected member-owned no-op branch; there is no code repair to dispatch.
Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Current-head code delta production +0/-0, tests +0/-0 The verified introduced delta is empty, so merging the current head cannot alter runtime behavior or test coverage.

Technical review

Best possible solution:

Keep the restored direct-provider regression coverage and close the no-op PR only if its member owner agrees that no narrower cleanup remains.

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

Not applicable: the current merge-base-to-head delta is empty, so this head introduces no behavior to reproduce.

Is this the best way to solve the issue?

Yes: restoring the direct-provider tests is the best outcome because the SDK-event parser and managed-transport parser remain independently implemented and tested.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P3: This is a no-op test-cleanup disposition with no user-facing or runtime impact.
  • add rating: 🌊 off-meta tidepool: Overall readiness is 🌊 off-meta tidepool; proof is 🌊 off-meta tidepool and patch quality is 🌊 off-meta tidepool. Replaced prior rating: 🦪 silver shellfish.
  • remove P2: Current review triage priority is P3, so this older priority label is no longer current.
  • remove rating: 🦪 silver shellfish: Current PR rating is rating: 🌊 off-meta tidepool, so this older rating label is no longer current.

Label justifications:

  • P3: This is a no-op test-cleanup disposition with no user-facing or runtime impact.
  • rating: 🌊 off-meta tidepool: Overall readiness is 🌊 off-meta tidepool; proof is 🌊 off-meta tidepool and patch quality is 🌊 off-meta tidepool. Replaced prior rating: 🦪 silver shellfish.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Not applicable: The member-authored PR has no current behavior change to exercise: the original deletion was undone and the verified introduction delta is empty.

Evidence

What I checked:

  • Verified PR introduction delta: The host-verified merge-base-to-head introduction contains zero files and an empty patch; a local name-status comparison produced no paths. (4d2c925c95a1)
  • Direct-provider coverage remains on current main: Current main retains the fallback-boundary and interleaved-block tests that invoke the direct provider entry point. (packages/ai/src/providers/anthropic.test.ts:1362, 10da9ac92194)
  • The two parsers are separate owners: The provider path iterates raw SDK events, while the managed transport calls its own stream client and processes that event stream independently; the earlier test deletion would therefore have reduced distinct coverage. (packages/ai/src/providers/anthropic.ts:452, 10da9ac92194)
  • Restoration commit provenance: The current head directly follows the deletion commit and is titled as retaining the direct Anthropic stream regressions. (4d2c925c95a1)

Likely related people:

  • RomneyDa: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

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 (1 earlier review cycle)
  • reviewed 2026-08-29T07:24:58.311Z sha 06d953f :: found issues before merge. :: [P1] Keep direct-provider stream regressions

@RomneyDa

Copy link
Copy Markdown
Member Author

Addressed the latest ClawSweeper rank-up moves at 4d2c925c95a:

  • Restored all three direct-provider streamAnthropic regressions. Source inspection confirmed this SDK event parser is independent from the managed fetch transport parser, so the retained transport tests were not substitute owner-boundary coverage.
  • Did not pursue parser unification: that would be a materially larger production refactor outside this test-cleanup PR.
  • Focused validation: both Anthropic suites pass together (2 files, 227 tests); targeted lint and git diff --check pass; structured autoreview is clean.
  • The earlier check-lint-core-5 failure was unrelated: src/infra/state-migrations.media-persistence.test.ts exceeded max-lines on the old merge snapshot. Current main has since removed 109 lines from that file.

The PR now has no net diff. It should not be merged as cleanup; leaving it open for maintainer disposition without manufacturing unrelated changes.

@RomneyDa
RomneyDa merged commit 36a5a4c into main Aug 29, 2026
54 checks passed
@RomneyDa
RomneyDa deleted the cleanup/tests-provider-duplicates branch August 29, 2026 22:29
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 30, 2026
* test(ai): remove duplicate Anthropic stream regressions

* test(ai): retain direct Anthropic stream regressions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: XS status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant