Skip to content

fix(agents): omit unconfigured Gateway computer target from surface - #178744

Closed
HeZ2z wants to merge 1 commit into
openclaw:mainfrom
HeZ2z:fix/computer-tool-gateway-target
Closed

HeZ2z wants to merge 1 commit into
openclaw:mainfrom
HeZ2z:fix/computer-tool-gateway-target

Conversation

@HeZ2z

@HeZ2z HeZ2z commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes #178604.

On a host whose Gateway has no computer provider configured and whose only screen belongs to one paired node advertising computer.act and screen.snapshot, the computer tool surface still advertised target: "gateway" | "node" and listed "the Gateway desktop" first. Models opened desktop turns with target: "gateway"; resolveComputerBinding then threw "Gateway computer is unavailable; enable its computer provider and desktop session" before node discovery, so desktop turns started with a recoverable failed call. Only the retry without target reached the paired node.

Solution

  • computer-tool-schema.ts: the target enum and description now derive from the resolved Gateway computer status that already travels with the prepared paired surface. When configured: false, the schema advertises only target: "node" and states that target: "gateway" is unavailable. A configured or unknown status keeps both targets, preserving remote/override callers and hand-built tools. The cached-schema key includes the new flag.
  • computer-tool-guidance.ts: guidance tells the model to omit target for automatic routing, and when the Gateway has no provider it describes the paired node instead of the Gateway desktop.
  • computer-tool-bindings.ts: an explicit target: "gateway" against an unconfigured Gateway now reports the missing provider and names the paired-node retry (Omit target, or use target: node). Explicit host selection is still never redirected silently.
  • docs/nodes/computer-use.md: documents the selector behavior.

The schema depends only on configured (a config/provider-lifecycle fact already resolved for the turn by loadPairedComputerUseAvailabilityForSurface), not on volatile readiness. The tool surface was already rebuilt per turn from those owner-held facts, so this does not introduce a new prompt-cache input class.

Impact

  • Hosts with a paired desktop and no Gateway computer stop advertising an unusable target and route the first call to the node.
  • Explicit target: "gateway" keeps its documented semantics: configured-but-unavailable reports the provider error; unconfigured now points at the paired-node recovery instead of telling the operator to enable an unwanted provider.
  • No config, protocol, or public API changes. No CHANGELOG edit.

Evidence

Base bbc5e3a7c (new tests applied, fix absent):

  • computer-tool.schema.test.ts new case failed: properties.target.enum expected ["node"], received ["gateway","node"].
  • computer-tool-guidance.test.ts new case failed: the description still began "Control the Gateway desktop, ..." instead of naming the unconfigured Gateway.

With the fix:

  • pnpm test src/agents/tools/computer-tool.schema.test.ts src/agents/tools/computer-tool.gateway.test.ts src/agents/tools/computer-tool-guidance.test.ts --maxWorkers=1 -> passed 3 Vitest shards, 58 tests (39 + 15 + 4).
  • pnpm test src/agents/tools/computer-tool.node-resolution.test.ts src/agents/agent-tools.prefix-stability.test.ts --maxWorkers=1 -> passed 2 shards, 25 tests (20 + 5), including prompt-prefix stability.
  • pnpm tsgo:core -> passed.
  • node scripts/run-tsgo.mjs -p test/tsconfig/tsconfig.core.test.agents-tools.json --incremental -> passed.
  • node scripts/run-format.mts --check <touched files> -> passed for all 8 files.
  • node scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.core.json <touched files> -> 0 warnings, 0 errors.
  • git diff --check -> clean.

Reproduction boundary and gap: the new tests exercise the production tool-registry composition (loadPairedComputerUseAvailabilityForSurface -> createComputerTool -> resolveComputerBinding) with the Gateway unconfigured and one eligible paired node, using the repository's mocked Gateway/node transport. No physical paired desktop or live vision model was available in this checkout, so the reported model-choice frequency was not reproduced end to end; the advertised surface and the explicit-Gateway recovery are covered deterministically.

AI-assisted: yes. Authored by an AI coding agent; every check below executed in this checkout.

Advertise the computer tool's Gateway target only when the resolved paired surface reports a configured Gateway provider. With configured: false, offer target: node and point guidance at omitted targeting for the sole paired node; the explicit-Gateway error now names the paired-node retry instead of asking for an unwanted provider.
@clawsweeper

clawsweeper Bot commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation agents Agent runtime and tooling triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. size: S r: too-many-prs Auto-close: author has more than twenty active PRs. labels Oct 20, 2026
@openclaw-barnacle

Copy link
Copy Markdown

Closing this PR because the author has more than 20 active PRs in this repo. Please reduce the active PR queue and reopen or resubmit once it is back under the limit. You can close your own PRs to get back under the limit.

@openclaw-barnacle openclaw-barnacle Bot removed the triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. label Oct 20, 2026
@openclaw-barnacle

Copy link
Copy Markdown

Closing this PR because the author has more than 20 active PRs in this repo. Please reduce the active PR queue and reopen or resubmit once it is back under the limit. You can close your own PRs to get back under the limit.

1 similar comment
@openclaw-barnacle

Copy link
Copy Markdown

Closing this PR because the author has more than 20 active PRs in this repo. Please reduce the active PR queue and reopen or resubmit once it is back under the limit. You can close your own PRs to get back under the limit.

steipete added a commit that referenced this pull request Oct 26, 2026
…178783)

Omit the Gateway computer target when prepared capabilities report no configured Gateway desktop. Share a node-only target scope across schema, guidance, bindings and cache identity, preserving configured and session-owned desktop behavior.

Closes #178604
Supersedes #178744

Validation: schema and guidance regressions fail on the baseline; all 91 focused tests pass, including routing and prompt-prefix stability. The exact-head CI failure in run 40376678279 is the unrelated ReplyOperation fixture error reproduced by scheduled main run 40380874869 and subsequently fixed by #184907. Live-proof scope is recorded in the PR.

Co-authored-by: HeZ2z <[email protected]>
Co-authored-by: Peter Steinberger <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 27, 2026
…penclaw#178783)

Omit the Gateway computer target when prepared capabilities report no configured Gateway desktop. Share a node-only target scope across schema, guidance, bindings and cache identity, preserving configured and session-owned desktop behavior.

Closes openclaw#178604
Supersedes openclaw#178744

Validation: schema and guidance regressions fail on the baseline; all 91 focused tests pass, including routing and prompt-prefix stability. The exact-head CI failure in run 40376678279 is the unrelated ReplyOperation fixture error reproduced by scheduled main run 40380874869 and subsequently fixed by openclaw#184907. Live-proof scope is recorded in the PR.

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

Labels

agents Agent runtime and tooling docs Improvements or additions to documentation r: too-many-prs Auto-close: author has more than twenty active PRs. size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

computer tool: models pick target: "gateway" on hosts where only a paired node has a screen

1 participant