Skip to content

fix(plugin-sdk): drop unreachable openai tool-compat branch - #108310

Merged
steipete merged 2 commits into
openclaw:mainfrom
Pick-cat:fix/provider-tools-dead-openai-branch
Jul 18, 2026
Merged

steipete merged 2 commits into
openclaw:mainfrom
Pick-cat:fix/provider-tools-dead-openai-branch

Conversation

@Pick-cat

@Pick-cat Pick-cat commented Jul 15, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where OpenAI tool-schema compatibility selection kept a second identical provider === "openai" branch that could never run, making future Codex/ChatGPT Responses routing edits easy to place in dead code and leaving maintainers with misleading duplicate policy in the plugin-sdk tool-compat gate.

Why This Change Was Made

Delete the unreachable duplicate if (provider === "openai") block in shouldApplyOpenAIToolCompat. The live openai gate already returns for both native openai-responses and first-party openai-chatgpt-responses hosts; no second provider id or compat path is needed. Non-goals: no behavior change for live routes, no new codex provider branch (Codex remains folded into openai), no schema-normalization logic changes.

Collision check: searched open/closed PRs for shouldApplyOpenAIToolCompat, provider-tools dead/unreachable openai branch — no competing PR for this exact dead block.

User Impact

No user-facing behavior change. Operators and plugin authors get a single clear OpenAI tool-compat gate, so ChatGPT/Codex Responses strict-schema routing cannot be accidentally edited into an unreachable copy-paste branch.

Evidence

Exact head: 3d4a2d07e9342c5fd85ecc8c50b7b0e0f46b7c8e

node scripts/run-vitest.mjs src/plugin-sdk/provider-tools.test.ts -- --run --reporter=verbose
 ✓ covers the tool compat family matrix
 ✓ normalizes canonical OpenAI Codex Responses tool schemas
 ✓ keeps a single openai provider gate for OpenAI tool-schema compat
 ✓ applies ChatGPT Responses strict compat on first-party OpenAI API hosts
 ✓ leaves non-openai providers untouched by OpenAI strict compat
 ✓ collapses anyOf and oneOf unions for the deepseek family
 ✓ preserves string-const unions as a flat enum for the deepseek family
 ✓ normalizes parameter-free and typed-object schemas for the openai family
 ✓ repairs null and inferred OpenAI tool schema types
 ✓ keeps unrepairable null schema constraints for downstream quarantine
 ✓ preserves explicit empty properties maps when normalizing strict openai schemas
 ✓ preserves nested schemas and annotation objects while normalizing strict openai schemas
 ✓ does not tighten or warn for permissive object schemas that use strict:false
 ✓ skips openai strict-tool normalization on non-native routes
 ✓ suppresses openai strict-schema diagnostics because transport falls back to strict false

 Test Files  1 passed (1)
      Tests  15 passed (15)
  • Structure lock: shouldApplyOpenAIToolCompat has exactly one provider === "openai" gate (verified via grep).
  • Negative control (on origin/main): two identical if (provider === "openai") branches existed; now one.
  • Prod LOC: -6 / test LOC: +54
  • What was not tested: live OpenAI/ChatGPT network calls; full agent tool loop against a real Responses backend.

Risk / Compatibility

Low. Deletes unreachable code only; exported normalizeOpenAIToolSchemas / family hooks unchanged. Mitigation: structure lock test + ChatGPT Responses / non-openai matrix coverage.

Review

  • Manually reviewed and verified
  • AI-assisted: Yes

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. labels Jul 16, 2026
@clawsweeper

clawsweeper Bot commented Jul 16, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed July 18, 2026, 3:02 AM ET / 07:02 UTC.

Summary
The PR removes a duplicate unreachable provider === "openai" condition from the plugin-SDK OpenAI tool-compat selector and adds OpenAI/other-provider route coverage.

PR surface: Source -6, Tests +40. Total +34 across 2 files.

Reproducibility: not applicable. This PR removes an unreachable internal condition rather than reporting a user-visible failure with a current-main reproduction path.

Review metrics: none identified.

Merge readiness
Overall: 🦪 silver shellfish
Proof: 🦪 silver shellfish
Patch quality: 🦐 gold shrimp
Result: blocked until real behavior proof from a real setup is added.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • Rerun the focused src/plugin-sdk/provider-tools.test.ts coverage on current head 4e0bfb7d and update the PR evidence.
  • [P1] Add a redacted terminal trace through an OpenAI Responses tool invocation if maintainers need proof beyond unit coverage.

Proof guidance:

  • [P1] Needs real behavior proof before merge: The PR provides focused unit-test output, but it is for the prior head and does not show an after-fix runtime OpenAI Responses tool path on current head; add redacted live terminal output if this proof gate remains applicable. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Risk before merge

  • [P1] The supplied test transcript and declared exact head refer to 3d4a2d07, not current 4e0bfb7d; refresh focused validation or explicitly confirm the later commit changes only the test assertion before merge.
  • [P1] The provided evidence is unit-test output rather than an after-fix runtime trace through an OpenAI Responses tool call, so it does not independently demonstrate the live compatibility path.

Maintainer options:

  1. Decide the mitigation before merge
    Retain the single canonical OpenAI gate, verify the focused provider-tools coverage on current head, and add a redacted runtime trace through an OpenAI Responses tool invocation if maintainers require external-path proof.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • [P1] No mechanical code repair is identified; a maintainer should refresh validation against the current head and decide whether live provider-path evidence is required.

Security
Cleared: The supplied diff only removes a redundant conditional and adds focused tests; it does not change dependencies, permissions, secrets, workflows, or package resolution.

Review details

Best possible solution:

Retain the single canonical OpenAI gate, verify the focused provider-tools coverage on current head, and add a redacted runtime trace through an OpenAI Responses tool invocation if maintainers require external-path proof.

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

Not applicable: this PR removes an unreachable internal condition rather than reporting a user-visible failure with a current-main reproduction path.

Is this the best way to solve the issue?

Unclear: the proposed removal matches the supplied branch logic, but direct inspection of current main, the full selector call graph, and upstream OpenAI routing contracts was unavailable in this read-only environment.

AGENTS.md: unclear because the file could not be read completely.

Codex review notes: model internal, reasoning high; reviewed against 1f160696dcb1.

Label changes

Label changes:

  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦐 gold shrimp.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR provides focused unit-test output, but it is for the prior head and does not show an after-fix runtime OpenAI Responses tool path on current head; add redacted live terminal output if this proof gate remains applicable. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • remove proof: sufficient: Current real behavior proof status is mock_only, not sufficient.
  • remove rating: 🐚 platinum hermit: Current PR rating is rating: 🦪 silver shellfish, so this older rating label is no longer current.
  • remove status: 👀 ready for maintainer look: Current PR status label is status: 📣 needs proof.

Label justifications:

  • P3: This is a small internal plugin-SDK cleanup with no claimed user-visible behavior change.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦐 gold shrimp.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR provides focused unit-test output, but it is for the prior head and does not show an after-fix runtime OpenAI Responses tool path on current head; add redacted live terminal output if this proof gate remains applicable. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed

PR surface:

Source -6, Tests +40. Total +34 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 0 6 -6
Tests 1 40 0 +40
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 40 6 +34

What I checked:

  • Current PR diff: The current head removes only the second identical OpenAI provider branch from shouldApplyOpenAIToolCompat; the preceding branch already covers both openai-responses and openai-chatgpt-responses routes under the same provider and base-URL predicate. (src/plugin-sdk/provider-tools.ts:150, 4e0bfb7d7a1d)
  • Focused behavioral coverage: The current diff adds coverage that normalizes first-party ChatGPT Responses tool schemas and leaves a non-OpenAI provider unchanged, which directly exercises the route boundary relevant to the removed branch. (src/plugin-sdk/provider-tools.test.ts:85, 4e0bfb7d7a1d)
  • Maintainer review context: The timeline records assignment to steipete and a later force-push of current head 4e0bfb7d by that person; the current commit message states that it retained behavioral route coverage while removing a brittle source-text assertion. (src/plugin-sdk/provider-tools.test.ts:85, 4e0bfb7d7a1d)
  • Evidence freshness gap: The PR body reports focused-test output for 3d4a2d07e9342c5fd85ecc8c50b7b0e0f46b7c8e, while GitHub context identifies 4e0bfb7d7a1deee9e81ceb66c333aeba7ea20465 as the current head after an additional commit. (src/plugin-sdk/provider-tools.test.ts:85, 4e0bfb7d7a1d)

Likely related people:

  • steipete: GitHub context shows assignment to this reviewer and a current-head commit refining the plugin-SDK cleanup and its tests. (role: recent area contributor and assigned reviewer; confidence: medium; commits: 4e0bfb7d7a1d; files: src/plugin-sdk/provider-tools.ts, src/plugin-sdk/provider-tools.test.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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.

How this review workflow works
  • 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.
Review history (3 earlier review cycles)
  • reviewed 2026-07-16T03:21:00.980Z sha 42ad7394f556650545a1efafad5882a2529248d9 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-18T01:44:08.086Z sha 3d4a2d07e9342c5fd85ecc8c50b7b0e0f46b7c8e :: needs real behavior proof before merge. :: none
  • reviewed 2026-07-18T02:18:13.803Z sha 3d4a2d07e9342c5fd85ecc8c50b7b0e0f46b7c8e :: needs maintainer review before merge. :: none

@Pick-cat
Pick-cat force-pushed the fix/provider-tools-dead-openai-branch branch from 42ad739 to 3d4a2d0 Compare July 18, 2026 01:40
@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. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. 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. labels Jul 18, 2026
@steipete steipete self-assigned this Jul 18, 2026
Pick-cat and others added 2 commits July 18, 2026 07:56
Keep behavioral route coverage and drop the brittle source-text assertion.\n\nCo-authored-by: Pick-cat <[email protected]>
@steipete
steipete force-pushed the fix/provider-tools-dead-openai-branch branch from 3d4a2d0 to 4e0bfb7 Compare July 18, 2026 06:58
@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. and removed proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Jul 18, 2026
@steipete
steipete merged commit 32b3f0e into openclaw:main Jul 18, 2026
138 of 148 checks passed
@steipete

Copy link
Copy Markdown
Contributor

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 19, 2026
…#108310)

* fix(plugin-sdk): drop unreachable openai tool-compat branch

* refactor(plugin-sdk): remove dead OpenAI compat branch

Keep behavioral route coverage and drop the brittle source-text assertion.\n\nCo-authored-by: Pick-cat <[email protected]>

---------

Co-authored-by: Peter Steinberger <[email protected]>
zooqueen pushed a commit to zooqueen/openclaw that referenced this pull request Sep 11, 2026
…#108310)

* fix(plugin-sdk): drop unreachable openai tool-compat branch

* refactor(plugin-sdk): remove dead OpenAI compat branch

Keep behavioral route coverage and drop the brittle source-text assertion.\n\nCo-authored-by: Pick-cat <[email protected]>

---------

Co-authored-by: Peter Steinberger <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: XS status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants