agents: add OpenAI/Codex tool compatibility and replay/liveness state#64300
agents: add OpenAI/Codex tool compatibility and replay/liveness state#64300steipete merged 14 commits intoopenclaw:mainfrom
Conversation
|
@steipete @vincentkoc PR3 for #64230 is live and intentionally narrow: provider-owned OpenAI/Codex tool compatibility only, with no generic-runner dialect, auth, permission, or replay scope mixed in. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2363afa4de
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Greptile SummaryThis PR adds an
Confidence Score: 4/5Safe to merge after fixing the recursive normalization bug that corrupts explicit empty properties maps. One P1 correctness bug: the recursive normalizer incorrectly expands any empty {} it encounters, which corrupts the src/plugin-sdk/provider-tools.ts — the Prompt To Fix All With AIThis is a comment left during a code review.
Path: src/plugin-sdk/provider-tools.ts
Line: 231-244
Comment:
**Empty-object guard corrupts the properties map**
The generic recursive descent calls `normalizeOpenAIStrictCompatSchemaRecursive(value)` for every entry in the record. When the entry is `properties: {}`, the value `{}` is an empty object and triggers the guard at line 237, turning the property-name map into a full JSON Schema `{ type: "object", ... }`. A tool with `parameters: { type: "object", properties: {} }` would therefore have its `properties` field corrupted before the API call.
The fix is to handle the `properties` key specially — iterate its sub-keys and normalize each property schema individually, not the container map itself. This is exactly how `stripUnsupportedSchemaKeywords` treats the same key. Adding a test for the `{ type: "object", properties: {} }` input would catch this regression.
How can I resolve this? If you propose a fix, please make it concise.Reviews (1): Last reviewed commit: "agents: add openai provider-owned tool c..." | Re-trigger Greptile |
There was a problem hiding this comment.
Pull request overview
Adds a provider-owned tool-schema compatibility layer for OpenAI/Codex native Responses routes, enabling stricter schema compliance without introducing a generic-runner Codex dialect.
Changes:
- Introduces an
openaicompat family with native-route gating, schema normalization for parameter-free/missing-object-shape cases, and strict-schema diagnostics. - Registers the compat hooks in the bundled OpenAI plugin so both
openaiandopenai-codexproviders expose them. - Adds focused unit tests covering normalization, diagnostics, bypass on non-native routes, and plugin registration.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
src/plugin-sdk/provider-tools.ts |
Implements OpenAI/Codex strict-tool schema normalization + violation inspection; adds openai compat family hooks. |
src/plugin-sdk/provider-tools.test.ts |
Adds unit coverage for OpenAI compat family behavior (normalize/inspect, bypass, diagnostics). |
extensions/openai/index.ts |
Wires provider-owned tool compat hooks into bundled OpenAI + Codex provider registrations. |
extensions/openai/index.test.ts |
Verifies OpenAI plugin registers and exposes the tool compat hooks for both providers. |
|
Pushed a minimal follow-up on Scope stays narrow to
I also re-derived the actual shared-family assignment inventory from source before pushing so this stays a contract-alignment fix rather than a speculative patch. This should be ready for maintainer review once GitHub checks refresh on the new head. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5372ced11e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
5372ced to
7a5fc23
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7a5fc2307b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 26a3a495be
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Pull request overview
Adds a provider-owned tool-schema compatibility layer for native OpenAI Responses and OpenAI Codex Responses routes, implemented via the existing provider hook surface (no generic runner dialect changes).
Changes:
- Introduces an
openaitool-compat family with schema normalization and strict-schema diagnostics. - Registers the new compat hooks in the bundled OpenAI provider plugin so both
openaiandopenai-codexexpose them. - Adds targeted unit tests covering normalization behavior, bypass conditions, diagnostics, and plugin registration.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/plugin-sdk/provider-tools.ts | Adds OpenAI/Codex compat gating, strict-schema normalization helpers, and violation inspection; extends the compat family matrix. |
| src/plugin-sdk/provider-tools.test.ts | Adds unit tests for the new openai compat family normalization + diagnostics behavior. |
| extensions/openai/index.ts | Wires openai tool-compat hooks into both OpenAI and Codex provider registrations. |
| extensions/openai/index.test.ts | Adds a plugin-boundary test asserting OpenAI/Codex providers expose the compat hooks. |
26a3a49 to
9c81e58
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9c81e58df6
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Addressed the current execution-correctness review pass on this branch. This push:
Local validation:
I also retried focused vitest locally, but the linked-worktree run still fails before loading tests with the existing |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1f501b4461
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
1f501b4 to
7f8a3bc
Compare
|
Rebased this branch onto current What changed in the latest push:
Local validation after the rebase:
Focused linked-worktree vitest is still unreliable here because of the existing |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7f8a3bc64a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Addressed the rebase fallout on this branch and pushed follow-up commit What changed:
Local validation on the new head:
GitHub is rerunning CI on the new head now. |
3f684ed to
f2bb4ca
Compare
|
Landed via rebase merge. Thanks @100yenadmin. Source tip before merge: f2bb4ca Local validation before merge:
Merged without waiting for fresh CI per maintainer request. |
|
Follow-up landed on
Thanks @100yenadmin. |
…i + pruning-defaults) Fixes three inherited failures that are red on every recent main commit since PR B (openclaw#64439) and PR C (openclaw#64300) landed. Each failure is a stale test surface that a production change forgot to update. 1) target-resolver.test.ts is mocking plugins/runtime.js with only getActivePluginChannelRegistryVersion. After src/channels/registry.ts started calling getActivePluginChannelRegistry + getActivePluginRegistry through listRegisteredChannelPluginEntries(), every resolveMessagingTarget test that reaches normalizeTargetForProvider fails with 'No getActivePluginChannelRegistry export is defined on the ../../plugins/runtime.js mock'. Adds both exports to the mock factory with a registry seeded from the channels the test cases actually use (discord, imessage, mattermost, slack, telegram) so normalizeAnyChannelId resolves them the way real runtime would. 2) memory-wiki/index.test.ts expects 16 gateway methods, but src/gateway.ts now registers 19 after wiki.importRuns, wiki.importInsights, and wiki.palace were added between wiki.status and wiki.init. Extends the expected list to match the real registration order. 3) test/extension-test-boundary.test.ts flags src/config/config.pruning-defaults.test.ts as a core test that deep-imports extensions/anthropic/provider-policy-api.js, which violates the extension-test-boundary rule. Moves the test to extensions/anthropic/config-pruning-defaults.test.ts with inferred types from applyAnthropicConfigDefaults's parameter/return shape, matching the pattern used by the sibling provider-policy-api.test.ts. Local validation: - pnpm test src/infra/outbound/target-resolver.test.ts - pnpm test extensions/memory-wiki/index.test.ts - pnpm test extensions/anthropic/config-pruning-defaults.test.ts - pnpm test test/extension-test-boundary.test.ts Refs openclaw#64227
Summary
Scope
What changed
openaitool-compat family tobuildProviderToolCompatFamilyHooks(...)extensions/openai/index.tsso OpenAI and OpenAI Codex providers both expose themworking,paused,blocked, orabandonedstates instead of silent disappearanceValidation
pnpm buildCI=1 pnpm exec vitest run src/agents/pi-embedded-subscribe.handlers.lifecycle.test.ts src/agents/pi-embedded-subscribe.handlers.compaction.test.ts src/agents/pi-embedded-subscribe.handlers.tools.test.ts src/agents/pi-embedded-runner/run/attempt.spawn-workspace.test.ts src/agents/pi-embedded-subscribe.subscribe-embedded-pi-session.subscribeembeddedpisession.test.tsNon-goals