Skip to content

test(adapters): cover buffered freeform restoration - Part 3 - #1723

Merged
lidge-jun merged 1 commit into
test/adapter-registry-conformancefrom
test/adapter-buffered-conformance
Aug 15, 2026
Merged

lidge-jun merged 1 commit into
test/adapter-registry-conformancefrom
test/adapter-buffered-conformance

Conversation

@Wibias

@Wibias Wibias commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Stack

  1. refactor(adapters): centralize runtime adapter authority - Part 1 #1721 adapter registry authority
  2. test(adapters): derive routed tool conformance from registry - Part 2 #1722 registry-derived routed-tool conformance
  3. This PR: buffered parser conformance

Why this is the third layer

The #1722 matrix did not expose a real production defect after correcting one overly literal test oracle. Rather than manufacture an apply_patch behavior change, this PR carries the remaining justified hardening from #1623: exact buffered-response restoration for adapters that expose parseResponse.

Coverage

For each registered adapter whose effective wire has a buffered fixture and whose production adapter exposes parseResponse, the test:

  • feeds a hostile freeform apply_patch payload containing quotes, backslashes, and non-ASCII text
  • parses it through the real adapter buffered parser
  • passes the resulting events through the production Responses JSON bridge
  • verifies the restored custom-tool input is byte-exact

No production code changes are included because the probe passed on current code.

Verification

Focused GitHub Actions verification of tests/adapter-buffered-tool-conformance.test.ts passed on the exact test tree before this clean single-commit branch was created.

Summary by CodeRabbit

  • Tests
    • Added conformance coverage for buffered tool calls across OpenAI, Anthropic, Google, Command Code, and Kiro response formats.
    • Verified exact preservation of multiline, Unicode, and freeform patch inputs when tool calls are reconstructed.
    • Added adapter-specific fixtures for provider configurations, model mappings, authentication, and buffered responses.

@coderabbitai

coderabbitai Bot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

🗂️ Base branches to auto review (2)
  • ^dev$
  • ^preview$

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 27f3e4ce-2060-4fef-adb5-de39f241e364

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 336f0351-ed52-4d40-bbbe-88392c88d149

📥 Commits

Reviewing files that changed from the base of the PR and between dbbfffa and 933c23b.

📒 Files selected for processing (1)
  • tests/adapter-buffered-tool-conformance.test.ts

📝 Walkthrough

Walkthrough

The PR adds buffered tool conformance tests for registered adapters. The tests cover OpenAI Chat, Anthropic, Google, Command Code, and Kiro response formats, then verify exact restoration of a multiline Unicode apply_patch input.

Changes

Buffered tool adapter conformance

Layer / File(s) Summary
Provider fixtures and response helpers
tests/adapter-buffered-tool-conformance.test.ts
Lines 1–142 define adapter mappings, provider settings, the hostile patch payload, request builders, buffered responses, Kiro event-stream framing, and restored tool-input extraction.
Registry-driven conformance assertion
tests/adapter-buffered-tool-conformance.test.ts
Lines 144–175 iterate through registered adapters, skip unsupported or compaction-only parsers, parse buffered responses, rebuild tool bridge output, and assert exact patch-input preservation.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: ⚪ Minimal · up to 933c2

This test-only change adds focused buffered-parser conformance coverage without modifying production behavior; no actionable merge-blocking risk remains after normal checks and review.

Possibly related PRs

Suggested reviewers: ingwannu, lidge-jun

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies adapter tests that cover buffered freeform restoration, which matches the main change.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch test/adapter-buffered-conformance

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added the chore Maintenance, CI, tests, refactors, or build changes (not a user-facing bug or feature). label Aug 15, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Deterministic PR hygiene checks passed.

@Wibias Wibias changed the title test(adapters): cover buffered freeform restoration test(adapters): cover buffered freeform restoration - Part 3 Aug 15, 2026
coderabbitai[bot]

This comment was marked as resolved.

@Wibias
Wibias force-pushed the test/adapter-buffered-conformance branch from e02e4c7 to 933c23b Compare August 15, 2026 01:04
@Wibias
Wibias marked this pull request as ready for review August 15, 2026 01:23
@Wibias
Wibias force-pushed the test/adapter-buffered-conformance branch from 933c23b to 3565b4e Compare August 15, 2026 01:33
@Wibias
Wibias force-pushed the test/adapter-buffered-conformance branch from 3565b4e to 41cbf52 Compare August 15, 2026 02:04
@Wibias
Wibias force-pushed the test/adapter-buffered-conformance branch from 41cbf52 to 7786939 Compare August 15, 2026 02:04
@Wibias
Wibias force-pushed the test/adapter-buffered-conformance branch from 7786939 to 3b05a27 Compare August 15, 2026 02:14
@lidge-jun
lidge-jun merged commit 9edfecb into dev Aug 15, 2026
26 checks passed
@Wibias
Wibias deleted the test/adapter-buffered-conformance branch August 15, 2026 09:41
agentHits pushed a commit to agentHits/opencodex that referenced this pull request Sep 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Maintenance, CI, tests, refactors, or build changes (not a user-facing bug or feature).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants