fix(extensions): satisfy runtime boundary checks · openclaw/openclaw@5db30ab
vincentkoc
·
2026-05-17
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -100,7 +100,7 @@ export async function startClickClackGatewayAccount(
|
100 | 100 | ctx: ChannelGatewayContext<ResolvedClickClackAccount>, |
101 | 101 | ) { |
102 | 102 | const configuredAccount = resolveClickClackAccount({ |
103 | | -cfg: ctx.cfg as CoreConfig, |
| 103 | +cfg: ctx.cfg, |
104 | 104 | accountId: ctx.account.accountId, |
105 | 105 | }); |
106 | 106 | if (!configuredAccount.configured) { |
@@ -138,7 +138,7 @@ export async function startClickClackGatewayAccount(
|
138 | 138 | afterCursor = event.cursor || afterCursor; |
139 | 139 | await processEvent({ |
140 | 140 | account, |
141 | | -config: ctx.cfg as CoreConfig, |
| 141 | +config: ctx.cfg, |
142 | 142 | client, |
143 | 143 | event, |
144 | 144 | botUserId: account.botUserId, |
@@ -162,7 +162,7 @@ export async function startClickClackGatewayAccount(
|
162 | 162 | afterCursor = event.cursor || afterCursor; |
163 | 163 | await processEvent({ |
164 | 164 | account, |
165 | | -config: ctx.cfg as CoreConfig, |
| 165 | +config: ctx.cfg, |
166 | 166 | client, |
167 | 167 | event, |
168 | 168 | botUserId: account.botUserId ?? "", |
|
| Original file line number | Diff line number | Diff line change |
|---|
|
1 | 1 | import { createHash } from "node:crypto"; |
2 | 2 | import fs from "node:fs/promises"; |
3 | 3 | import path from "node:path"; |
| 4 | +import { fetchWithSsrFGuard } from "openclaw/plugin-sdk/ssrf-runtime"; |
4 | 5 | |
5 | 6 | export type RuntimeId = "pi" | "codex"; |
6 | 7 | |
@@ -851,11 +852,20 @@ async function loadRuntimeParityMockToolCalls(
|
851 | 852 | return null; |
852 | 853 | } |
853 | 854 | try { |
854 | | -const response = await fetch(`${normalizedBaseUrl}/debug/requests`); |
855 | | -if (!response.ok) { |
856 | | -return null; |
| 855 | +const { response, release } = await fetchWithSsrFGuard({ |
| 856 | +url: `${normalizedBaseUrl}/debug/requests`, |
| 857 | +policy: { allowPrivateNetwork: true }, |
| 858 | +auditContext: "qa-lab-runtime-parity-mock-tool-calls", |
| 859 | +}); |
| 860 | +let payload: unknown; |
| 861 | +try { |
| 862 | +if (!response.ok) { |
| 863 | +return null; |
| 864 | +} |
| 865 | +payload = await response.json(); |
| 866 | +} finally { |
| 867 | +await release(); |
857 | 868 | } |
858 | | -const payload = (await response.json()) as unknown; |
859 | 869 | if (!Array.isArray(payload)) { |
860 | 870 | return null; |
861 | 871 | } |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -25,7 +25,11 @@ describe("xai onboard", () => {
|
25 | 25 | modelId: "custom-model", |
26 | 26 | modelName: "Custom", |
27 | 27 | }); |
28 | | -legacy.models!.providers!.xai!.models.push( |
| 28 | +const xaiProvider = legacy.models?.providers?.xai; |
| 29 | +if (!xaiProvider) { |
| 30 | +throw new Error("expected xAI provider fixture"); |
| 31 | +} |
| 32 | +xaiProvider.models.push( |
29 | 33 | { |
30 | 34 | id: "grok-3", |
31 | 35 | name: "Grok 3", |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。