Skip to content

fix: route remaining cli-backed helper runs through CLI paths#57327

Closed
nicko-ai wants to merge 15 commits into
openclaw:mainfrom
nicko-ai:codex/fix-cli-backend-provider-runtime
Closed

fix: route remaining cli-backed helper runs through CLI paths#57327
nicko-ai wants to merge 15 commits into
openclaw:mainfrom
nicko-ai:codex/fix-cli-backend-provider-runtime

Conversation

@nicko-ai

@nicko-ai nicko-ai commented Mar 29, 2026

Copy link
Copy Markdown

Summary

Latest main already has the primary/direct CLI backend dispatch fix from #57326.

This PR keeps the remaining helper paths on the same dispatch path when the selected runtime is CLI-backed:

  • queued followup runs
  • models status --probe
  • LLM slug generation
  • cron runs whose canonical provider resolves to a CLI runtime

Changes

  • route CLI-backed helper runs through runCliAgent()
  • preserve active runtime config, auth profile, session binding, routing context, and cancellation context
  • keep auth probes isolated, tool-disabled, and on the correct CLI auth provider
  • avoid duplicate cron fallback delivery when the message tool already sent to the intended threaded target
  • cover followups, probes, slug generation, cron runtime selection, and MCP message-tool tracking

Fixes #57326

@greptile-apps

greptile-apps Bot commented Mar 29, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fixes Unknown model errors for CLI-backed model refs like claude-cli/claude-opus-4-6 and codex-cli/... by wiring CLI backends into the provider runtime hook resolution chain. The root cause was that resolveOwningPluginIdsForProvider() only inspected plugin.providers in the manifest registry, ignoring plugin.cliBackends, so requests for e.g. claude-cli returned no owning plugin and no hook plugin was loaded.

Changes:

  • src/plugins/providers.ts — extends the ownership filter to also match against plugin.cliBackends, so manifest entries like cliBackends: [\"claude-cli\"] now correctly resolve ownership to the anthropic plugin.
  • extensions/anthropic/index.ts — adds hookAliases: [\"claude-cli\"] to the Anthropic ProviderPlugin so matchesProviderId() in provider-runtime.ts can match the runtime plugin to the claude-cli namespace.
  • extensions/openai/openai-codex-provider.ts — same pattern: adds hookAliases: [\"codex-cli\"] to the OpenAI Codex provider.
  • New targeted tests in provider-runtime.test.ts and providers.test.ts cover both the manifest-level ownership lookup and the full hook-resolution chain, including the codex-cli → openai plugin → openai-codex provider two-hop case.

Confidence Score: 5/5

Safe to merge — the fix is minimal and correct, all changed paths are covered by new and updated tests, and no regressions were introduced.

All findings are P2 or lower. The core logic change in providers.ts is small (adds one OR-clause to an existing filter), the hookAliases additions match the established pattern already used by google-vertex, and the tests properly exercise the two-hop codex-cli → openai → openai-codex resolution path that is the most subtle part of the fix.

No files require special attention.

Important Files Changed

Filename Overview
src/plugins/providers.ts Extends resolveOwningPluginIdsForProvider to match against plugin.cliBackends in addition to plugin.providers. The change is a single OR-clause addition consistent with how PluginManifestRecord.cliBackends is already populated from the manifest.
extensions/anthropic/index.ts Adds hookAliases: ['claude-cli'] to the Anthropic provider registration, following the same pattern as google-vertex. Allows matchesProviderId() in provider-runtime.ts to resolve the runtime hook plugin when the provider namespace is claude-cli.
extensions/openai/openai-codex-provider.ts Adds hookAliases: ['codex-cli'] to the OpenAI Codex provider. Mirrors the Anthropic change and enables the two-hop resolution: manifest openai.cliBackends=['codex-cli'] → load openai plugin → openai-codex provider matched via hookAliases.
src/plugins/provider-runtime.test.ts Adds a new test covering the CLI backend → owning plugin → runtime provider hook chain, including the non-trivial codex-cli → openai (owning plugin) → openai-codex (matched provider) case.
src/plugins/providers.test.ts Adds anthropic and openai entries (with cliBackendIds) to the shared manifest fixture and adds a focused ownership test. An existing snapshot assertion is correctly widened to include the two new provider plugins.

Reviews (1): Last reviewed commit: "fix: resolve provider runtime hooks for ..." | Re-trigger Greptile

@nicko-ai
nicko-ai force-pushed the codex/fix-cli-backend-provider-runtime branch from bfd2355 to 71e5b52 Compare April 1, 2026 14:08
@nicko-ai nicko-ai changed the title fix: resolve provider runtime hooks for CLI backends fix: resolve cli-backed model refs through provider runtime hooks Apr 1, 2026
@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling and removed extensions: anthropic extensions: openai labels Apr 2, 2026
@nicko-ai nicko-ai changed the title fix: resolve cli-backed model refs through provider runtime hooks fix: detect registered cli backends and resolve their owners Apr 2, 2026

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d080578d1c

ℹ️ 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/plugins/providers.ts
@nicko-ai
nicko-ai force-pushed the codex/fix-cli-backend-provider-runtime branch from d080578 to 62bbcd9 Compare April 2, 2026 15:26
@nicko-ai nicko-ai changed the title fix: detect registered cli backends and resolve their owners fix: route cli-backed model refs through CLI paths Apr 2, 2026
@openclaw-barnacle openclaw-barnacle Bot added commands Command implementations size: M and removed size: S labels Apr 2, 2026

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d860fc05a5

ℹ️ 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/auto-reply/reply/followup-runner.ts Outdated

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 52dd394612

ℹ️ 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/commands/models/list.probe.ts
@nicko-ai
nicko-ai force-pushed the codex/fix-cli-backend-provider-runtime branch from 965dbb9 to c707fdc Compare April 5, 2026 15:59
@openclaw-barnacle openclaw-barnacle Bot removed the agents Agent runtime and tooling label Apr 5, 2026

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c707fdc0f5

ℹ️ 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/auto-reply/reply/followup-runner.ts
@nicko-ai
nicko-ai force-pushed the codex/fix-cli-backend-provider-runtime branch from c707fdc to 743376d Compare April 5, 2026 16:15
@nicko-ai nicko-ai changed the title fix: route cli-backed model refs through CLI paths fix: route remaining cli-backed helper runs through CLI paths Apr 5, 2026
@nicko-ai
nicko-ai force-pushed the codex/fix-cli-backend-provider-runtime branch from 743376d to e5e1fa5 Compare April 5, 2026 16:34

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2f4b2501ec

ℹ️ 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/auto-reply/reply/followup-runner.ts Outdated

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b4871863f0

ℹ️ 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/auto-reply/reply/followup-runner.ts Outdated
@nicko-ai
nicko-ai force-pushed the codex/fix-cli-backend-provider-runtime branch from b487186 to b2777ff Compare April 7, 2026 18:56
@nicko-ai
nicko-ai force-pushed the codex/fix-cli-backend-provider-runtime branch from b2777ff to 8b204c4 Compare April 10, 2026 16:02

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8b204c41c8

ℹ️ 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/auto-reply/reply/followup-runner.ts
Comment thread src/auto-reply/reply/followup-runner.ts Outdated
@nicko-ai
nicko-ai force-pushed the codex/fix-cli-backend-provider-runtime branch from b2fc749 to a748701 Compare April 14, 2026 17:01

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a7487018a1

ℹ️ 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/auto-reply/reply/followup-runner.ts Outdated

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1baad9112d

ℹ️ 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/auto-reply/reply/followup-runner.ts

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 549d770fb2

ℹ️ 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/commands/models/list.probe.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commands Command implementations size: L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CLI-backed helper paths still bypass CLI dispatch on latest main

1 participant