Skip to content

runtime.gateway.request refusal names neither the plugin nor the cause - #140352

Merged
obviyus merged 3 commits into
openclaw:mainfrom
Colton-Harris:fix/plugin-gateway-request-error-context
Sep 7, 2026
Merged

obviyus merged 3 commits into
openclaw:mainfrom
Colton-Harris:fix/plugin-gateway-request-error-context

Conversation

@Colton-Harris

@Colton-Harris Colton-Harris commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor

Closes #140351.

What Problem This Solves

Plugin authors received the same generic Gateway refusal whether their call lacked a plugin identity or came from a named plugin that was neither bundled nor trusted official. The error did not identify the caller or point to the restriction documentation.

Why This Change Was Made

The existing rejection boundary now names an unsupported plugin when its identity is known, distinguishes a call without identity, and links the published api.runtime.gateway restriction. Trust eligibility and successful dispatch are unchanged.

This retains @Colton-Harris's repair and consolidates its regression tests around the same rejection boundary.

User Impact

A refused plugin call now explains which identity condition failed. Unsupported calls remain blocked.

Evidence

  • Real prebuilt Gateway runs with an active external JavaScript plugin reproduce the original generic refusal and both distinct candidate messages.
  • Bundled and verified trusted-official fixture requests work on baseline and candidate. Real disable/re-enable rejects retained old callbacks while the replacement plugin remains usable.
  • Baseline and candidate preserve requested scopes, synthetic operator clients, missing-scope errors, structured downstream errors, and request timeouts.
  • All 90 focused Gateway plugin tests pass. The three new identity cases fail on the original refusal and pass on the candidate; they also verify that rejected calls never reach method dispatch.
  • Targeted lint and pinned formatting pass. A source-blind validator exercised the candidate runtime and compared the baseline controls; source-only claims are covered separately by tests and code review.

@clawsweeper

clawsweeper Bot commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime size: XS labels Sep 6, 2026
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 6, 2026
@clawsweeper

clawsweeper Bot commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 7, 2026, 12:58 AM ET / 04:58 UTC.

ClawSweeper review

What this changes

Refused plugin Gateway requests now name the plugin when known, distinguish missing identity, and link to the restriction documentation, with regression coverage for three caller cases.

Merge readiness

✅ Ready for maintainer review

This remains a useful, focused diagnostic repair: current main and the latest release still return the generic refusal. No blocking correctness or security finding was identified, and the supplied runtime evidence supports the changed behavior.

Priority: P3
Reviewed head: 7a75ccfa794bd271eb49b14a1e1272ab3bd65716

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused repair with relevant real-runtime observations, meaningful regression coverage, and no blocking findings.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): The captured body records real prebuilt Gateway runs exercising the plugin request adapter: an active external plugin receives the two candidate explanations, while trusted controls still work. This supports the diagnostic-only change and preserves the prior accepted proof assessment.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The captured body records real prebuilt Gateway runs exercising the plugin request adapter: an active external plugin receives the two candidate explanations, while trusted controls still work. This supports the diagnostic-only change and preserves the prior accepted proof assessment.
Evidence reviewed 8 items Current main still needs the diagnostic repair: Fetched main retains the single generic refusal in dispatchTrustedPluginGatewayMethod. The request still proceeds through the same eligibility check and synthetic-client dispatch.
Latest release retains the generic message: The v2026.9.2 source also contains the generic refusal. Both source reads succeeded; the subsequent historical string search could not complete because an older object was unavailable.
Patch changes diagnostics at the existing rejection boundary: The complete host-pinned introduced diff changes the refusal text and adds three test cases. Inspection of the production owner confirms that eligibility, requested scopes, timeout forwarding, and successful dispatch remain outside the changed hunk.
Findings None None.
Security None None.

How this fits together

The plugin Gateway adapter lets eligible plugins call Gateway methods within the running process. It checks plugin eligibility before dispatching and returns an error to rejected callers.

flowchart TD
  A[Plugin Gateway request] --> B[Read caller identity]
  B --> C{Eligible plugin?}
  C -->|Yes| D[Dispatch Gateway method]
  C -->|No| E[Explain refusal and link documentation]
  D --> F[Return result or method error]
  E --> G[Plugin author diagnoses refusal]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +4, Tests +27. Total +31 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 5 1 +4
Tests 1 27 0 +27
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 32 1 +31

Review metrics

None.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #140351
Summary: This PR is the explicit candidate repair for the linked diagnostic issue; neither should close before the repair lands.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Technical review

Best possible solution:

Keep the existing eligibility boundary and explain rejected calls directly at its error producer, using the documented plugin restriction.

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

Yes, from source: current main sends both an unsupported named plugin and a caller without identity through the same generic throw. No local runtime reproduction was executed.

Is this the best way to solve the issue?

Yes. Updating the existing refusal is a narrow repair, and the tests exercise the public runtime entrypoint without adding production seams or changing plugin admission.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P3: This improves plugin-author diagnostics while preserving correctly rejected requests and existing successful behavior.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The captured body records real prebuilt Gateway runs exercising the plugin request adapter: an active external plugin receives the two candidate explanations, while trusted controls still work. This supports the diagnostic-only change and preserves the prior accepted proof assessment.
  • proof: sufficient: Contributor real behavior proof is sufficient. The captured body records real prebuilt Gateway runs exercising the plugin request adapter: an active external plugin receives the two candidate explanations, while trusted controls still work. This supports the diagnostic-only change and preserves the prior accepted proof assessment.

Evidence

What I checked:

  • Current main still needs the diagnostic repair: Fetched main retains the single generic refusal in dispatchTrustedPluginGatewayMethod. The request still proceeds through the same eligibility check and synthetic-client dispatch. (src/gateway/server-plugins.ts:89, abc35e08c1a2)
  • Latest release retains the generic message: The v2026.9.2 source also contains the generic refusal. Both source reads succeeded; the subsequent historical string search could not complete because an older object was unavailable. (src/gateway/server-plugins.ts:90, 3928bad9badf)
  • Patch changes diagnostics at the existing rejection boundary: The complete host-pinned introduced diff changes the refusal text and adds three test cases. Inspection of the production owner confirms that eligibility, requested scopes, timeout forwarding, and successful dispatch remain outside the changed hunk. (src/gateway/server-plugins.ts:90, 7a75ccfa794b)
  • Established plugin contract: The runtime documentation restricts in-process Gateway requests to bundled or trusted official plugins. The eligibility helper rejects missing identities and checks explicit trust facts or the active registry; the patch does not modify it. Public docs: docs/plugins/sdk-runtime.md. (docs/plugins/sdk-runtime.md:482, 7a75ccfa794b)
  • Focused regression coverage: The new table exercises a registered community plugin, an identity absent from the registry, and a call without identity. It checks the identifying explanation, restriction text, documentation URL, and absence of method dispatch; adjacent tests cover allowed requests, scope handling, and structured errors. Tests were inspected, not executed during this read-only review. (src/gateway/server-plugins.test.ts:1537, 7a75ccfa794b)
  • Captured real-runtime observations and review continuity: The supplied PR body records baseline/candidate prebuilt Gateway runs with an active external JavaScript plugin, both distinct candidate refusal messages, successful bundled/trusted controls, and disable/re-enable behavior. The prior completed review accepted real proof and listed no findings. Captured context sourceRevision is 298d7de7995d04ff221da6fa765d1881631e4d80360c2cd25978ec5abb8d02fe; these are supplied observations, not executions performed by this reviewer.

Likely related people:

  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • obviyus: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (4 earlier review cycles)
  • reviewed 2026-09-06T18:06:11.123Z sha 55ab2bb :: needs real behavior proof before merge. :: none
  • reviewed 2026-09-06T18:14:19.893Z sha 55ab2bb :: needs real behavior proof before merge. :: none
  • reviewed 2026-09-06T18:40:43.358Z sha c498c85 :: needs real behavior proof before merge. :: none
  • reviewed 2026-09-06T19:45:26.204Z sha c498c85 :: needs maintainer review before merge. :: none

@Colton-Harris
Colton-Harris marked this pull request as ready for review September 6, 2026 18:10
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Sep 6, 2026
Colton-Harris and others added 2 commits September 6, 2026 14:35
runtime.gateway.request refused every untrusted caller with one bare
message that named neither the plugin nor the cause. A missing plugin
runtime scope and an untrusted plugin produced identical text, so an
author could not tell which condition they had hit.

Name the plugin when its identity is known, distinguish an absent
runtime scope, and point at the documented restriction. No admission
rule changes: canTrustedOfficialPluginRequestScopes still gates.

Co-Authored-By: Claude Opus 5 <[email protected]>
Address two review findings on the gateway request refusal message.

The docs pointer used a repo-relative path, `docs/plugins/sdk-runtime.md`.
The reader is a plugin author who installed from npm and has no `docs/`
directory, so the pointer was not actionable for the exact audience the
message exists to help. Cite the published page instead, matching the
sibling refusal in server-plugin-subagent-runtime.ts which already points
at this same page in URL form.

The no-identity branch claimed "No plugin runtime scope is active for this
call." That is literally false: the branch is selected by `!pluginId`, and
a gateway request scope is routinely established without one (see
server-methods.ts and local-request-context.ts). The real condition is a
missing plugin identity, so say that.

Also correct the new tests' `origin: "external"`, which is not a member of
`PluginOrigin` ("bundled" | "global" | "workspace" | "config") and failed
typecheck. Use "global", the value neighbouring tests already use for an
untrusted third-party plugin; it fails the trust predicate identically.
@Colton-Harris
Colton-Harris force-pushed the fix/plugin-gateway-request-error-context branch from 55ab2bb to c498c85 Compare September 6, 2026 18:35
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 6, 2026
@obviyus obviyus self-assigned this Sep 7, 2026
@obviyus
obviyus merged commit a6d0cbc into openclaw:main Sep 7, 2026
211 checks passed
@obviyus

obviyus commented Sep 7, 2026

Copy link
Copy Markdown
Collaborator

Thanks @Colton-Harris!

Proof: A real Gateway loaded an external JavaScript plugin and reproduced both refusal cases before and after the repair.

  • Bug: The same generic refusal hid whether a plugin identity was missing or an identified plugin was unsupported.
  • Fix: The existing rejection names the plugin when known, explains missing identity separately, and links the published restriction.
Before After
One generic refusal for both callers Distinct named-plugin and missing-identity refusals with documentation
Bundled and trusted-official requests work Allowed requests, scopes, errors, timeouts, and normal reload behavior remain unchanged

Validated 90 focused tests, three expected baseline regression failures, real disable/re-enable controls, independent behavior and code review, and the required CI gate.

Landed as a6d0cbc.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 8, 2026
Name unsupported plugin callers, distinguish missing plugin identity, and link the published Gateway restriction. Keep existing trust eligibility and successful dispatch unchanged.

Verified real Gateway refusal and allowed-plugin controls, plugin disable/re-enable, scopes, structured errors, timeouts, and 90 focused tests. The three identity regression cases fail on the original refusal and pass after the repair.

Closes openclaw#140351.

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

gateway Gateway runtime P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS 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.

runtime.gateway.request refusal names neither the plugin nor the cause

2 participants