Skip to content

refactor(openai-shim): extract request preparation - #2073

Merged
kevincodex1 merged 4 commits into
Twigpine:mainfrom
jatmn:de-mono2-request-preparation
Aug 10, 2026
Merged

kevincodex1 merged 4 commits into
Twigpine:mainfrom
jatmn:de-mono2-request-preparation

Conversation

@jatmn

@jatmn jatmn commented Jul 31, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • move runtime-context resolution, message compression, reasoning shaping, token fields, tool selection, and request-body planner assembly into openaiShim/requestPreparation.ts
  • keep request execution in the existing executor and leave the facade responsible only for dependency wiring
  • add paired requestPreparation.test.ts coverage without issuing network requests
  • test default store: false, descriptor-driven store removal, and converted OpenAI tool payloads through prepareOpenAIRequest
  • rebase onto current main, retaining the merged transport/response-adapter extractions and the existing architecture/Gemini test improvements
  • reduce openaiShim.ts from 1,044 lines on the rebased base to 713 lines

Why

Request shaping remained embedded in the facade after requestPlanner.ts and requestExecutor.ts landed. This extraction gives the orchestration step a focused source/test owner while preserving the existing executor boundary.

Impact

No intended user-facing or provider behavior change. Prepared request data is passed into the existing executor unchanged. Future unpaired production modules under openaiShim/ fail the architecture guard.

Validation

  • bun test --feature=UNATTENDED_RETRY --max-concurrency=1 src/services/api/openaiShim/requestPreparation.test.ts — 3 pass
  • focused request-preparation, planner, executor, Gemini, architecture, and compression suites — 162 pass
  • bun run test:provider — 1,488 pass; 12 xAI OAuth callback failures reproduce unchanged on upstream/main with EADDRINUSE
  • bun run typecheck
  • bun run typecheck:type-tests
  • bun run build

Contributor checklist

  • Reviewed CONTRIBUTING.md and AGENTS.md.
  • No linked issue; this is focused post-extraction architecture housekeeping.
  • OpenAI-compatible request preparation and provider-shaping paths were tested.
  • No UI changes or screenshots required.

Summary by CodeRabbit

  • New Features

    • Improved OpenAI request handling across supported providers and routes.
    • Added route-specific storage settings with configurable defaults and overrides.
    • Improved chat-completion fields, tool selection, streaming usage, reasoning, and token settings.
  • Bug Fixes

    • Improved compatibility for local, remote, GitHub, and provider-specific request configurations.
  • Tests

    • Expanded coverage for request defaults, transformations, storage settings, tool handling, and streaming options.

@coderabbitai

coderabbitai Bot commented Jul 31, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The OpenAI shim delegates request preparation to prepareOpenAIRequest. The new module handles routing, provider compatibility, request-body construction, tool conversion, serialization, and planner setup. Focused tests cover store handling, field mapping, tools, and streaming options.

Changes

OpenAI request preparation

Layer / File(s) Summary
Request preparation module
src/services/api/openaiShim/requestPreparation.ts
Adds runtime resolution, provider-specific body construction, compatibility handling, tool conversion, serialization, and request planner callbacks.
Facade integration
src/services/api/openaiShim.ts
Removes inline preparation logic and passes prepared request state to request execution.
Request preparation validation
src/services/api/openaiShim/requestPreparation.test.ts
Tests store handling, chat-completion field mapping, tool conversion, tool choice, and streaming options.

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

Possibly related PRs

Suggested labels: enhancement

Suggested reviewers: kevincodex1

🚥 Pre-merge checks | ✅ 7
✅ Passed checks (7 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.
Risk Surface Disclosed ✅ Passed The PR identifies runtime routing and provider request shaping, keeps network execution in the existing executor, and states that no provider behavior change is intended; no new auth or fetch path...
No Hidden Policy Change ✅ Passed The diff relocates existing preparation logic; requestPlanner and requestExecutor are unchanged, and new tests preserve default store:false with route-specific removal.
Title check ✅ Passed The title is concise, scoped to openai-shim, and accurately describes extracting request preparation from the facade.
Description check ✅ Passed The description explains the change, rationale, impact, validation results, and testing scope, although it uses different headings than the template.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@jatmn
jatmn force-pushed the de-mono2-request-preparation branch 2 times, most recently from c51bf33 to 186b84b Compare July 31, 2026 14:54

@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: 2

🤖 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.architecture.test.ts`:
- Around line 5-6: Update the path construction around facadePath and
moduleDirectory to import and use node:path joining utilities, avoiding manual
separator concatenation when building openaiShim subpaths. Apply the same change
to the additional affected path construction around the referenced module
entries, while preserving the existing resolved locations.

In `@src/services/api/openaiShim/requestPreparation.test.ts`:
- Around line 21-44: Replace the source-text assertions that read module files
and match string patterns with behavior assertions that test the actual
functionality through prepareOpenAIRequest. Remove the Bun.file reading logic
from both test cases and instead call prepareOpenAIRequest with test data to
verify that store: false is applied by default in the request body, then verify
that when shimConfig.removeBodyFields includes store, the field is actually
removed from the prepared body. This ensures the tests fail when the actual
behavior breaks rather than when implementation details like variable names
change.
🪄 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: a0afcd10-b987-4df0-8f31-095df428e4b2

📥 Commits

Reviewing files that changed from the base of the PR and between b3735be and 5c6d17c.

📒 Files selected for processing (7)
  • src/__tests__/bugfixes.test.ts
  • src/services/api/openaiShim.architecture.test.ts
  • src/services/api/openaiShim.ts
  • src/services/api/openaiShim/architecture.test.ts
  • src/services/api/openaiShim/geminiStreamConversion.test.ts
  • src/services/api/openaiShim/requestPreparation.test.ts
  • src/services/api/openaiShim/requestPreparation.ts
💤 Files with no reviewable changes (2)
  • src/services/api/openaiShim/architecture.test.ts
  • src/tests/bugfixes.test.ts
📜 Review details
⏰ Context from checks skipped due to timeout. (3)
  • GitHub Check: smoke-and-tests (22)
  • GitHub Check: smoke-and-tests (24.11.x)
  • GitHub Check: typecheck
🧰 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.architecture.test.ts
  • src/services/api/openaiShim/geminiStreamConversion.test.ts
  • src/services/api/openaiShim.ts
  • src/services/api/openaiShim/requestPreparation.test.ts
  • src/services/api/openaiShim/requestPreparation.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.architecture.test.ts
  • src/services/api/openaiShim/geminiStreamConversion.test.ts
  • src/services/api/openaiShim.ts
  • src/services/api/openaiShim/requestPreparation.test.ts
  • src/services/api/openaiShim/requestPreparation.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.architecture.test.ts
  • src/services/api/openaiShim/geminiStreamConversion.test.ts
  • src/services/api/openaiShim.ts
  • src/services/api/openaiShim/requestPreparation.test.ts
  • src/services/api/openaiShim/requestPreparation.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.architecture.test.ts
  • src/services/api/openaiShim/geminiStreamConversion.test.ts
  • src/services/api/openaiShim.ts
  • src/services/api/openaiShim/requestPreparation.test.ts
  • src/services/api/openaiShim/requestPreparation.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.architecture.test.ts
  • src/services/api/openaiShim/geminiStreamConversion.test.ts
  • src/services/api/openaiShim/requestPreparation.test.ts
🔇 Additional comments (7)
src/services/api/openaiShim/requestPreparation.ts (2)

93-144: LGTM!

Also applies to: 146-205, 207-231, 235-296, 316-353


298-315: 🗄️ Data Integrity & Integration

The extraction preserves the original lazy-path behavior; no parity issue exists.

The old inline code at line 1439 already used request.resolvedModel without runtimeLimits in the lazy responses path. The extracted code at lines 306-308 maintains this exact pattern. No silent change to context-window trimming has occurred.

			> Likely an incorrect or invalid review comment.
src/services/api/openaiShim.ts (1)

91-91: LGTM!

Also applies to: 1187-1215

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

46-116: LGTM!

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

10-27: LGTM!

Also applies to: 29-88

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

8-40: 📐 Maintainability & Code Quality

Keep the architecture budget test unchanged. The current tree has an activeReduction of 4,301 lines, which produces a 1,335-line budget. The facade is 1,335 lines, so the test passes. The four entries after upstreamExtractionCount do not all exist and do not reduce the budget to 676 lines.

			> Likely an incorrect or invalid review comment.

42-50: 📐 Maintainability & Code Quality

Every production module in openaiShim/ already has a paired test.

The test at lines 42–50 passes. All 14 production modules (clientDispatch, geminiStreamConversion, messageConversion, ollamaAdapter, providerCompatibility, rawToolCallParsing, requestExecutor, requestPlanner, requestPreparation, responseConversion, streamControl, streamConversion, toolConversion, xmlToolCallParsing) have corresponding .test.ts files. No type-only or barrel files (such as index.ts or types.ts) are present in the directory.

Comment thread src/services/api/openaiShim.architecture.test.ts
Comment thread src/services/api/openaiShim/requestPreparation.test.ts Outdated
@jatmn
jatmn force-pushed the de-mono2-request-preparation branch from 5c6d17c to 8722bea Compare August 9, 2026 20:23

@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/requestPreparation.test.ts`:
- Around line 6-18: Update the test dependencies’ convertTools stub and
assertions in the request preparation test so convertTools returns a distinct
converted OpenAI function-tool object. Assert prepared.body.tools matches that
exact object, while retaining the existing tool_choice assertion and avoiding
raw tool-count-only validation.
🪄 Autofix

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: 71be965f-9db9-4337-b4c8-20c6e4c575e8

📥 Commits

Reviewing files that changed from the base of the PR and between 5c6d17c and 8722bea.

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

📄 CodeRabbit inference engine (AGENTS.md)

Use TypeScript strict mode and ESM imports throughout the source code.

Run bun run typecheck and bun run typecheck:type-tests for TypeScript changes when applicable.

Files:

  • src/services/api/openaiShim/requestPreparation.test.ts
  • src/services/api/openaiShim.ts
**/*.{tsx,ts}

📄 CodeRabbit inference engine (AGENTS.md)

Use React and Ink patterns for terminal UI components.

Files:

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

📄 CodeRabbit inference engine (AGENTS.md)

src/**/*.ts: Prefer existing service, provider, settings, permission, and UI patterns over introducing new abstractions.
Use chalk for terminal color and execa for child-process execution when those capabilities are needed.

Files:

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

📄 CodeRabbit inference engine (AGENTS.md)

Use existing service and provider integration patterns when implementing API, MCP, OAuth, wiki, voice, or related integrations.

Files:

  • src/services/api/openaiShim/requestPreparation.test.ts
  • src/services/api/openaiShim.ts
**/*.{test,spec}.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Add or update tests when behavior changes, and run the narrowest useful focused test checks.

Files:

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

📄 CodeRabbit inference engine (AGENTS.md)

Do not add new Python code, Python provider paths, or Python dependencies without explicit maintainer approval.

**/*.{ts,tsx,js,jsx}: Follow the existing code style in touched source files, prefer small readable changes, avoid unrelated reformatting, and keep comments useful and concise.
Preserve existing repository patterns unless intentionally refactoring them, and avoid broad rewrites or unnecessary generated changes.
Review AI-assisted code for correctness, style consistency, unnecessary changes, and adherence to project architecture before submitting it.

Files:

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

📄 CodeRabbit inference engine (CONTRIBUTING.md)

**/*.{test,spec}.{ts,tsx,js,jsx}: Add or update tests when a code change affects behavior.
Use focused tests such as bun test ./path/to/test-file.test.ts when validating a narrowly scoped change.

Files:

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

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Update documentation when setup, commands, or user-facing behavior changes.

Files:

  • src/services/api/openaiShim/requestPreparation.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/requestPreparation.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/requestPreparation.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/requestPreparation.test.ts
🔇 Additional comments (2)
src/services/api/openaiShim.ts (1)

45-91: LGTM!

Also applies to: 385-392, 612-640, 668-668

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

21-119: 📐 Maintainability & Code Quality

Confirm the required validation commands.

The supplied context has no check output. It also does not list exact validation commands in the PR description.

Run and record bun test ./src/services/api/openaiShim/requestPreparation.test.ts, bun run typecheck, bun run typecheck:type-tests, and bun run build. Do not treat this PR as fully validated until those checks are available.

As per path instructions: “Include exact validation commands in the PR description.”

Sources: Coding guidelines, Path instructions

Comment thread src/services/api/openaiShim/requestPreparation.test.ts
@jatmn
jatmn marked this pull request as ready for review August 9, 2026 20:51
@jatmn jatmn self-assigned this Aug 9, 2026
@jatmn

jatmn commented Aug 9, 2026

Copy link
Copy Markdown
Collaborator Author

@kevincodex1 LGTM

@kevincodex1
kevincodex1 merged commit 7fae0ff into Twigpine:main Aug 10, 2026
6 checks passed
@jatmn
jatmn deleted the de-mono2-request-preparation branch August 10, 2026 02:12
hotmanxp pushed a commit to hotmanxp/openclaude that referenced this pull request Aug 18, 2026
…rtial port

Port of upstream c305788 (91 files, 9-commit series) via fork-aware
selective apply. The PR delivers a unified interruption trace
infrastructure; fork already had the QueryGuard-side trace helpers from
prior syncs, so the partial port brings across the new trace modules
and consumer-side wiring while dropping the codex / gemini / sdk-v2 /
goal subtrees that don't exist in the fork provider policy.

New trace modules added (from upstream main, fork previously lacked):
- src/utils/interruptionTrace.ts (23k, requestAbort / trace /
  flushInterruptionTrace / resolution observer)
- src/utils/replInterruption.ts (small facade for REPL consumers)
- src/utils/queryEventDriver.ts (lifecyle event hook)
- src/utils/swarm/inProcessPermissionAbort.ts (in-process teammate
  abort snapshot)
- src/cli/printInterruption.ts (CLI-side enforcement hook)
- src/tools/SendMessageTool/shutdownInterruptionTrace.ts
  (shutdownApproved helper for SendMessageTool)

New tests:
- src/utils/interruptionTrace.test.ts
- src/utils/replInterruption.test.ts
- src/utils/queryEventDriver.test.ts
- src/state/teammateViewHelpers.interruptionTrace.test.ts
  (verifies that LocalAgentTask stopOrDismiss propagates through
  trace infrastructure)

Existing-file patches applied verbatim (git apply --3way clean, no
conflict):
- QueryEngine.ts, grpc/server.ts, hooks/toolPermission/{PermissionContext,
  handlers/{interactiveHandler.ts, interactiveHandler.test.ts}},
  hooks/useBackgroundTaskNavigation.ts, hooks/useSSHSession.ts,
  components/permissions/PermissionRequest.tsx,
  services/PromptSuggestion/{speculation.ts},
  services/api/claude.abortClassification.test.ts,
  services/compact/{compact.ts}, services/tools/StreamingToolExecutor.ts
  (conflict resolved by accepting upstream's trace-context fork),
  state/teammateViewHelpers.ts, tasks/LocalAgentTask/LocalAgentTask.tsx,
  tools/SendMessageTool/SendMessageTool.ts, utils/abortController.ts,
  utils/attachments.ts, utils/combinedAbortSignal.ts (conflict
  resolved on opts.trace field, accepting upstream's full opts),
  utils/computerUse/wrapper.tsx, utils/diagLogs.ts,
  utils/forkedAgent.ts, utils/fsOperations.ts, utils/gracefulShutdown.ts,
  utils/handlePromptSubmit.ts,
  utils/permissions/{PermissionPromptToolResultSchema.ts, permissions.ts},
  utils/queryLifecycle.{ts,test.ts},
  utils/swarm/{inProcessRunner.ts, spawnInProcess.ts}, docs/advanced-setup.md

Conflict-resolved with upstream-theirs:
- src/utils/QueryGuard.ts: ONLY added the upstream _handleTimeout
  causalEventId emission so a fired timeout now flows into the trace
  bus. Did NOT drop fork's _buildTimeoutInfo, setLifecycleHook,
  public getActiveOperations, or the prior _traceActivityCount /
  _lastTraceActivityAt work from earlier syncs. Manual Edit-by-hunk,
  not git cherry-pick (per docs/sync-upstream.md).

Skipped (per AGENTS.md provider policy):
- src/services/api/codexShim.* (codex provider not in fork)
- src/services/api/openaiShim/{clientDispatch, streamControl,
  streamConversion, transport, responseAdapters, geminiStreamConversion,
  providerStreamInterruptionTrace}.{ts,test.ts}: the openaiShim
  subdirectory split into per-responsibility files does not exist in
  fork's openaiShim monolith; porting the per-file trace requires the
  parallel Twigpine#2073/Twigpine#2074 refactors (deferred as separate task)
- src/services/goal/{controller, evaluator}.{ts,test.ts}: fork has no
  goal service
- src/entrypoints/sdk/{interruption, query, v2}.ts: fork has no v2 SDK
  entrypoint
- tests/sdk/*.test.ts: fork has no tests/sdk/ runner
- src/QueryEngine.interruptionTrace.test.ts and 9 other
  *.interruptionTrace.test.ts for codex / goal / sdk-v2 / openaiShim-
  submodule targets: dangling fixtures without their corresponding
  source port

Untouched conflict files (reverted to fork base for upstream's
incompatible rewrites, to be retried after sync'ing pre-reqs):
- src/hooks/useInboxPoller.ts, src/hooks/useCancelRequest.ts,
  src/hooks/useReplBridge.tsx, src/remote/remotePermissionBridge.ts,
  src/screens/REPL.tsx, src/query.ts, src/cli/print.ts,
  src/services/api/claude.ts, src/services/api/openaiShim.test.ts, etc:
  their conflict hunks pulled in fork-missing helpers
  (requestPermissionModeChange from permissionModeChange.ts, codex
  gRPC bridge, SDK v2 QueryLifecycle wiring) and would not compile
  without first porting those modules.

Verification (5-phase per docs/verification-checklist.md):
- bun run typecheck: 0 errors (was 0 before, remained 0)
- bun run build: opencc v0.21.0 -> dist/cli.mjs + dist/sdk.mjs
- bun test: 5163 pass / 196 skip / 0 fail across 5359 tests
  (was 5134 / 183 / 0 baseline -> +29 new tests, +13 new
  skipped, 0 regressions)

Re-applying this commit pre-requisite on follow-up sync windows:
follow-up commits should bring in permissionModeChange.ts,
services/goal/, openaiShim/{clientDispatch, streamControl,
streamConversion, transport, responseAdapters}* and entries/sdk/
before re-running this PR's hook-side patches.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants