Skip to content

fix: explain unavailable Codex sessions on paired devices - #168641

Merged
obviyus merged 1 commit into
mainfrom
fix/default-openai-node-runtime
Oct 10, 2026
Merged

obviyus merged 1 commit into
mainfrom
fix/default-openai-node-runtime

Conversation

@obviyus

@obviyus obviyus commented Oct 10, 2026 •

Copy link
Copy Markdown
Collaborator

What Problem This Solves

Fixes: the New Session device picker explains a missing Codex harness as an opaque node-command failure when an OpenAI model cannot run on a paired laptop.

User Impact

The reason now explains the model/harness/device relationship first, then gives the node-side install, enable, restart, and approval steps. Users can also choose a model using the OpenClaw harness. It says unavailable, rather than incorrectly claiming every disabled or denied plugin is uninstalled.

There is no automatic installation, silent harness substitution, or change to node/Gateway approval policy.

Why This Change Was Made

Codex is an official external plugin, not part of the stock npm node package. A source checkout can also contain the plugin without enabling it on the node. The existing node-local plugin loader already declares codex.exec-server.stdio.v1 only when the plugin is present and enabled; the new integration coverage preserves missing, explicitly disabled, explicitly denied, and enabled cases. No second capability or availability owner is needed.

The shared required-command authority owns the explanation used by both device discovery and placement. Pending pairing approval and Gateway policy denial keep their existing, distinct remedies.

Provenance:

  • #88451 introduced the unified OpenAI implicit Codex default (4c33aaa86c1); #104685 moved effective-route policy into the provider (1b1cebfe421). Both were located with git log -S.
  • #127202 introduced the approved paired-device exec-server command (1353ce0995c).
  • d111676bcbf deliberately excluded Codex from the root npm package. This PR preserves that distribution decision.
  • Inspected upstream Codex codex-rs/cli/src/exec_server_command.rs at c248f6d48b97eb4a2aa56147a0b11b7d763278b9: stdio execution is native; remote registration/auth is a separate branch. OpenClaw's plugin owns the pinned binary; the ordinary node does not need a separate Codex login to advertise the command.

Evidence

  • Regression through the real environments.list handler: the new harness explanation assertion fails on e40606fdea9 with the old command-first message (1 failed / 5 passed), and passes after the fix.
  • Focused checks: 33 tests passed across the real node plugin-loader integration, node-command policy, and environment-command authority suites. The node integration loads the actual Codex plugin, not a replacement registration fixture.
  • Rebased cleanly onto f3af0db8fce, including main's repair for the earlier duplicate-import failure. Full CI is green on bb4428fc20492b523f42d812987261c74d27c138: 57 passed, 54 skipped, no failures or pending checks; CI gate.
  • Before the rebase, formatting, focused lint, core typecheck, and all core-test typecheck groups passed. The broad local changed-file gate stopped at repository-wide dead-export findings outside this patch; final verification is the green rebased CI run.
  • Actual Control UI before/after captures with deterministic Gateway fixtures, inspected on macOS arm64. The device stays disabled in both images; the improvement is the truthful explanation and recovery choices. The after fixture obtains its message from the production authority function. These are visual reproduction captures, not a live-model execution claim.

Before

Before: opaque missing command explanation

After

After: model harness and node-side recovery explanation

Bounded cost

No new imports, network calls, binary downloads, processes, polling, state, configuration, or protocol fields. The existing missing-command branch returns a different string. Production code: +4/-1 lines; tests: +50 lines; documentation: +16 lines.

Merge danger

Two-way door: reverting restores the old explanation. The blast radius is the explanation for an undeclared command owned by the Codex plugin; eligibility, explicit disable/deny decisions, runtime choice, and execution remain unchanged.

@clawsweeper

clawsweeper Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review in progress

ClawSweeper is reviewing this revision. This supersedes any previous blocked status.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime size: S labels Oct 10, 2026
@obviyus

obviyus commented Oct 10, 2026

Copy link
Copy Markdown
Collaborator Author

@clawsweeper review

@clawsweeper

clawsweeper Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@obviyus
obviyus marked this pull request as ready for review October 10, 2026 21:04
@github-actions

github-actions Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ Security sensitive changes

This maintainer PR changes sensitive security components.

No secops approval is required. This comment is informational because the PR author has Maintain or Admin access.

  • Current SHA: bb4428fc20492b523f42d812987261c74d27c138
  • Maintainer: @obviyus
  • Repository role: maintain

These security sensitive changes were made:

  • src/gateway/node-command-policy.ts: Controls sandbox containment or tool execution authority. Check filesystem and network isolation, approval scope, and command allowlists.

Carefully review these changes before merging.

@clawsweeper

clawsweeper Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR explains unavailable Codex sessions on paired devices and documents node-side recovery choices.

Example: The New Session picker shows Laptop unavailable because it does not advertise codex.exec-server.stdio.v1.

  • Before: The tooltip leads with the missing command identifier and plugin setup instructions.
  • After: The tooltip explains the Codex harness requirement, gives installation or enablement steps, and offers choosing an OpenClaw-harness model.

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) Focused, useful diagnostic repair with directly inspected UI proof and no actionable findings; CI completion remains ordinary merge gating.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (screenshot): Inspected macOS Control UI before/after screenshots exercise the device picker with deterministic Gateway fixtures; the after fixture obtains the changed message from the production authority function and shows the intended explanation while preserving the disabled device.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: A disabled paired device is explained through an internal command name without first explaining why the selected model needs Codex on that device.
Reason: The maintainer-authored change improves recovery guidance at negligible runtime cost and preserves the existing product and approval decisions.

Merge readiness

✅ Ready for maintainer review

Keep this PR open: it provides a useful, verified explanation improvement that current main lacks, with no actionable correctness or security findings.

Priority: P3
Reviewed head: bb4428fc20492b523f42d812987261c74d27c138

Before merge

None.

Findings

None.

Agent review details

How this fits together

The Gateway combines runtime command requirements with node declarations, pairing approval, and command policy, then supplies availability explanations to device discovery and placement.

flowchart LR
  A[Selected model and harness] --> C[Gateway command authority]
  B[Node declarations and approvals] --> C
  C --> D[Environment discovery]
  C --> E[Placement admission]
  D --> F[Device picker explanation]
Loading

Technical review

Best possible solution:

Keep the clearer explanation in the existing command-authority owner and retain the documented recovery choices.

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

Current-main source shows the older diagnostic, and inspected fixture-backed screenshots demonstrate its appearance in the device picker; no target code was run during this read-only review.

Is this the best way to solve the issue?

The focused string change uses the existing shared authority and preserves distinct remedies for missing capability, pending approval, and policy denial.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 26b31273295d.

Provenance checked

  • Codex missing-command diagnostic keeps the original intent (9148fbb: Explain session-host setup failures through the shared command authority, including node-local Codex installation and approval guidance.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 9148fbb adds src/gateway/node-command-policy.ts:469 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 9148fbb46abf; files: src/gateway/node-command-policy.ts)
  • gaoanze888: Raw commit 279f8bb adds src/gateway/node-command-policy.ts:568 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 279f8bbe6253; files: src/gateway/node-command-policy.ts)

PR surface

Source +3, Tests +50, Docs +16. Total +69 across 4 files. Added test files: 1.

View PR surface stats
Area Files Added Removed Net
Source 1 4 1 +3
Tests 2 50 0 +50
Docs 1 16 0 +16
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 70 1 +69

Labels

Label changes:

  • add P3: This is a bounded diagnostic and documentation improvement with unchanged execution and approval behavior.
  • add proof: sufficient: Contributor real behavior proof is sufficient.
  • add proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.
  • add rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P3: This is a bounded diagnostic and documentation improvement with unchanged execution and approval behavior.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only; repair and merge need explicit maintainer commands such as @clawsweeper autofix or @clawsweeper automerge.

History

Review history (1 earlier review cycle)
  • reviewed 2026-10-10T21:10:14.557Z sha 45de26c :: needs maintainer review before merge. :: none

Reviewed October 10, 2026, 6:05 PM ET / 22:05 UTC (Revision 2).

@obviyus
obviyus force-pushed the fix/default-openai-node-runtime branch from 45de26c to bb4428f Compare October 10, 2026 21:59
@obviyus

obviyus commented Oct 10, 2026

Copy link
Copy Markdown
Collaborator Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 10, 2026
@obviyus
obviyus merged commit 8d1c7bc into main Oct 10, 2026
138 of 139 checks passed
@obviyus
obviyus deleted the fix/default-openai-node-runtime branch October 10, 2026 22:08
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 11, 2026
…68641)

## What Problem This Solves

Fixes: the New Session device picker explains a missing Codex harness as an opaque node-command failure when an OpenAI model cannot run on a paired laptop.

## User Impact

The reason now explains the model/harness/device relationship first, then gives the node-side install, enable, restart, and approval steps. Users can also choose a model using the OpenClaw harness. It says **unavailable**, rather than incorrectly claiming every disabled or denied plugin is uninstalled.

There is no automatic installation, silent harness substitution, or change to node/Gateway approval policy.

## Why This Change Was Made

Codex is an official external plugin, not part of the stock npm node package. A source checkout can also contain the plugin without enabling it on the node. The existing node-local plugin loader already declares `codex.exec-server.stdio.v1` only when the plugin is present and enabled; the new integration coverage preserves missing, explicitly disabled, explicitly denied, and enabled cases. No second capability or availability owner is needed.

The shared required-command authority owns the explanation used by both device discovery and placement. Pending pairing approval and Gateway policy denial keep their existing, distinct remedies.

Provenance:
- [openclaw#88451](openclaw#88451) introduced the unified OpenAI implicit Codex default (`d56b73b6126`); [openclaw#104685](openclaw#104685) moved effective-route policy into the provider (`e00b05b5f3c`). Both were located with `git log -S`.
- [openclaw#127202](openclaw#127202) introduced the approved paired-device exec-server command (`a3a58230b7f`).
- [`47375e78b00`](openclaw@47375e7) deliberately excluded Codex from the root npm package. This PR preserves that distribution decision.
- Inspected upstream Codex `codex-rs/cli/src/exec_server_command.rs` at `c248f6d48b97eb4a2aa56147a0b11b7d763278b9`: stdio execution is native; remote registration/auth is a separate branch. OpenClaw's plugin owns the pinned binary; the ordinary node does not need a separate Codex login to advertise the command.

No overlap with Pash/Sarah changes in the changed files.

## Evidence

- Regression through the real `environments.list` handler: the new harness explanation assertion fails on `d1abe907cb7` with the old command-first message (1 failed / 5 passed), and passes after the fix.
- Focused checks: 33 tests passed across the real node plugin-loader integration, node-command policy, and environment-command authority suites. The node integration loads the actual Codex plugin, not a replacement registration fixture.
- Rebased cleanly onto `bf08a7bc8c4`, including main's repair for the earlier duplicate-import failure. Full CI is green on `bb4428fc20492b523f42d812987261c74d27c138`: 57 passed, 54 skipped, no failures or pending checks; [CI gate](https://github.com/openclaw/openclaw/actions/runs/38089723977/job/114324791021).
- Before the rebase, formatting, focused lint, core typecheck, and all core-test typecheck groups passed. The broad local changed-file gate stopped at repository-wide dead-export findings outside this patch; final verification is the green rebased CI run.
- Actual Control UI before/after captures with deterministic Gateway fixtures, inspected on macOS arm64. The device stays disabled in both images; the improvement is the truthful explanation and recovery choices. The after fixture obtains its message from the production authority function. These are visual reproduction captures, not a live-model execution claim.

### Before

![Before: opaque missing command explanation](https://github.com/user-attachments/assets/93c2cdbf-88b3-4357-9442-375f2223f494)

### After

![After: model harness and node-side recovery explanation](https://github.com/user-attachments/assets/ae4e0419-bb46-4401-b801-4acecc32d115)

## Bounded cost

No new imports, network calls, binary downloads, processes, polling, state, configuration, or protocol fields. The existing missing-command branch returns a different string. Production code: +4/-1 lines; tests: +50 lines; documentation: +16 lines.

## Merge danger

Two-way door: reverting restores the old explanation. The blast radius is the explanation for an undeclared command owned by the Codex plugin; eligibility, explicit disable/deny decisions, runtime choice, and execution remain unchanged.

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

Labels

docs Improvements or additions to documentation gateway Gateway runtime P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. security-sensitive-changed size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant