Skip to content

refactor(openai-shim): extract typed request body planning - #2010

Merged
kevincodex1 merged 5 commits into
Twigpine:mainfrom
jatmn:de-mono1-request-planner
Jul 30, 2026
Merged

kevincodex1 merged 5 commits into
Twigpine:mainfrom
jatmn:de-mono1-request-planner

Conversation

@jatmn

@jatmn jatmn commented Jul 18, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Extracts transport request-body planning into openaiShim/requestPlanner.ts.

The typed planner owns Responses, Anthropic Messages, Gemini, and native Ollama body builders; compatibility environment hydration; serialization; and shared omit-tools retry state. The façade prepares provider context and delegates transport-specific body construction.

Independent merge

  • Upstream base: 0effa0f42b6dbc6a4800e19f4b2d8d588269906b.
  • Fork branch: jatmn/openclaude:de-mono1-request-planner.
  • Exact head: 1e8a2cfafb74f93eb3b970147f21d71a236c20ea.
  • All 45 pairwise combinations and full forward/reverse ten-branch merges are clean, including planner/executor shared retry state.
  • Draft upstream PR.

Source-file budget

openaiShim.ts: +59 / -339 = 398 changed lines, below 1,500; tests excluded.

Test migration

  • Monolithic test: +701 / -42; the planner-owned top-level body is removed.
  • requestPlanner.test.ts: 359 lines / 11 focused tests.
  • Focused planner plus retained façade suites: 235 passed / 638 assertions.
  • Combined result retains only three façade-contract tests in the monolithic test.

Validation

  • Diff check, typecheck, type-test check, and build passed.
  • Exact-head host bun run check: 7,196 passed / 2 skipped; only 10 pre-existing PowerShell governance failures remain on Linux.

Prepared according to CONTRIBUTING.md and AGENTS.md.

Summary by CodeRabbit

  • New Features
    • Improved compatibility with Gemini, Mistral, GitHub, Bankr, and other OpenAI-compatible providers.
    • Smarter request body planning and formatting across Responses, Anthropic Messages, Gemini, and Ollama-compatible transports, including system instructions, reasoning settings, and tool handling.
    • More reliable request serialization for stable payloads when needed.
  • Bug Fixes
    • Preserved explicitly configured credentials and prevented unwanted overwrites during provider environment setup.
  • Tests
    • Added/expanded coverage for provider environment hydration, transport-specific body planning, and serialization behavior.

@coderabbitai

coderabbitai Bot commented Jul 18, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 7b68adbe-1857-4c12-97e3-07892be4a847

📥 Commits

Reviewing files that changed from the base of the PR and between dd4d122 and 5e6f735.

📒 Files selected for processing (3)
  • src/services/api/openaiShim.ts
  • src/services/api/openaiShim/requestPlanner.test.ts
  • src/services/api/openaiShim/requestPlanner.ts
📜 Recent review details
🧰 Additional context used
📓 Path-based instructions (4)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

TypeScript code in this repository must use strict mode and ESM imports.

**/*.{ts,tsx}: Add or update tests when a TypeScript or TSX change affects behavior.
Run the relevant TypeScript validation checks for changed code, including bun run typecheck and, when applicable, bun run typecheck:type-tests.

Files:

  • src/services/api/openaiShim/requestPlanner.ts
  • src/services/api/openaiShim.ts
  • src/services/api/openaiShim/requestPlanner.test.ts
**/*

📄 CodeRabbit inference engine (CONTRIBUTING.md)

**/*: Preserve existing repository patterns unless intentionally refactoring them.
Keep changes small, readable, and focused; avoid broad rewrites or unrelated cleanup.
Do not reformat unrelated files, and keep comments useful and concise.
Update documentation when setup, commands, or user-facing behavior changes.
Review AI-generated changes for correctness, style consistency, unnecessary noise, and adherence to project architecture before submitting them.
Provider changes must follow the documented integration patterns in docs/integrations/overview.md and the focused guides under docs/integrations/how-to/.
When changing provider behavior, avoid breaking third-party providers and test the exact provider/model path changed when possible.
Provider pull requests must explicitly identify affected providers, limitations, and follow-up work.
Run the narrowest meaningful validation command for the touched area, and ensure relevant CI checks pass before merging.
Use bun install to install dependencies and the repository's Bun scripts for building, testing, smoke testing, and development.
Dependency changes require a concrete project benefit such as a bug fix, security issue, or approved feature; preference alone is insufficient.
Do not change the project's language, core runtime, or dependency stack, or introduce a new runtime, without prior maintainer agreement.
Keep each pull request focused on one issue or clearly scoped improvement and avoid bundling unrelated fixes, features, or refactors.

Files:

  • src/services/api/openaiShim/requestPlanner.ts
  • src/services/api/openaiShim.ts
  • src/services/api/openaiShim/requestPlanner.test.ts

⚙️ CodeRabbit configuration file

**/*: Apply the OpenClaude maintainer review rubric from AGENTS.md. Review the current diff, not stale discussion context. Separate real blockers from suggestions. Do not request changes for vague style churn. Treat approval as merge-ready from CodeRabbit's side, pending required human review and GitHub Checks. If checks are failing or unavailable, say so clearly instead of implying the PR is fully ready.

Files:

  • src/services/api/openaiShim/requestPlanner.ts
  • src/services/api/openaiShim.ts
  • src/services/api/openaiShim/requestPlanner.test.ts
{src/services/api/**,src/integrations/**,src/utils/model/**,src/utils/provider*.ts,src/commands/provider/**}

⚙️ CodeRabbit configuration file

{src/services/api/**,src/integrations/**,src/utils/model/**,src/utils/provider*.ts,src/commands/provider/**}: Review provider routing, model selection, env precedence, auth/token handling, OpenAI-compatible shims, retries, proxy behavior, and outbound HTTP behavior with high scrutiny. Block on silent default changes, hidden fallback expansion, credential reuse mistakes, hardcoded provider assumptions, or new network reach that is not intentional and documented.

Files:

  • src/services/api/openaiShim/requestPlanner.ts
  • src/services/api/openaiShim.ts
  • src/services/api/openaiShim/requestPlanner.test.ts
{src/**/*.test.ts,src/**/*.test.tsx,tests/**,scripts/**/*.test.ts,vscode-extension/**/*.test.js}

⚙️ CodeRabbit configuration file

{src/**/*.test.ts,src/**/*.test.tsx,tests/**,scripts/**/*.test.ts,vscode-extension/**/*.test.js}: Review tests for meaningful coverage of the changed behavior, isolation of global/env/config state, async cleanup, fake timers, provider profile leaks, and Windows-compatible assumptions. Block when risky runtime changes lack focused regression coverage or tests assert implementation details while missing the user-visible behavior.

Files:

  • src/services/api/openaiShim/requestPlanner.test.ts
🔇 Additional comments (3)
src/services/api/openaiShim/requestPlanner.ts (1)

1-40: LGTM!

Also applies to: 42-47, 103-461

src/services/api/openaiShim.ts (1)

716-722: LGTM!

Also applies to: 1454-1461, 1835-1841

src/services/api/openaiShim/requestPlanner.test.ts (1)

7-9: LGTM!

Also applies to: 12-42, 46-90, 350-412


📝 Walkthrough

Walkthrough

The OpenAI shim now delegates compatibility environment hydration and transport-specific request-body planning to requestPlanner. Tests cover provider hydration, Responses, Anthropic, Gemini, Ollama serialization, retry rebuilding, and stable JSON behavior.

Changes

OpenAI shim request planning

Layer / File(s) Summary
Compatibility environment hydration
src/services/api/openaiShim/requestPlanner.ts, src/services/api/openaiShim.ts, src/services/api/openaiShim/requestPlanner.test.ts
Moves provider aliases, Bankr defaults, and route-credential fallback into requestPlanner, wires the shim to the shared function, and tests precedence and fallback rules.
Request-body planning and serialization
src/services/api/openaiShim/requestPlanner.ts, src/services/api/openaiShim.ts, src/services/api/openaiShim/requestPlanner.test.ts
Centralizes Responses, Anthropic, Gemini, and Ollama body construction plus serialization, with coverage for field mapping, tool conversion, omission flags, retry rebuilding, and serializer selection.
Planner test setup and fixture formatting
src/services/api/openaiShim/requestPlanner.test.ts, src/services/api/openaiShim.test.ts
Adds planner construction helpers and reformats an existing fetch fixture without changing its behavior.

Estimated code review effort: 4 (Complex) | ~45 minutes

Possibly related PRs

  • Gitlawb/openclaude#2008: Both changes centralize Anthropic Messages handling for omitting tool_choice when tools are omitted.
🚥 Pre-merge checks | ✅ 6 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Risk Surface Disclosed ❓ Inconclusive PR touches provider-routing/auth-like env hydration, but no review text is provided here, so I can’t verify that the risk surface or blocker status was called out. Provide the actual review comments or approval thread; I need to confirm whether the risky provider-routing/auth surface was explicitly discussed and whether it was blocked.
✅ Passed checks (6 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise, scoped, and accurately matches the main change to typed request-body planning in openai-shim.
Description check ✅ Passed The description covers summary, testing, and validation, but omits the template's Impact and Notes sections.
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.
No Hidden Policy Change ✅ Passed No hidden policy shift: this patch extracts existing env-hydration/body-planning logic; routing, auth, telemetry, and tool-omission branches are unchanged and explicit.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/services/api/openaiShim/requestPlanner.test.ts`:
- Around line 15-18: Update the test around hydrateOpenAIShimCompatibilityEnv to
make the credential resolver stub capture its input and assert that the Bankr
base URL, https://bankr.test/v1, is supplied as baseUrl when resolving
route-key. Preserve the existing assertions for OPENAI_BASE_URL, OPENAI_MODEL,
and OPENAI_API_KEY.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: bf064e8c-4467-4232-8902-8df226082dae

📥 Commits

Reviewing files that changed from the base of the PR and between 0effa0f and 1a95f4d.

📒 Files selected for processing (3)
  • src/services/api/openaiShim.ts
  • src/services/api/openaiShim/requestPlanner.test.ts
  • src/services/api/openaiShim/requestPlanner.ts
📜 Review details
⏰ Context from checks skipped due to timeout. (2)
  • GitHub Check: smoke-and-tests (22)
  • GitHub Check: smoke-and-tests (24.11.x)
🧰 Additional context used
📓 Path-based instructions (5)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

TypeScript code in this repository must use strict mode and ESM imports.

**/*.{ts,tsx}: When changing provider behavior, avoid breaking third-party providers and test the exact provider/model path changed when possible.
Run bun run typecheck and bun run typecheck:type-tests for TypeScript changes.
Run provider tests and provider recommendation tests when changing provider behavior: bun run test:provider and bun run test:provider-recommendation.

Files:

  • src/services/api/openaiShim/requestPlanner.test.ts
  • src/services/api/openaiShim/requestPlanner.ts
  • src/services/api/openaiShim.ts
**/*

📄 CodeRabbit inference engine (CONTRIBUTING.md)

**/*: Keep changes focused on one problem or feature and avoid mixing unrelated cleanup into the same change.
Preserve existing repository patterns unless intentionally refactoring them.
Update documentation when setup, commands, or user-facing behavior changes.
Review AI-generated changes for correctness, style consistency, unnecessary changes, and adherence to project architecture before submitting them.
Follow the existing code style in touched files.
Prefer small, readable changes over broad rewrites.
Do not reformat unrelated files.
Keep comments useful and concise.
Provider changes must explicitly identify affected providers, limitations, and follow-up work in the pull request description.
Do not assign or use provider tags; provider tags are controlled by maintainers.
Run the relevant validation checks locally before submitting changes; pull requests must pass CI checks.
Run bun run security:pr-scan before submitting a pull request.
Dependency changes require a concrete project benefit, such as fixing a bug, addressing a security issue, or supporting an approved feature.
Do not change the project's language, core runtime, or dependency stack without prior maintainer agreement.

Files:

  • src/services/api/openaiShim/requestPlanner.test.ts
  • src/services/api/openaiShim/requestPlanner.ts
  • src/services/api/openaiShim.ts

⚙️ CodeRabbit configuration file

**/*: Apply the OpenClaude maintainer review rubric from AGENTS.md. Review the current diff, not stale discussion context. Separate real blockers from suggestions. Do not request changes for vague style churn. Treat approval as merge-ready from CodeRabbit's side, pending required human review and GitHub Checks. If checks are failing or unavailable, say so clearly instead of implying the PR is fully ready.

Files:

  • src/services/api/openaiShim/requestPlanner.test.ts
  • src/services/api/openaiShim/requestPlanner.ts
  • src/services/api/openaiShim.ts
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Add or update tests when a code change affects behavior.

Files:

  • src/services/api/openaiShim/requestPlanner.test.ts
  • src/services/api/openaiShim/requestPlanner.ts
  • src/services/api/openaiShim.ts
{src/services/api/**,src/integrations/**,src/utils/model/**,src/utils/provider*.ts,src/commands/provider/**}

⚙️ CodeRabbit configuration file

{src/services/api/**,src/integrations/**,src/utils/model/**,src/utils/provider*.ts,src/commands/provider/**}: Review provider routing, model selection, env precedence, auth/token handling, OpenAI-compatible shims, retries, proxy behavior, and outbound HTTP behavior with high scrutiny. Block on silent default changes, hidden fallback expansion, credential reuse mistakes, hardcoded provider assumptions, or new network reach that is not intentional and documented.

Files:

  • src/services/api/openaiShim/requestPlanner.test.ts
  • src/services/api/openaiShim/requestPlanner.ts
  • src/services/api/openaiShim.ts
{src/**/*.test.ts,src/**/*.test.tsx,tests/**,scripts/**/*.test.ts,vscode-extension/**/*.test.js}

⚙️ CodeRabbit configuration file

{src/**/*.test.ts,src/**/*.test.tsx,tests/**,scripts/**/*.test.ts,vscode-extension/**/*.test.js}: Review tests for meaningful coverage of the changed behavior, isolation of global/env/config state, async cleanup, fake timers, provider profile leaks, and Windows-compatible assumptions. Block when risky runtime changes lack focused regression coverage or tests assert implementation details while missing the user-visible behavior.

Files:

  • src/services/api/openaiShim/requestPlanner.test.ts
🔇 Additional comments (2)
src/services/api/openaiShim/requestPlanner.ts (1)

1-25: LGTM!

src/services/api/openaiShim.ts (1)

123-123: LGTM!

Also applies to: 1056-1059

Comment thread src/services/api/openaiShim/requestPlanner.test.ts Outdated
@jatmn jatmn self-assigned this Jul 18, 2026
@jatmn jatmn added the enhancement New feature or request label Jul 18, 2026
@jatmn
jatmn force-pushed the de-mono1-request-planner branch from f9b0657 to 688c6e6 Compare July 18, 2026 19:33
@jatmn jatmn changed the title refactor(openai-shim): extract request planner refactor(openai-shim): extract typed request body planning Jul 18, 2026
@jatmn
jatmn force-pushed the de-mono1-request-planner branch 2 times, most recently from 1e8a2cf to 4c2c1f8 Compare July 18, 2026 23:48
coderabbitai[bot]
coderabbitai Bot previously approved these changes Jul 18, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 6

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/services/api/openaiShim.ts (1)

1836-1841: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Collapse the stacked extraction-boundary comments.

Two boundary blocks now sit back-to-back, and "Native Ollama/body serialization remains request-planner-owned" reads as pending work when the planner already owns it. One accurate marker above Line 1842 is enough.

As per coding guidelines, "keep comments useful and concise".

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/services/api/openaiShim.ts` around lines 1836 - 1841, Consolidate the
adjacent extraction-boundary comment blocks near the executor/request
serialization transition into one concise, accurate marker above the executor
attempt loop. Remove the obsolete statement implying native Ollama/body
serialization is pending, while retaining only the boundary and lazy
serialized-body ownership details needed by the extraction.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/services/api/openaiShim.ts`:
- Around line 1454-1462: Remove buildAnthropicMessagesBody, buildGeminiBody, and
buildOllamaChatBody from the planner destructuring near
createRequestBodyPlanner; retain only the builders directly used by the
surrounding executor, including serializeBody.

In `@src/services/api/openaiShim/requestPlanner.test.ts`:
- Around line 344-355: Extend the test shared omit flags rebuild transport
bodies without tools to also cover Anthropic and Gemini planners, setting
omitTools.anthropic and omitTools.gemini and asserting their rebuilt bodies omit
both tools and tool_choice. Preserve the existing Responses assertions and use
the planner’s transport-specific body builders.

In `@src/services/api/openaiShim/requestPlanner.ts`:
- Around line 416-425: Move the stable-stringify rationale comment from above
buildOllamaChatBody to the serializeBody implementation around line 447, keeping
it adjacent to the logic that handles prefix-cache byte identity and the
skipStableStringify opt-out. Do not alter the serialization behavior or
unrelated comments.
- Around line 234-239: Update the tool_choice assignment in the request-planning
flow to use the same omitTools.anthropic guard as the tools assignment, so
toolless retries omit tool_choice when tools are omitted. Preserve existing
tool_choice behavior when Anthropic tools are included.
- Around line 42-43: Update the RequestTransport type alias to preserve
literal-member completion and narrowing while still accepting arbitrary
transport strings, using a branded open-ended string form instead of a direct “|
string” union. Ensure effectiveTransport and request.transport continue
accepting custom transport values.
- Around line 178-185: Remove the redundant inline type casts from both calls to
convertToolsToResponsesTools, including the block near the params.tools check
and the corresponding block around the later usage. Pass params.tools directly,
preserving the existing guards and conversion behavior.

---

Outside diff comments:
In `@src/services/api/openaiShim.ts`:
- Around line 1836-1841: Consolidate the adjacent extraction-boundary comment
blocks near the executor/request serialization transition into one concise,
accurate marker above the executor attempt loop. Remove the obsolete statement
implying native Ollama/body serialization is pending, while retaining only the
boundary and lazy serialized-body ownership details needed by the extraction.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 99518197-4289-47f1-ae3c-11fa2df36b1f

📥 Commits

Reviewing files that changed from the base of the PR and between 1a95f4d and dd4d122.

📒 Files selected for processing (4)
  • src/services/api/openaiShim.test.ts
  • src/services/api/openaiShim.ts
  • src/services/api/openaiShim/requestPlanner.test.ts
  • src/services/api/openaiShim/requestPlanner.ts
📜 Review details
⏰ Context from checks skipped due to timeout. (3)
  • GitHub Check: smoke-and-tests (24.11.x)
  • GitHub Check: typecheck
  • GitHub Check: smoke-and-tests (22)
🧰 Additional context used
📓 Path-based instructions (4)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

TypeScript code in this repository must use strict mode and ESM imports.

**/*.{ts,tsx}: Add or update tests when a TypeScript or TSX change affects behavior.
Run the relevant TypeScript validation checks for changed code, including bun run typecheck and, when applicable, bun run typecheck:type-tests.

Files:

  • src/services/api/openaiShim/requestPlanner.test.ts
  • src/services/api/openaiShim/requestPlanner.ts
  • src/services/api/openaiShim.test.ts
  • src/services/api/openaiShim.ts
**/*

📄 CodeRabbit inference engine (CONTRIBUTING.md)

**/*: Preserve existing repository patterns unless intentionally refactoring them.
Keep changes small, readable, and focused; avoid broad rewrites or unrelated cleanup.
Do not reformat unrelated files, and keep comments useful and concise.
Update documentation when setup, commands, or user-facing behavior changes.
Review AI-generated changes for correctness, style consistency, unnecessary noise, and adherence to project architecture before submitting them.
Provider changes must follow the documented integration patterns in docs/integrations/overview.md and the focused guides under docs/integrations/how-to/.
When changing provider behavior, avoid breaking third-party providers and test the exact provider/model path changed when possible.
Provider pull requests must explicitly identify affected providers, limitations, and follow-up work.
Run the narrowest meaningful validation command for the touched area, and ensure relevant CI checks pass before merging.
Use bun install to install dependencies and the repository's Bun scripts for building, testing, smoke testing, and development.
Dependency changes require a concrete project benefit such as a bug fix, security issue, or approved feature; preference alone is insufficient.
Do not change the project's language, core runtime, or dependency stack, or introduce a new runtime, without prior maintainer agreement.
Keep each pull request focused on one issue or clearly scoped improvement and avoid bundling unrelated fixes, features, or refactors.

Files:

  • src/services/api/openaiShim/requestPlanner.test.ts
  • src/services/api/openaiShim/requestPlanner.ts
  • src/services/api/openaiShim.test.ts
  • src/services/api/openaiShim.ts

⚙️ CodeRabbit configuration file

**/*: Apply the OpenClaude maintainer review rubric from AGENTS.md. Review the current diff, not stale discussion context. Separate real blockers from suggestions. Do not request changes for vague style churn. Treat approval as merge-ready from CodeRabbit's side, pending required human review and GitHub Checks. If checks are failing or unavailable, say so clearly instead of implying the PR is fully ready.

Files:

  • src/services/api/openaiShim/requestPlanner.test.ts
  • src/services/api/openaiShim/requestPlanner.ts
  • src/services/api/openaiShim.test.ts
  • src/services/api/openaiShim.ts
{src/services/api/**,src/integrations/**,src/utils/model/**,src/utils/provider*.ts,src/commands/provider/**}

⚙️ CodeRabbit configuration file

{src/services/api/**,src/integrations/**,src/utils/model/**,src/utils/provider*.ts,src/commands/provider/**}: Review provider routing, model selection, env precedence, auth/token handling, OpenAI-compatible shims, retries, proxy behavior, and outbound HTTP behavior with high scrutiny. Block on silent default changes, hidden fallback expansion, credential reuse mistakes, hardcoded provider assumptions, or new network reach that is not intentional and documented.

Files:

  • src/services/api/openaiShim/requestPlanner.test.ts
  • src/services/api/openaiShim/requestPlanner.ts
  • src/services/api/openaiShim.test.ts
  • src/services/api/openaiShim.ts
{src/**/*.test.ts,src/**/*.test.tsx,tests/**,scripts/**/*.test.ts,vscode-extension/**/*.test.js}

⚙️ CodeRabbit configuration file

{src/**/*.test.ts,src/**/*.test.tsx,tests/**,scripts/**/*.test.ts,vscode-extension/**/*.test.js}: Review tests for meaningful coverage of the changed behavior, isolation of global/env/config state, async cleanup, fake timers, provider profile leaks, and Windows-compatible assumptions. Block when risky runtime changes lack focused regression coverage or tests assert implementation details while missing the user-visible behavior.

Files:

  • src/services/api/openaiShim/requestPlanner.test.ts
  • src/services/api/openaiShim.test.ts
🔇 Additional comments (7)
src/services/api/openaiShim/requestPlanner.ts (3)

1-40: LGTM!


241-273: LGTM!

Also applies to: 277-414


447-470: LGTM!

src/services/api/openaiShim.ts (1)

86-89: LGTM!

Also applies to: 719-722

src/services/api/openaiShim/requestPlanner.test.ts (2)

1-43: LGTM!

Also applies to: 45-91, 93-152, 154-203, 205-304


357-366: LGTM!

src/services/api/openaiShim.test.ts (1)

1331-1336: LGTM!

Also applies to: 1372-1372

Comment thread src/services/api/openaiShim.ts Outdated
Comment thread src/services/api/openaiShim/requestPlanner.test.ts
Comment thread src/services/api/openaiShim/requestPlanner.ts Outdated
Comment thread src/services/api/openaiShim/requestPlanner.ts Outdated
Comment thread src/services/api/openaiShim/requestPlanner.ts
Comment thread src/services/api/openaiShim/requestPlanner.ts Outdated
jatmn added 2 commits July 29, 2026 06:43
Add planner tests that exercise serializeBody() for responses,
anthropic_messages, and gemini transports, including omit-flag rebuilds.
Remove the vacuous Gemini tool_choice assertion that never guarded behavior.
@jatmn
jatmn marked this pull request as ready for review July 29, 2026 14:44

@jatmn jatmn left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kevincodex1
kevincodex1 merged commit 871bf28 into Twigpine:main Jul 30, 2026
5 checks passed
@jatmn
jatmn deleted the de-mono1-request-planner branch July 30, 2026 04:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants