feat(gateway): add SDK-facing tools.invoke RPC#74804
Conversation
609d6cd to
cb02468
Compare
|
Codex review: needs maintainer review before merge. What this changes: The PR adds an SDK-facing Gateway Maintainer follow-up before merge: Maintainer review is the right next action because this is an active implementation PR for a public Gateway/SDK direct tool-execution contract; there is no narrow automated repair to queue from this review. Security review: Security review cleared: No concrete security or supply-chain regression was found; the sensitive new RPC is scoped to Review detailsBest possible solution: Land one canonical additive Do we have a high-confidence way to reproduce the issue? Yes. Current main can reproduce the gap by inspection: Is this the best way to solve the issue? Yes, pending maintainer signoff. Sharing the HTTP and RPC invocation helper is the narrow maintainable direction because it avoids policy drift; the remaining decision is approval of the new public RPC/security contract and final exact-head validation. Acceptance criteria:
What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 7d7b610a2405. |
8438a2c to
32eb082
Compare
7f403f4 to
739c81b
Compare
a1d5e77 to
2fe48ba
Compare
Add Gateway artifact RPCs and SDK helpers for list/get/download, with transcript provenance checks, safer download source handling, task/run/session coverage, generated protocol models, docs, and the refreshed generated config schema baseline. Closes openclaw#74706. Refs openclaw#74898, openclaw#74769, openclaw#74804, openclaw#74786.
Add Gateway artifact RPCs and SDK helpers for list/get/download, with transcript provenance checks, safer download source handling, task/run/session coverage, generated protocol models, docs, and the refreshed generated config schema baseline. Closes openclaw#74706. Refs openclaw#74898, openclaw#74769, openclaw#74804, openclaw#74786.
Summary
@openclaw/sdkexposes atoolsnamespace, butoc.tools.invoke()had no Gateway RPC method to call and remained unsupported./tools/invokeroute.tools.invoketo the Gateway RPC surface, protocol schemas, method discovery, scope gating, SDK client/types, and docs; shared Gateway tool-invoke logic now backs both HTTP and RPC paths.idempotencyKeyas the stable tool-call id when supplied.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
Root Cause (if applicable)
N/A
Regression Test Plan (if applicable)
N/A
User-visible / Behavior Changes
SDK clients can now call
oc.tools.invoke(name, params)through the Gateway. The RPC method acceptsname, optionalargs,sessionKey,agentId,confirm, andidempotencyKeyfields.Diagram (if applicable)
Security Impact (required)
Yes/No) YesYes/No) NoYes/No) NoYes/No) YesYes/No) YesYes, explain risk + mitigation: This exposes an existing direct tool-invoke capability over Gateway WS for SDK clients. It is gated byoperator.write, reuses the existing Gateway tool policy chain and HTTP deny-list semantics, preserves owner-only filtering for non-admin clients, and reports plugin approval-needed refusals unless the caller explicitly opts intoconfirm: true.Repro + Verification
Environment
Steps
oc.tools.invoke()before this change.tools.invokemethod exists.oc.tools.invoke("sessions_list", { args: {}, sessionKey: "main" }).tools.invoke, the Gateway enforcesoperator.write, and the response uses a typed tool result/refusal envelope.Expected
/tools/invokebehavior remains compatible.Actual
Evidence
Human Verification (required)
tools.invokedispatch, Gatewaytools.invokehandler success envelope, malformed RPC params rejection,operator.writemethod scope, HTTP/tools/invokecompatibility, plugin approval-needed typed refusal without opening an approval request by default, and mismatchedsessionKey/agentIdrejection./tools/invokecompatibility, SDKnamefield, high-risk deny-list preservation, owner-only filtering path, configured session fallback,gateway.tools.allow/denyprecedence,confirm: falseapproval reporting behavior, andconfirm: trueapproval request behavior.Commands run:
pnpm check:changedpassed in a fresh Testbox after installing SwiftLint 0.63.2 into the box for the app lint lane. After rebasing onto currentorigin/main,pnpm check:docs,pnpm protocol:check, andgit diff --check origin/main...HEADpassed locally.Duplicate / Related Threads
message, not this SDK RPC.tools.invoke.prtags.dutiful.devreturned 502 for both group listing and text search, so prtags sync is the only blocked curation write path.Review Conversations
Compatibility / Migration
Yes/No) YesYes/No) NoYes/No) NoRisks and Mitigations
confirm: trueto request approval explicitly.