fix(fetch-timeout): pass operation and url context at omitting call s… · openclaw/openclaw@d1bf0eb
pandadev66
·
2026-05-08
·
via Recent Commits to openclaw:main
File tree
extensions/matrix/src/matrix/sdk
| Original file line number | Diff line number | Diff line change |
|---|
@@ -188,6 +188,7 @@ Docs: https://docs.openclaw.ai
|
188 | 188 | - Agents/compaction: keep the recent tail after manual `/compact` when Pi returns an empty or no-op compaction summary, preventing blank checkpoints from replacing the live context. |
189 | 189 | - fix(discord): gate user allowlist name resolution [AI]. (#79002) Thanks @pgondhi987. |
190 | 190 | - fix(msteams): gate startup user allowlist resolution [AI]. (#79003) Thanks @pgondhi987. |
| 191 | +- Infra/fetch-timeout: pass `operation` and `url` context to `buildTimeoutAbortSignal` from the music-generate reference fetch and the Matrix guarded redirect transport, so the `fetch timeout reached; aborting operation` warning carries actionable structured fields instead of a bare line. Fixes #79195. Thanks @pandadev66. |
191 | 192 | - Harden macOS shell wrapper allowlist parsing [AI]. (#78518) Thanks @pgondhi987. |
192 | 193 | - macOS/config: reject stale or destructive app fallback config writes before direct replacement and keep rejected payloads as private audit artifacts, so `gateway.mode`, metadata, and auth are not silently clobbered. Fixes #64973 and #74890. Thanks @BunsDev. |
193 | 194 | - Gateway/macOS: include Apple Silicon Homebrew bin and sbin directories in generated LaunchAgent service PATHs so `openclaw gateway restart` keeps Homebrew Node installs reachable. Fixes #79232. Thanks @BunsDev. |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -117,6 +117,8 @@ async function fetchWithMatrixGuardedRedirects(params: {
|
117 | 117 | const { signal, cleanup } = buildTimeoutAbortSignal({ |
118 | 118 | timeoutMs: params.timeoutMs, |
119 | 119 | signal: params.signal, |
| 120 | +operation: "matrix.guarded-redirect-fetch", |
| 121 | +url: params.url, |
120 | 122 | }); |
121 | 123 | |
122 | 124 | for (let redirectCount = 0; redirectCount <= maxRedirects; redirectCount += 1) { |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -359,8 +359,12 @@ async function loadReferenceImages(params: {
|
359 | 359 | readFile: createSandboxBridgeReadFile({ sandbox: params.sandboxConfig }), |
360 | 360 | }) |
361 | 361 | : await (async () => { |
| 362 | +const referenceTarget = resolvedPath ?? resolvedInput; |
| 363 | +const isRemoteReference = /^https?:\/\//i.test(referenceTarget); |
362 | 364 | const { signal, cleanup } = buildTimeoutAbortSignal({ |
363 | 365 | timeoutMs: params.timeoutMs ?? DEFAULT_REFERENCE_FETCH_TIMEOUT_MS, |
| 366 | +operation: "music-generate.reference-fetch", |
| 367 | + ...(isRemoteReference ? { url: referenceTarget } : {}), |
364 | 368 | }); |
365 | 369 | try { |
366 | 370 | return await loadWebMedia(resolvedPath ?? resolvedInput, { |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -150,6 +150,23 @@ describe("buildTimeoutAbortSignal", () => {
|
150 | 150 | cleanup(); |
151 | 151 | }); |
152 | 152 | |
| 153 | +it("emits a warning without operation or url when callers omit context (#79195)", async () => { |
| 154 | +const { signal, cleanup } = buildTimeoutAbortSignal({ |
| 155 | +timeoutMs: 25, |
| 156 | +}); |
| 157 | + |
| 158 | +await vi.advanceTimersByTimeAsync(25); |
| 159 | + |
| 160 | +expect(signal?.aborted).toBe(true); |
| 161 | +expect(warn).toHaveBeenCalledTimes(1); |
| 162 | +const [, record] = warn.mock.calls[0] as [string, Record<string, unknown>]; |
| 163 | +expect(record).not.toHaveProperty("operation"); |
| 164 | +expect(record).not.toHaveProperty("url"); |
| 165 | +expect(record.consoleMessage).toBe("fetch timeout after 25ms (elapsed 25ms)"); |
| 166 | + |
| 167 | +cleanup(); |
| 168 | +}); |
| 169 | + |
153 | 170 | it("refreshes its timeout when progress is observed", async () => { |
154 | 171 | const { signal, refresh, cleanup } = buildTimeoutAbortSignal({ |
155 | 172 | timeoutMs: 25, |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。