emma-hermes/hermes_cli
Teknium d5775fe988
feat(codex-runtime): skip unavailable plugins during migration (#25437)
Followup to PR #24182 — caught when scanning OpenClaw for recent codex
fixes we hadn't considered. OpenClaw learned the hard way (#80815) that
migrating plugins which codex itself reports as unavailable produces
config that fails at activation time.

Our /codex-runtime codex_app_server enable path queries codex's
plugin/list and migrates everything where installed=true. We were
trusting codex's installation state and ignoring its availability
field. So a plugin that's installed=true but availability=UNAVAILABLE
(broken local install) or REQUIRES_AUTH (OAuth expired or never
completed) would get an [plugins."<n>@openai-curated"] entry in
~/.codex/config.toml — and the user's first codex turn after enabling
the runtime would fail because codex refuses to activate it.

Fix: filter on availability in _query_codex_plugins(). Only emit
plugins where availability is empty (older codex versions without the
field — preserve backward compat) or explicitly AVAILABLE.

Tests:
  test_plugin_discovery_skips_unavailable_plugins — verifies 4 cases:
    - good-plugin (installed=True, availability=AVAILABLE) → migrated
    - broken-plugin (installed=True, availability=UNAVAILABLE) → skipped
    - auth-pending (installed=True, availability=REQUIRES_AUTH) → skipped
    - legacy-plugin (installed=True, no availability field) → migrated
      (older codex versions; preserve backward compat)

Docs:
  Added bullet to 'What's NOT migrated' list in the docs page calling
  out the availability filter and why.

Other OpenClaw codex PRs I reviewed but did NOT apply (with reasoning):
  - #81591 (load Codex for selectable models): we resolve runtime
    per-call already, no startup-time gating to fix
  - #81510 (cron compatibility): we documented cron as untested; their
    fix is for OpenClaw-specific cron orchestration shape
  - #81223 (rotate incompatible context-engine threads): we don't
    have a Lossless context engine equivalent
  - #80688 (constrain sandbox): we don't have an outer-sandbox concept
  - #80616 (release on turn_aborted): we already handle status=
    interrupted in turn/completed correctly
  - #80278 (expose activeModel in plugin SDK): not our surface
  - #80792 (default destructive_actions on): we don't expose that knob

56 codex-runtime migration tests still green (+1 new).
2026-05-13 22:20:27 -07:00
..
__init__.py
_parser.py
_subprocess_compat.py
auth.py perf(tools): cache get_nous_auth_status() and load_env() to fix slow `hermes tools` menus (#25341) 2026-05-13 18:40:14 -07:00
auth_commands.py
azure_detect.py
backup.py
banner.py feat(codex-runtime): optional codex app-server runtime for OpenAI/Codex models (#24182) 2026-05-13 17:18:15 -07:00
browser_connect.py
callbacks.py
checkpoints.py
claw.py
cli_output.py
clipboard.py
codex_models.py
codex_runtime_plugin_migration.py feat(codex-runtime): skip unavailable plugins during migration (#25437) 2026-05-13 22:20:27 -07:00
codex_runtime_switch.py feat(codex-runtime): optional codex app-server runtime for OpenAI/Codex models (#24182) 2026-05-13 17:18:15 -07:00
colors.py
commands.py feat(codex-runtime): optional codex app-server runtime for OpenAI/Codex models (#24182) 2026-05-13 17:18:15 -07:00
completion.py test(cli): strengthen zsh completion regression coverage 2026-05-13 09:34:15 -07:00
config.py feat(dashboard): hide token/cost analytics behind config flag (default off) (#25438) 2026-05-13 22:20:25 -07:00
copilot_auth.py
cron.py
curator.py
curses_ui.py
debug.py
default_soul.py
dingtalk_auth.py
doctor.py
dump.py
env_loader.py
fallback_cmd.py
gateway.py
gateway_windows.py
goals.py feat(nous): unified client=hermes-client-v<version> tag on every Portal request (#24779) 2026-05-12 20:49:20 -07:00
hooks.py
kanban.py
kanban_db.py
kanban_diagnostics.py
kanban_specify.py feat(nous): unified client=hermes-client-v<version> tag on every Portal request (#24779) 2026-05-12 20:49:20 -07:00
logs.py
main.py feat(custom): prompt and persist explicit api_mode for custom providers 2026-05-13 13:21:33 -07:00
mcp_config.py
memory_setup.py fix(security): reduce unnecessary shell=True in subprocess calls 2026-05-13 10:31:22 -07:00
model_catalog.py
model_normalize.py
model_switch.py
models.py feat(providers): rename Alibaba Cloud to Qwen Cloud, reorder picker (#24835) 2026-05-12 22:43:41 -07:00
nous_subscription.py
oneshot.py
pairing.py
platforms.py
plugins.py feat(plugins): add thread-local tool whitelist to pre_tool_call gate 2026-05-13 22:12:47 -07:00
plugins_cmd.py
profile_distribution.py
profiles.py refactor(profiles): remove dead generate_bash_completion / generate_zsh_completion 2026-05-13 09:34:15 -07:00
providers.py
pt_input_extras.py
pty_bridge.py
relaunch.py
runtime_provider.py feat(codex-runtime): optional codex app-server runtime for OpenAI/Codex models (#24182) 2026-05-13 17:18:15 -07:00
security_advisories.py
setup.py feat(video_gen): unified video_generate tool with pluggable provider backends (#25126) 2026-05-13 16:39:41 -07:00
skills_config.py
skills_hub.py
skin_engine.py
slack_cli.py
status.py
stdio.py
timeouts.py
tips.py
tools_config.py fix(tools-config): write video_gen.provider on Reconfigure tool path (#25307) 2026-05-13 17:31:54 -07:00
uninstall.py
vercel_auth.py
voice.py
web_server.py
webhook.py