Skip to content

fix(gateway): honor external status target context - #119015

Merged
fuller-stack-dev merged 2 commits into
openclaw:mainfrom
fuller-stack-dev:codex/fix-ocm-gateway-status-target
Aug 4, 2026
Merged

fuller-stack-dev merged 2 commits into
openclaw:mainfrom
fuller-stack-dev:codex/fix-ocm-gateway-status-target

Conversation

@fuller-stack-dev

Copy link
Copy Markdown
Member

What Problem This Solves

openclaw gateway status could retarget a non-default or externally supervised invocation to an unrelated host-native gateway service. For OCM environments, that meant a selected environment on one configured port could be diagnosed through legacy service metadata on port 18789.

Why This Change Was Made

Status gathering now uses native-service command and environment metadata for probe targeting only when the active process owns that native-service identity and is not externally supervised. The service remains visible in diagnostic output, but it cannot override the active environment's config, auth, TLS, port, or restart-health context.

The resulting precedence is:

  1. explicit --url
  2. active non-default or externally supervised process context
  3. ordinary native-service command/environment context
  4. standalone config and default port

User Impact

OCM and other externally supervised or relocated OpenClaw environments diagnose their selected gateway instead of a coexisting legacy/default service. Ordinary standalone and profile-native service diagnostics retain their existing behavior.

Evidence

  • Reproduced on unmodified canonical main: caller port 18900 plus unrelated native-service metadata on 18789 selected ws://127.0.0.1:18789.
  • Focused regression suite: node scripts/run-vitest.mjs src/cli/daemon-cli/status.gather.test.ts (41 passed).
  • Full TypeScript project check: node scripts/run-tsgo.mjs -b tsconfig.projects.json (passed).
  • Changed-file remote gate passed all guards before exposing a corrected test-mock signature issue; the corrected exact branch passed the full local typecheck.
  • Source-blind compiled-CLI validation passed environment-port selection with conflicting legacy metadata, explicit URL precedence, standalone port 18789, and adjacent OCM passthrough.
  • Autoreview: clean, no actionable findings, patch correct (0.90 confidence).

@openclaw-barnacle openclaw-barnacle Bot added cli CLI command changes size: S maintainer Maintainer-authored PR labels Aug 4, 2026
@fuller-stack-dev
fuller-stack-dev marked this pull request as ready for review August 4, 2026 00:04
@fuller-stack-dev fuller-stack-dev self-assigned this Aug 4, 2026
@openclaw-barnacle openclaw-barnacle Bot added commands Command implementations size: M and removed size: S labels Aug 4, 2026
@clawsweeper

clawsweeper Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Codex review: stale review; fresh review needed.

Summary
The latest durable ClawSweeper review was for head ec6a373603c0a7c3d5d1999718726492b266ef3b, but the PR head is now 75598c9e693c950f1ef45b65a3460597c817017b. Its old verdict and PR readiness labels are no longer current.

Next step
Run or wait for a fresh ClawSweeper review on the current PR head.

@fuller-stack-dev
fuller-stack-dev merged commit afa4977 into openclaw:main Aug 4, 2026
122 of 124 checks passed
@fuller-stack-dev

Copy link
Copy Markdown
Member Author

Merged via squash.

@fuller-stack-dev
fuller-stack-dev deleted the codex/fix-ocm-gateway-status-target branch August 4, 2026 01:37
@fuller-stack-dev

Copy link
Copy Markdown
Member Author

Landed proof for exact prepared head 75598c9e693c950f1ef45b65a3460597c817017b (landed as afa4977b2c3af6bed8eba998e1f7a6cc11b3b26e):

  • Base red: OPENCLAW_VITEST_FS_MODULE_CACHE_PATH=/tmp/openclaw-pr119015-agent-red-cache node scripts/run-vitest.mjs src/cli/daemon-cli/status.gather.test.ts -t 'uses the ambient OCM gateway port instead of an unrelated native service' failed as expected: selected ws://127.0.0.1:18789, expected ws://127.0.0.1:18900.
  • Submitted-head focused green: the four original target-selection cases passed (37 skipped).
  • Repair tests were written red first; five failures exposed missing service authority propagation, misleading renderer coupling, and readiness recovery of the wrong service.
  • Fresh Blacksmith Testbox proof: run 30866103367, node scripts/run-vitest.mjs src/commands/gateway-readiness.test.ts (10/10) plus gather/print suites (69 passed, 1 platform skip).
  • Exact repaired tree build: node scripts/build-all.mjs passed all phases and guards.
  • Exact repaired tree typecheck: node scripts/run-tsgo.mjs -b tsconfig.projects.json passed.
  • Source-blind compiled CLI: external port 18900 beat visible legacy service metadata on 18789; explicit URL 18901 beat both; both exited 0.
  • Autoreview: clean, TruffleHog clean, patch correct at 0.94 confidence.
  • Exact-head hosted CI: run 30867661342 green, including openclaw/ci-gate, lint, prod/test types, build artifacts, QA smoke, and compact test shards.
  • Native preparation: OPENCLAW_TESTBOX=1 scripts/pr prepare-run 119015 passed in hosted_exact_or_recent_parent mode and verified the remote tree.

Known proof limitation: a safe temporary macOS HOME is intentionally classified as a non-default install identity, so compiled black-box validation cannot impersonate the real account-default identity without touching live user service/config paths. Exact-head focused tests cover managed/default and standalone negative controls.

All six landed file blobs exactly match the prepared head. No review threads required replies. The latest visible ClawSweeper comment was stale and contained no Rank-up moves: to apply.

vincentkoc added a commit that referenced this pull request Aug 4, 2026
* origin/main:
  fix(cli): honor local port in gateway call (#119046)
  fix(gateway): honor external status target context (#119015)
  test(xai): cover playback mark overflow
  fix(xai): bound realtime playback marks
vincentkoc added a commit that referenced this pull request Aug 4, 2026
* commit '25e3b6c9b79dadb912195d86fbff968602d58798': (54 commits)
  fix(cli): honor local port in gateway call (#119046)
  fix(gateway): honor external status target context (#119015)
  test(qa): cover agent session streaming (#119028)
  test(qa): cover sandbox workspace isolation (#119038)
  test(qa): cover progress followthrough evidence (#119039)
  fix(auth): cooldown inline api key billing failures (#88709)
  chore(gateway): cover update and setup RPCs
  test(qa): prove ClawHub catalog discovery (#118934)
  chore(qa): cover plugin testing harness contracts (#118933)
  test(xai): cover playback mark overflow
  fix(xai): bound realtime playback marks
  test(qa): prove failure recovery visibility (#119034)
  test(qa): cover direct tool invocation (#119025)
  test(qa): close external app SDK proof gaps (#118978)
  test(qa): prove container health endpoints (#119012)
  test(qa): claim sessionless heartbeat coverage (#119027)
  fix(gateway): keep plugin model allowlists static (#118854)
  fix(plugins): refresh bundled channel skills (#119020)
  test(qa): cover ClawHub package compatibility (#118985)
  test(qa): cover agent session reconnect dedupe (#119013)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 4, 2026
* fix(gateway): preserve external status target context

* fix(gateway): keep status service authority scoped
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes commands Command implementations maintainer Maintainer-authored PR size: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant