Skip to content

[codex] Add contract-first Pi/Codex runtime plan suite#71096

Merged
steipete merged 64 commits intoopenclaw:mainfrom
electricsheephq:contract-first/runtime-plan-implementation
Apr 24, 2026
Merged

[codex] Add contract-first Pi/Codex runtime plan suite#71096
steipete merged 64 commits intoopenclaw:mainfrom
electricsheephq:contract-first/runtime-plan-implementation

Conversation

@100yenadmin
Copy link
Copy Markdown
Contributor

@100yenadmin 100yenadmin commented Apr 24, 2026

Summary

This is the single tied PR for RFC #71004. It bundles the complete Phase 1 Pi/Codex parity contract suite plus the first additive AgentRuntimePlan implementation path as a traceable commit stack.

The goal is to stop policy drift between Pi and Codex without a big-bang runner rewrite. OpenClaw-owned runtime policy is prepared once and then consumed by both adapters where the contract rows proved drift risk. Codex still owns app-server/model-loop lifecycle; OpenClaw owns tools, auth/profile routing, prompt overlays, transcript repair, delivery semantics, fallback classification, schema normalization, transport defaults, and observability.

No Harness V2, runner split, package rename, or WS pooling is included here.

Architecture

flowchart TD
  UserTurn["User turn / queued follow-up"] --> Contracts["Pi/Codex parity contracts"]
  Contracts --> Tools["Tool hooks + dynamic tools"]
  Contracts --> Auth["Auth/profile aliases"]
  Contracts --> Outcome["Outcome + fallback"]
  Contracts --> Delivery["Delivery + NO_REPLY"]
  Contracts --> Transcript["Transcript repair"]
  Contracts --> Prompt["Prompt overlays"]
  Contracts --> Schemas["Schema normalization"]
  Contracts --> Transport["Transport params"]

  Contracts --> RuntimePlan["AgentRuntimePlan"]

  RuntimePlan --> AuthPlan["auth\nproviderForAuth / forwarded profile"]
  RuntimePlan --> PromptPlan["prompt\nprovider overlays"]
  RuntimePlan --> ToolPlan["tools\nschema normalization + diagnostics"]
  RuntimePlan --> TranscriptPlan["transcript\nrepair policy"]
  RuntimePlan --> DeliveryPlan["delivery\nvisible route + NO_REPLY"]
  RuntimePlan --> OutcomePlan["outcome\nfallback classifier"]
  RuntimePlan --> TransportPlan["transport\nextra params by resolved transport"]
  RuntimePlan --> Observability["observability\nresolved backend/model/auth/transport"]

  AuthPlan --> Pi["Pi runner"]
  PromptPlan --> Pi
  ToolPlan --> Pi
  TranscriptPlan --> Pi
  TransportPlan --> Pi
  Observability --> Pi

  AuthPlan --> Codex["Codex app-server adapter"]
  PromptPlan --> Codex
  ToolPlan --> Codex
  Observability --> Codex

  DeliveryPlan --> Followups["follow-up runner"]
  OutcomePlan --> Fallback["model fallback loop"]
Loading

Commit Stack Map

Contract suite, test-only baseline:

  • Tools contract suite: 1c62f84ef4 through ce33300bcd
  • Auth/profile contract suite: 1ae5491799 through ccb4a05b49
  • Outcome/fallback contract suite: 25e02d7f31 through b4ae5bd569
  • Delivery/NO_REPLY contract suite: 78b2c7f607 through ef2e364451
  • Transcript-repair contract suite: 4d02ecccba through 8742e8cd9c
  • Prompt-overlay contract suite: 2bee7e5fa8 through ea636977fa
  • Schema-normalization contract suite: c2fea9c399 through c5a9926b9c
  • Transport-params contract suite: 3e8a8efc2c through 5b7ef05777

RuntimePlan implementation stack:

  • 3618a119ef - add initial AgentRuntimePlan foundation
  • c5ea427e86 - preserve Codex harness auth profiles
  • 6027f57bcc - route follow-up delivery through runtime plan
  • 78eb2d217e - normalize parameter-free OpenAI tool schemas
  • 68cbd213d4 - satisfy runtime plan type checks
  • 5fa2eb9832 - narrow follow-up delivery runtime planning
  • 62c63feb5a - apply Codex app-server auth profiles
  • 3f03ffc86f - classify Codex terminal outcomes
  • 3ec5671ea3 - prevent harness auth leakage into unrelated CLI providers
  • 8125a86a17 - expand runtime-plan policy contract
  • 94c5b63aab - route Pi runtime policy through runtime plan
  • 7d84fc69e8 - route Codex runtime policy through runtime plan
  • 2bbcb37853 - route fallback outcome classification through runtime plan

What Changed

  • Adds parity contracts for all eight RFC domains: tools, auth/profile, outcome/fallback, delivery/NO_REPLY, transcript repair, prompt overlays, schema normalization, and transport params.
  • Expands AgentRuntimePlan into an internal prepared-turn contract for auth, prompt, tools, transcript, delivery, outcome, transport, and observability.
  • Routes Pi normal turns and compaction through the plan for tool-schema normalization, schema diagnostics, prompt overlays, transcript policy, transport params, and resolved-ref observability.
  • Routes Codex app-server through the plan for auth profile forwarding, dynamic tool-schema normalization, prompt overlays, and resolved-ref observability.
  • Routes queued follow-up delivery and fallback outcome classification through narrow runtime-plan builders so those callers do not have to construct heavy turn state.
  • Keeps Codex app-server lifecycle separate. The shared plan only owns OpenClaw runtime policy.

What Did Not Change

Domain Coverage Matrix

Domain Contract coverage RuntimePlan consumption in this PR
Tool hooks / dynamic tools Pi and Codex dynamic tool behavior, before/after hooks, middleware, telemetry Codex and Pi tool-schema boundaries consume plan.tools; hook behavior remains contract-locked
Auth/profile openai/*, openai-codex/*, codex/*, codex-cli/*, unrelated CLI isolation Pi builds attempt plans with forwarded profile policy; Codex app-server login/client startup reads forwarded plan auth
Outcome/fallback Empty, reasoning-only, planning-only, block/no-fallback, tool side effects, NO_REPLY Codex terminal outcomes are classified; fallback callers use plan.outcome.classifyRunResult
Delivery/NO_REPLY Visible delivery, origin-missing/reroute-fail, exact/JSON NO_REPLY, media safety Follow-up runner uses plan.delivery for silent-payload detection and fallback route policy
Transcript repair Text, structured, media, data URI payload preservation Pi normal turns and compaction read plan.transcript repair policy
Prompt overlays GPT-5 overlay scope, config-off behavior, OpenAI/Codex family handling Pi normal turns, Pi compaction, and Codex developer instructions read plan.prompt
Schema normalization Parameter-free tools, strict-compatible schemas, HTTP Responses/WS parity Pi and Codex tool catalogs consume plan.tools.normalize; OpenAI parameter-free schema normalization fixed
Transport params parallel_tool_calls, verbosity, reasoning, WS warmup default, provider transport patching Pi normal turns and compaction use late-bound plan.transport.resolveExtraParams after transport resolution
Observability Backend/model/auth/transport visibility Pi and Codex llm_output events use plan.observability.resolvedRef where available

Why This Helps Maintainers

Before this PR, a fix could be correct in the Pi path while Codex reassembled or bypassed the same OpenClaw-owned policy elsewhere. The contracts make those policy domains executable, and the plan gives the implementation one shared source of truth.

This should make future refactors safer because reviewers can ask: does the changed path consume the plan, and does the parity row stay green? If yes, the change is much easier to reason about than another local patch inside one runner path.

Verification

Passed locally after the full stack:

./node_modules/.bin/vitest run src/agents/openclaw-owned-tool-runtime-contract.test.ts src/agents/auth-profile-runtime-contract.test.ts src/agents/outcome-fallback-runtime-contract.test.ts src/agents/pi-embedded-runner/run/transcript-repair-runtime-contract.test.ts src/agents/prompt-overlay-runtime-contract.test.ts src/agents/schema-normalization-runtime-contract.test.ts src/agents/transport-params-runtime-contract.test.ts src/agents/pi-embedded-runner/compact.hooks.test.ts --config test/vitest/vitest.agents.config.ts
./node_modules/.bin/vitest run src/agents/runtime-plan/build.test.ts --config test/vitest/vitest.unit-fast.config.ts
./node_modules/.bin/vitest run src/auto-reply/reply/followup-runner.test.ts --config test/vitest/vitest.auto-reply-reply.config.ts
./node_modules/.bin/vitest run extensions/codex/prompt-overlay-runtime-contract.test.ts extensions/codex/src/app-server/openclaw-owned-tool-runtime-contract.test.ts extensions/codex/src/app-server/auth-profile-runtime-contract.test.ts extensions/codex/src/app-server/outcome-fallback-runtime-contract.test.ts extensions/codex/src/app-server/delivery-no-reply-runtime-contract.test.ts extensions/codex/src/app-server/transcript-repair-runtime-contract.test.ts extensions/codex/src/app-server/schema-normalization-runtime-contract.test.ts extensions/codex/src/app-server/run-attempt.test.ts --config test/vitest/vitest.extensions.config.ts
./node_modules/.bin/vitest run src/agents/prompt-overlay-runtime-contract.test.ts src/agents/transport-params-runtime-contract.test.ts --config test/vitest/vitest.unit-fast.config.ts
./node_modules/.bin/vitest run src/agents/prompt-overlay-runtime-contract.test.ts src/agents/transport-params-runtime-contract.test.ts
./node_modules/.bin/oxlint --tsconfig tsconfig.oxlint.core.json <changed runtime files>
git diff --check origin/main..HEAD

pnpm check:changed was run once. It passed conflict-marker checks and then stopped at existing repo-wide core typecheck failures outside this PR’s changed runtime files, including:

  • src/agents/openai-transport-stream.ts compat fields inferred as {}
  • src/config/types.models.ts expecting compat exports not present in the installed @mariozechner/pi-ai
  • src/media/qr-runtime.ts missing @vincentkoc/qrcode-tui types/package
  • model/provider catalog compat typing that requires supportsLongCacheRetention

Those failures were also visible in direct pnpm tsgo:core / pnpm tsgo:extensions runs and do not originate from this branch’s RuntimePlan changes.

Deferred Work

  • Harness V2 adapter interface: prepare -> start/resume -> send -> tool call -> outcome -> cleanup
  • Mechanical runner split by ownership boundary after parity remains green
  • pi-embedded-runner naming cleanup / embedded-runner aliases
  • WebSocket session pooling and warmup amortization

References

Stabilization Batch

Post-ready corrective stack pushed on top of the implementation branch:

  • d28ef4cdf8 - refactor: make runtime plan contracts topology-safe
  • faf7900d52 - fix: restore runtime plan test type coverage
  • f8c5026d3d - fix: align runtime plan schema contract assertions
  • 0dc322f24e - fix: stabilize incomplete turn runtime tests

This batch fixes the concrete PR-caused blockers that showed up after the first ready-for-review push:

  • check:architecture: src/agents/runtime-plan/types.ts is now a leaf contract and no longer pulls Pi/transcript/plugin barrel types into the RuntimePlan seam.
  • check:test-types: src/agents/runtime-plan/build.test.ts now uses complete ProviderRuntimeModel fixtures and keeps producer assertions deterministic.
  • checks-node-core-fast-support: the completions strict-fallback test now uses a genuinely non-strict-compatible schema.
  • checks-node-agentic-agents: the incomplete-turn safety test now uses an explicit non-strict-agentic path and asserts single-attempt behavior.

Re-run results from this stabilization batch:

pnpm check:architecture
./node_modules/.bin/vitest run src/agents/openai-transport-stream.test.ts src/agents/runtime-plan/build.test.ts --config test/vitest/vitest.unit-fast.config.ts
./node_modules/.bin/vitest run src/agents/pi-embedded-runner/run.incomplete-turn.test.ts --config test/vitest/vitest.agents.config.ts
./node_modules/.bin/vitest run src/agents/runtime-plan/build.test.ts src/agents/auth-profile-runtime-contract.test.ts src/agents/outcome-fallback-runtime-contract.test.ts src/agents/prompt-overlay-runtime-contract.test.ts src/agents/schema-normalization-runtime-contract.test.ts src/agents/transport-params-runtime-contract.test.ts src/agents/pi-embedded-runner/run/transcript-repair-runtime-contract.test.ts src/auto-reply/reply/followup-runner.test.ts --config test/vitest/vitest.agents.config.ts
./node_modules/.bin/vitest run extensions/codex/src/app-server/auth-bridge.test.ts extensions/codex/src/app-server/auth-profile-runtime-contract.test.ts extensions/codex/src/app-server/outcome-fallback-runtime-contract.test.ts extensions/codex/src/app-server/delivery-no-reply-runtime-contract.test.ts extensions/codex/src/app-server/transcript-repair-runtime-contract.test.ts extensions/codex/src/app-server/schema-normalization-runtime-contract.test.ts extensions/codex/prompt-overlay-runtime-contract.test.ts --config test/vitest/vitest.extensions.config.ts
./node_modules/.bin/oxlint --tsconfig tsconfig.oxlint.core.json src/agents/openai-transport-stream.test.ts src/agents/pi-embedded-runner/run.incomplete-turn.test.ts src/agents/runtime-plan/build.test.ts src/agents/runtime-plan/types.ts
git diff --check

pnpm check:changed was run once after this batch. It still stops in typecheck core, but the remaining failures are repo-baseline/model-compat drift outside this stabilization batch, including src/config/types.models.ts, src/media/qr-runtime.ts, and existing compat-shape errors in src/agents/openai-transport-stream.ts / provider catalog typing. I did not fold those broader type-model issues into this RuntimePlan stabilization PR.

Stabilization Batch - 2026-04-24

Added a four-commit review/CI stabilization stack on top of the RuntimePlan implementation:

  • 125c735663 fixes the checks-node-agentic-agents timeout by removing a dynamic self-import from the Codex native web-search relevance test.
  • 54f5fbb40b resolves Codex app-server auth review threads by routing api-key/token profiles through resolveApiKeyForProfile(), covering keyRef/tokenRef, and preserving stored ChatGPT plan type metadata.
  • c585ea1035 restores resolvedRef to canonical provider/model form and carries backend identity separately as harnessId on existing llm_output events.
  • e1801dbe7a preserves permissive nested OpenAI object schemas so they downgrade to strict:false instead of being silently closed.

Local verification for this batch:

  • test/vitest/vitest.agents.config.ts: 393 files / 4,235 tests passed.
  • Targeted RuntimePlan/schema/auth tests passed.
  • pnpm check:architecture passed.
  • oxlint on changed files and git diff --check passed.
  • pnpm check:changed still fails locally in the core type lane on existing model-compat/dependency drift (supportsLongCacheRetention, @mariozechner/pi-ai, @vincentkoc/qrcode-tui), not on the RuntimePlan stabilization files.

@100yenadmin 100yenadmin marked this pull request as ready for review April 24, 2026 13:17
@100yenadmin 100yenadmin requested a review from a team as a code owner April 24, 2026 13:17
Copilot AI review requested due to automatic review settings April 24, 2026 13:17
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a contract-first Pi/Codex parity test suite across eight runtime-policy domains and introduces an internal AgentRuntimePlan so OpenClaw-owned runtime policy can be prepared once and consumed consistently by both the Pi runner and Codex app-server adapter.

Changes:

  • Added shared parity contract fixtures + Vitest suites covering tools, auth/profile, outcome/fallback, delivery/NO_REPLY, transcript repair, prompt overlays, schema normalization, and transport params.
  • Introduced src/agents/runtime-plan/* and routed follow-up delivery + model-fallback classification through narrow runtime-plan builders.
  • Routed Pi embedded runner (normal turns + compaction) and Codex app-server adapter paths to consume runtime-plan policy for tool-schema normalization, prompt overlays, transcript policy, transport params, and observability fields.

Reviewed changes

Copilot reviewed 51 out of 51 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
test/helpers/agents/transport-params-runtime-contract.ts Shared constants/cases for transport-param contract rows.
test/helpers/agents/transcript-repair-runtime-contract.ts Shared transcript fixtures (text/structured/media/data-uri).
test/helpers/agents/schema-normalization-runtime-contract.ts Shared tool/schema + model fixtures for normalization rows.
test/helpers/agents/prompt-overlay-runtime-contract.ts Shared config/model fixtures for GPT-5 overlay contract rows.
test/helpers/agents/outcome-fallback-runtime-contract.ts Shared fallback contract constants + run-result helpers.
test/helpers/agents/openclaw-owned-tool-runtime-contract.ts Shared tool hook + middleware fixtures for parity tests.
test/helpers/agents/delivery-no-reply-runtime-contract.ts Shared NO_REPLY/delivery fixture constants.
test/helpers/agents/auth-profile-runtime-contract.ts Shared auth alias registry + forwarding expectation helper.
src/plugin-sdk/schema-normalization-runtime-contract.test.ts Contract tests for provider-level OpenAI-family schema normalization hooks.
src/auto-reply/reply/followup-runner.ts Routes follow-up delivery routing + silent suppression via runtime-plan delivery plan; uses runtime-plan outcome classification.
src/auto-reply/reply/followup-runner.test.ts Adds/updates follow-up delivery tests (NO_REPLY suppression, dispatcher fallback).
src/auto-reply/reply/agent-runner-execution.ts Uses runtime-plan outcome classifier for model fallback instead of direct classifier import.
src/agents/transport-params-runtime-contract.test.ts Contract tests for Pi/OpenAI transport params, wrappers, and payload patching.
src/agents/schema-normalization-runtime-contract.test.ts Contract tests ensuring HTTP/WS/schema strictness alignment and parameter-free normalization.
src/agents/runtime-plan/types.ts Defines AgentRuntimePlan and sub-plans for auth/prompt/tools/transcript/delivery/outcome/transport/observability.
src/agents/runtime-plan/index.ts Re-exports runtime-plan builders and types.
src/agents/runtime-plan/build.ts Implements runtime-plan construction + narrow delivery/outcome plan builders.
src/agents/runtime-plan/build.test.ts Unit tests validating runtime-plan assembly and reachability of policies.
src/agents/runtime-plan/auth.ts Centralizes auth-profile forwarding policy into an auth plan.
src/agents/prompt-overlay-runtime-contract.test.ts Contract tests for GPT-5 overlay scope/config behavior.
src/agents/pi-embedded-runner/run/types.ts Adds optional runtimePlan to embedded attempt params.
src/agents/pi-embedded-runner/run/transcript-repair-runtime-contract.test.ts Contract tests for Pi orphan repair + strategy seam behavior.
src/agents/pi-embedded-runner/run/attempt.ts Consumes runtime-plan policies for tool schema normalization, prompt overlays, transcript policy, transport params, and resolvedRef observability.
src/agents/pi-embedded-runner/run.ts Builds runtime plan per attempt and forwards into embedded attempt; updates harness auth forwarding behavior.
src/agents/pi-embedded-runner/run.attempt-param-forwarding.test.ts Adds tests ensuring OpenAI-Codex auth profiles are forwarded to codex harness flows.
src/agents/pi-embedded-runner/extra-params.ts Allows applyExtraParamsToAgent to reuse precomputed prepared extra params.
src/agents/pi-embedded-runner/compact.types.ts Adds optional runtimePlan to compaction params.
src/agents/pi-embedded-runner/compact.ts Uses runtime plan in compaction for schemas/diagnostics/prompt overlays/transcript/extra params.
src/agents/pi-embedded-runner/compact.hooks.test.ts Updates mock calls for extra-params signature change.
src/agents/pi-embedded-runner/compact.hooks.harness.ts Extends harness mocks to include resolvePreparedExtraParams.
src/agents/outcome-fallback-runtime-contract.test.ts Contract tests for fallback classification mapping + non-fallback terminal cases.
src/agents/openclaw-owned-tool-runtime-contract.test.ts Pi-side parity tests for before/after tool hooks, errors, telemetry, and blocking behavior.
src/agents/openai-tool-schema.ts Tightens strict OpenAI schema normalization by defaulting additionalProperties:false when absent.
src/agents/command/attempt-execution.ts Uses runtime-plan auth plan to decide forwarded authProfileId for attempts.
src/agents/auth-profile-runtime-contract.test.ts Contract tests for auth alias forwarding/no-leak across Pi/CLI paths.
extensions/codex/src/app-server/transcript-repair-runtime-contract.test.ts Contract tests for Codex projection preserving prior structured/media context.
extensions/codex/src/app-server/thread-lifecycle.ts Uses runtime-plan prompt contribution when available to build developer instructions/overlays.
extensions/codex/src/app-server/shared-client.ts Includes authProfileId in shared-client key and applies auth profile after initialize.
extensions/codex/src/app-server/shared-client.test.ts Tests shared-client auth profile application on initialization.
extensions/codex/src/app-server/schema-normalization-runtime-contract.test.ts Contract tests for Codex dynamic tool schema boundary and fingerprint behavior.
extensions/codex/src/app-server/run-attempt.ts Consumes runtime-plan auth forwarding, resolvedRef observability, tool schema normalization, and handles auth token refresh request.
extensions/codex/src/app-server/outcome-fallback-runtime-contract.test.ts Contract tests ensuring Codex projector preserves terminal state for OpenClaw fallback classification.
extensions/codex/src/app-server/openclaw-owned-tool-runtime-contract.test.ts Codex-side parity tests for hook ordering, middleware, blocking, telemetry, and no double-wrapping.
extensions/codex/src/app-server/models.test.ts Updates auth-bridge mocking for new auth profile application helper.
extensions/codex/src/app-server/event-projector.ts Adds terminal outcome classification emission for fallback eligibility.
extensions/codex/src/app-server/delivery-no-reply-runtime-contract.test.ts Contract tests preserving silent terminal text for shared suppression.
extensions/codex/src/app-server/config.ts Extends shared-client key derivation to include authProfileId (without exposing secrets).
extensions/codex/src/app-server/auth-profile-runtime-contract.test.ts Contract tests for Codex app-server startup/resume auth profile binding behavior.
extensions/codex/src/app-server/auth-bridge.ts Adds Codex app-server auth profile login + refresh token serving helpers.
extensions/codex/src/app-server/auth-bridge.test.ts Tests app-server auth profile login and refresh behavior.
extensions/codex/prompt-overlay-runtime-contract.test.ts Contract tests for Codex provider prompt overlay contribution behavior.

Comment thread extensions/codex/src/app-server/auth-bridge.ts
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 24, 2026

Greptile Summary

This PR introduces AgentRuntimePlan — a single prepared-turn contract that centralises OpenClaw-owned runtime policy (auth/profile forwarding, prompt overlays, tool-schema normalisation, transcript repair, delivery, outcome classification, transport params, and observability) and routes both Pi and Codex paths through it. The eight parity contract test suites and the implementation stack are well-structured, and the fallback paths (raw function calls when no plan is present) keep the change non-breaking.

Confidence Score: 5/5

Safe to merge; both findings are speculative P2 concerns that do not affect correctness of the primary paths.

All identified issues are P2 or lower. The chatgptPlanType: null hardcoding is a known limitation for an initial implementation, and the additionalProperties: false normalization is intentional for OpenAI strict-mode compatibility. The core runtime plan logic, auth isolation, and delivery/outcome routing are all correctly implemented and test-covered.

extensions/codex/src/app-server/auth-bridge.ts (chatgptPlanType null handling) and src/agents/openai-tool-schema.ts (recursive additionalProperties injection).

Prompt To Fix All With AI
This is a comment left during a code review.
Path: extensions/codex/src/app-server/auth-bridge.ts
Line: 143-148

Comment:
`chatgptPlanType` is unconditionally hardcoded to `null` in `buildChatgptAuthTokensParams` and propagated directly through `refreshCodexAppServerAuthTokens`. The app-server `account/chatgptAuthTokens/refresh` endpoint returns a `ChatgptAuthTokensRefreshResponse`, and if the server uses `chatgptPlanType` to gate plan-level features or capability queries, always returning `null` means those features will be disabled even for paid/pro profiles. Is this intentional for the initial implementation, or should the plan type be read from a field on the stored credential?

How can I resolve this? If you propose a fix, please make it concise.

---

This is a comment left during a code review.
Path: src/agents/openai-tool-schema.ts
Line: 47-51

Comment:
`additionalProperties: false` is injected into every object schema that does not already declare the key, recursively. While this is correct for strict-mode compatibility on leaf/parameter schemas, it will also affect any nested object schema in a tool's input definition — including schemas that may legitimately allow open-ended additional properties (e.g., a `metadata` field typed as `object`). If a provider or plugin tool uses such a schema, normalizing it here will reject payloads that were previously valid.

How can I resolve this? If you propose a fix, please make it concise.

Reviews (1): Last reviewed commit: "fix: route fallback outcome classificati..." | Re-trigger Greptile

Comment thread extensions/codex/src/app-server/auth-bridge.ts
Comment thread src/agents/openai-tool-schema.ts
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2bbcb37853

ℹ️ 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".

Comment thread src/agents/runtime-plan/build.ts Outdated
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0dc322f24e

ℹ️ 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".

Comment thread extensions/codex/src/app-server/auth-bridge.ts
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e1801dbe7a

ℹ️ 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".

Comment on lines +78 to +80
if (credential.provider !== "openai-codex") {
throw new Error(
`Codex app-server auth profile "${profileId}" must belong to provider "openai-codex".`,
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Normalize profile provider before Codex auth-provider check

This direct equality check rejects auth profiles whose stored credential.provider is a legacy alias (for example codex-cli) even though the rest of the runtime now treats those as valid via provider-auth alias resolution. In that case applyCodexAppServerAuthProfile/token refresh will throw and Codex app-server startup fails for existing migrated profiles. Resolve the credential provider through the same auth-alias path (or accept known aliases) before rejecting it.

Useful? React with 👍 / 👎.

@steipete steipete force-pushed the contract-first/runtime-plan-implementation branch from a03ddfb to 3021b95 Compare April 24, 2026 17:31
@openclaw-barnacle openclaw-barnacle Bot added the commands Command implementations label Apr 24, 2026
@steipete steipete merged commit 860dad2 into openclaw:main Apr 24, 2026
8 checks passed
@steipete
Copy link
Copy Markdown
Contributor

Landed, thanks @100yenadmin.

Codex review/maintainer rewrite summary:

  • rebased on latest main
  • preserved the contract-first runtime-plan suite
  • added Codex auth-provider alias handling for app-server login/refresh paths
  • regenerated Plugin SDK API baseline
  • fixed latest-main rebase fallout in test/lint/type surfaces before landing

Verification:

  • pnpm check:test-types
  • pnpm lint:core
  • pnpm plugin-sdk:api:check
  • pnpm test src/agents/openai-codex-models-add-legacy.test.ts src/auto-reply/reply/get-reply-run.media-only.test.ts extensions/codex/src/app-server/auth-bridge.test.ts
  • PR checks green, including qa-lab mock parity gate

Source head: 3021b95ff431902965c5eb0e864462062b7472d0
Merge commit: 860dad268d35a944d352b0adbf34c68aa4d3aac9

Angfr95 pushed a commit to Angfr95/openclaw that referenced this pull request Apr 25, 2026
* test: add pi codex runtime contract coverage

* test: expand pi codex tool runtime contracts

* test: tighten tool runtime contracts

* test: reset tool contract param cache

* test: document codex tool middleware fixture

* test: type pi tool contract events

* test: satisfy pi tool contract test types

* test: cover tool media telemetry contracts

* test: reset plugin runtime after tool contracts

* test: add auth profile runtime contracts

* test: strengthen auth profile runtime contracts

* test: clarify auth profile contract fixtures

* test: expand auth profile contract matrix

* test: assert unrelated cli auth isolation

* test: expand auth profile contract matrix

* test: tighten auth profile contract expectations

* test: add outcome fallback runtime contracts

* test: strengthen outcome fallback contracts

* test: isolate outcome fallback contracts

* test: cover codex terminal outcome signals

* test: expand terminal fallback contracts

* test: add delivery no reply runtime contracts

* test: document json no-reply delivery gap

* test: align delivery contract fixtures

* test: add transcript repair runtime contracts

* test: tighten transcript repair contracts

* test: add prompt overlay runtime contracts

* test: tighten prompt overlay contract scope

* test: type prompt overlay contracts

* test: add schema normalization runtime contracts

* test: clarify schema normalization contract gaps

* test: simplify schema normalization contracts

* test: tighten schema normalization contract gaps

* test: cover compaction schema contract

* test: satisfy schema contract lint

* test: add transport params runtime contracts

* test: tighten transport params contract scope

* test: isolate transport params contracts

* test: lock exact transport defaults

* feat: add agent runtime plan foundation

* fix: preserve codex harness auth profiles

* fix: route followup delivery through runtime plan

* fix: normalize parameter-free openai tool schemas

* fix: satisfy runtime plan type checks

* fix: narrow followup delivery runtime planning

* fix: apply codex app-server auth profiles

* fix: classify codex terminal outcomes

* fix: prevent harness auth leakage into unrelated cli providers

* feat: expand agent runtime plan policy contract

* fix: route pi runtime policy through runtime plan

* fix: route codex runtime policy through runtime plan

* fix: route fallback outcome classification through runtime plan

* refactor: make runtime plan contracts topology-safe

* fix: restore runtime plan test type coverage

* fix: align runtime plan schema contract assertions

* fix: stabilize incomplete turn runtime tests

* fix: stabilize codex native web search test

* fix: preserve codex auth profile secret refs

* fix: keep runtime resolved refs canonical

* fix: preserve permissive nested openai schemas

* fix: accept Codex auth provider aliases

* test: update media-only groups mock

* fix: resolve runtime plan rebase checks

* fix: resolve runtime plan rebase checks

---------

Co-authored-by: Eva <eva@100yen.org>
Co-authored-by: Peter Steinberger <steipete@gmail.com>
ogt-redknie pushed a commit to ogt-redknie/OPENX that referenced this pull request May 2, 2026
* test: add pi codex runtime contract coverage

* test: expand pi codex tool runtime contracts

* test: tighten tool runtime contracts

* test: reset tool contract param cache

* test: document codex tool middleware fixture

* test: type pi tool contract events

* test: satisfy pi tool contract test types

* test: cover tool media telemetry contracts

* test: reset plugin runtime after tool contracts

* test: add auth profile runtime contracts

* test: strengthen auth profile runtime contracts

* test: clarify auth profile contract fixtures

* test: expand auth profile contract matrix

* test: assert unrelated cli auth isolation

* test: expand auth profile contract matrix

* test: tighten auth profile contract expectations

* test: add outcome fallback runtime contracts

* test: strengthen outcome fallback contracts

* test: isolate outcome fallback contracts

* test: cover codex terminal outcome signals

* test: expand terminal fallback contracts

* test: add delivery no reply runtime contracts

* test: document json no-reply delivery gap

* test: align delivery contract fixtures

* test: add transcript repair runtime contracts

* test: tighten transcript repair contracts

* test: add prompt overlay runtime contracts

* test: tighten prompt overlay contract scope

* test: type prompt overlay contracts

* test: add schema normalization runtime contracts

* test: clarify schema normalization contract gaps

* test: simplify schema normalization contracts

* test: tighten schema normalization contract gaps

* test: cover compaction schema contract

* test: satisfy schema contract lint

* test: add transport params runtime contracts

* test: tighten transport params contract scope

* test: isolate transport params contracts

* test: lock exact transport defaults

* feat: add agent runtime plan foundation

* fix: preserve codex harness auth profiles

* fix: route followup delivery through runtime plan

* fix: normalize parameter-free openai tool schemas

* fix: satisfy runtime plan type checks

* fix: narrow followup delivery runtime planning

* fix: apply codex app-server auth profiles

* fix: classify codex terminal outcomes

* fix: prevent harness auth leakage into unrelated cli providers

* feat: expand agent runtime plan policy contract

* fix: route pi runtime policy through runtime plan

* fix: route codex runtime policy through runtime plan

* fix: route fallback outcome classification through runtime plan

* refactor: make runtime plan contracts topology-safe

* fix: restore runtime plan test type coverage

* fix: align runtime plan schema contract assertions

* fix: stabilize incomplete turn runtime tests

* fix: stabilize codex native web search test

* fix: preserve codex auth profile secret refs

* fix: keep runtime resolved refs canonical

* fix: preserve permissive nested openai schemas

* fix: accept Codex auth provider aliases

* test: update media-only groups mock

* fix: resolve runtime plan rebase checks

* fix: resolve runtime plan rebase checks

---------

Co-authored-by: Eva <eva@100yen.org>
Co-authored-by: Peter Steinberger <steipete@gmail.com>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 9, 2026
* test: add pi codex runtime contract coverage

* test: expand pi codex tool runtime contracts

* test: tighten tool runtime contracts

* test: reset tool contract param cache

* test: document codex tool middleware fixture

* test: type pi tool contract events

* test: satisfy pi tool contract test types

* test: cover tool media telemetry contracts

* test: reset plugin runtime after tool contracts

* test: add auth profile runtime contracts

* test: strengthen auth profile runtime contracts

* test: clarify auth profile contract fixtures

* test: expand auth profile contract matrix

* test: assert unrelated cli auth isolation

* test: expand auth profile contract matrix

* test: tighten auth profile contract expectations

* test: add outcome fallback runtime contracts

* test: strengthen outcome fallback contracts

* test: isolate outcome fallback contracts

* test: cover codex terminal outcome signals

* test: expand terminal fallback contracts

* test: add delivery no reply runtime contracts

* test: document json no-reply delivery gap

* test: align delivery contract fixtures

* test: add transcript repair runtime contracts

* test: tighten transcript repair contracts

* test: add prompt overlay runtime contracts

* test: tighten prompt overlay contract scope

* test: type prompt overlay contracts

* test: add schema normalization runtime contracts

* test: clarify schema normalization contract gaps

* test: simplify schema normalization contracts

* test: tighten schema normalization contract gaps

* test: cover compaction schema contract

* test: satisfy schema contract lint

* test: add transport params runtime contracts

* test: tighten transport params contract scope

* test: isolate transport params contracts

* test: lock exact transport defaults

* feat: add agent runtime plan foundation

* fix: preserve codex harness auth profiles

* fix: route followup delivery through runtime plan

* fix: normalize parameter-free openai tool schemas

* fix: satisfy runtime plan type checks

* fix: narrow followup delivery runtime planning

* fix: apply codex app-server auth profiles

* fix: classify codex terminal outcomes

* fix: prevent harness auth leakage into unrelated cli providers

* feat: expand agent runtime plan policy contract

* fix: route pi runtime policy through runtime plan

* fix: route codex runtime policy through runtime plan

* fix: route fallback outcome classification through runtime plan

* refactor: make runtime plan contracts topology-safe

* fix: restore runtime plan test type coverage

* fix: align runtime plan schema contract assertions

* fix: stabilize incomplete turn runtime tests

* fix: stabilize codex native web search test

* fix: preserve codex auth profile secret refs

* fix: keep runtime resolved refs canonical

* fix: preserve permissive nested openai schemas

* fix: accept Codex auth provider aliases

* test: update media-only groups mock

* fix: resolve runtime plan rebase checks

* fix: resolve runtime plan rebase checks

---------

Co-authored-by: Eva <eva@100yen.org>
Co-authored-by: Peter Steinberger <steipete@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling commands Command implementations docs Improvements or additions to documentation extensions: codex size: XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants