mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 23:28:27 +00:00
fix(gateway): guard trim crashes in subagent flow
This commit is contained in:
@@ -19,6 +19,7 @@ Docs: https://docs.openclaw.ai
|
|||||||
|
|
||||||
### Fixes
|
### Fixes
|
||||||
|
|
||||||
|
- Gateway/Subagents: guard gateway and subagent session-key/message trim paths against undefined inputs to prevent early `Cannot read properties of undefined (reading 'trim')` crashes during subagent spawn and wait flows.
|
||||||
- Agents/Workspace: guard `resolveUserPath` against undefined/null input to prevent `Cannot read properties of undefined (reading 'trim')` crashes when workspace paths are missing in embedded runner flows.
|
- Agents/Workspace: guard `resolveUserPath` against undefined/null input to prevent `Cannot read properties of undefined (reading 'trim')` crashes when workspace paths are missing in embedded runner flows.
|
||||||
- Auth/Profiles: keep active `cooldownUntil`/`disabledUntil` windows immutable across retries so mid-window failures cannot extend recovery indefinitely; only recompute a backoff window after the previous deadline has expired. This resolves cron/inbound retry loops that could trap gateways until manual `usageStats` cleanup. (#23516, #23536) Thanks @arosstale.
|
- Auth/Profiles: keep active `cooldownUntil`/`disabledUntil` windows immutable across retries so mid-window failures cannot extend recovery indefinitely; only recompute a backoff window after the previous deadline has expired. This resolves cron/inbound retry loops that could trap gateways until manual `usageStats` cleanup. (#23516, #23536) Thanks @arosstale.
|
||||||
- Channels/Security: fail closed on missing provider group policy config by defaulting runtime group policy to `allowlist` (instead of inheriting `channels.defaults.groupPolicy`) when `channels.<provider>` is absent across message channels, and align runtime + security warnings/docs to the same fallback behavior (Slack, Discord, iMessage, Telegram, WhatsApp, Signal, LINE, Matrix, Mattermost, Google Chat, IRC, Nextcloud Talk, Feishu, and Zalo user flows; plus Discord message/native-command paths). (#23367) Thanks @bmendonca3.
|
- Channels/Security: fail closed on missing provider group policy config by defaulting runtime group policy to `allowlist` (instead of inheriting `channels.defaults.groupPolicy`) when `channels.<provider>` is absent across message channels, and align runtime + security warnings/docs to the same fallback behavior (Slack, Discord, iMessage, Telegram, WhatsApp, Signal, LINE, Matrix, Mattermost, Google Chat, IRC, Nextcloud Talk, Feishu, and Zalo user flows; plus Discord message/native-command paths). (#23367) Thanks @bmendonca3.
|
||||||
|
|||||||
@@ -502,7 +502,7 @@ function resolveRequesterStoreKey(
|
|||||||
cfg: ReturnType<typeof loadConfig>,
|
cfg: ReturnType<typeof loadConfig>,
|
||||||
requesterSessionKey: string,
|
requesterSessionKey: string,
|
||||||
): string {
|
): string {
|
||||||
const raw = requesterSessionKey.trim();
|
const raw = (requesterSessionKey ?? "").trim();
|
||||||
if (!raw) {
|
if (!raw) {
|
||||||
return raw;
|
return raw;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -217,7 +217,7 @@ export const agentHandlers: GatewayRequestHandlers = {
|
|||||||
}
|
}
|
||||||
const normalizedAttachments = normalizeRpcAttachmentsToChatAttachments(request.attachments);
|
const normalizedAttachments = normalizeRpcAttachmentsToChatAttachments(request.attachments);
|
||||||
|
|
||||||
let message = request.message.trim();
|
let message = (request.message ?? "").trim();
|
||||||
let images: Array<{ type: "image"; data: string; mimeType: string }> = [];
|
let images: Array<{ type: "image"; data: string; mimeType: string }> = [];
|
||||||
if (normalizedAttachments.length > 0) {
|
if (normalizedAttachments.length > 0) {
|
||||||
try {
|
try {
|
||||||
@@ -695,7 +695,7 @@ export const agentHandlers: GatewayRequestHandlers = {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const p = params;
|
const p = params;
|
||||||
const runId = p.runId.trim();
|
const runId = (p.runId ?? "").trim();
|
||||||
const timeoutMs =
|
const timeoutMs =
|
||||||
typeof p.timeoutMs === "number" && Number.isFinite(p.timeoutMs)
|
typeof p.timeoutMs === "number" && Number.isFinite(p.timeoutMs)
|
||||||
? Math.max(0, Math.floor(p.timeoutMs))
|
? Math.max(0, Math.floor(p.timeoutMs))
|
||||||
|
|||||||
@@ -430,7 +430,7 @@ export function resolveSessionStoreKey(params: {
|
|||||||
cfg: OpenClawConfig;
|
cfg: OpenClawConfig;
|
||||||
sessionKey: string;
|
sessionKey: string;
|
||||||
}): string {
|
}): string {
|
||||||
const raw = params.sessionKey.trim();
|
const raw = (params.sessionKey ?? "").trim();
|
||||||
if (!raw) {
|
if (!raw) {
|
||||||
return raw;
|
return raw;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user