openclaw - ✅(Solved) Fix [Bug]: pdf-tool eagerly loads pdfjs-dist on every agent turn in 2026.5.2, causing ~2.5s blocking overhead even when PDF is denied [2 pull requests, 1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#76997Fetched 2026-05-04 04:59:37
View on GitHub
Comments
1
Participants
2
Timeline
6
Reactions
2
Author
Timeline (top)
cross-referenced ×2labeled ×2closed ×1commented ×1
<html> <body> <!--StartFragment--><p style="box-sizing: border-box; margin: 0.75em 0px 0px; color: rgb(60, 60, 67); font-family: Inter, -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Roboto, sans-serif; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: -0.15px; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(248, 249, 250); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">Since upgrading to 2026.5.2,<span> </span><code style="box-sizing: border-box; font-family: &quot;JetBrains Mono&quot;, ui-monospace, SFMono-Regular, &quot;SF Mono&quot;, Menlo, Monaco, Consolas, monospace; background: none 0% 0% / auto repeat scroll padding-box border-box rgb(236, 238, 240); border-radius: 6px; padding: 0.15em 0.35em; font-size: 0.9em; overflow-wrap: normal; word-break: keep-all; border: 1px solid rgba(0, 0, 0, 0.1);">pdfjs-dist</code><span> </span>is loaded synchronously on every agent turn, blocking the Node.js event loop for 2.4–2.7 seconds. This happens unconditionally — even when the PDF tool is explicitly denied and no PDF has ever been requested.</p><p style="box-sizing: border-box; margin: 0.75em 0px 0px; color: rgb(60, 60, 67); font-family: Inter, -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Roboto, sans-serif; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: -0.15px; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(248, 249, 250); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">The per-turn trace shows it clearly:</p><div class="code-block-wrapper" style="box-sizing: border-box; border-radius: 6px; margin-top: 0.75em; position: relative; overflow: hidden; color: rgb(60, 60, 67); font-family: Inter, -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Roboto, sans-serif; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: -0.15px; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(248, 249, 250); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;"><div class="code-block-header" style="box-sizing: border-box; background: rgba(0, 0, 0, 0.08); justify-content: space-between; align-items: center; gap: 8px; padding: 4px 8px 4px 12px; font-size: 12px; line-height: 1; display: flex;"><button type="button" class="code-block-copy" data-code="openclaw-tools:pdf-tool:2620ms@3031ms ← 2.6s just from pdf init openclaw-tools:plugin-tools:322ms@3354ms tool-policy:403ms@403ms Total core-plugin-tool overhead: ~3.4s per turn" aria-label="Copy code" style="box-sizing: border-box; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: 11px; line-height: inherit; font-family: Inter, -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Roboto, sans-serif; font-optical-sizing: inherit; font-size-adjust: inherit; font-kerning: inherit; font-feature-settings: inherit; font-variation-settings: inherit; font-language-override: inherit; color: rgb(110, 110, 115); appearance: none; cursor: pointer; border-radius: 6px; background: 0px 0px; border-width: medium; border-style: none; border-color: currentcolor; border-image: initial; padding: 2px 6px; transition: color 0.15s, background 0.15s;"><span class="code-block-copy__idle" style="box-sizing: border-box;">Copy</span></button></div><pre style="box-sizing: border-box; border-radius: 0px 0px 6px 6px; background: none 0% 0% / auto repeat scroll padding-box border-box rgb(236, 238, 240); padding: 10px 12px; overflow: auto; margin: 0px; border: 1px solid rgba(0, 0, 0, 0.1);"><code style="box-sizing: border-box; font-family: &quot;JetBrains Mono&quot;, ui-monospace, SFMono-Regular, &quot;SF Mono&quot;, Menlo, Monaco, Consolas, monospace; background: 0px 0px; border-radius: 6px; padding: 0px; font-size: 12px; white-space: pre;">openclaw-tools:pdf-tool:2620ms@3031ms ← 2.6s just from pdf init openclaw-tools:plugin-tools:322ms@3354ms tool-policy:403ms@403ms Total core-plugin-tool overhead: ~3.4s per turn </code></pre></div><p style="box-sizing: border-box; margin: 0px; color: rgb(60, 60, 67); font-family: Inter, -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Roboto, sans-serif; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: -0.15px; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(248, 249, 250); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">Accompanying liveness warnings confirm event loop blocking:</p><div class="code-block-wrapper" style="box-sizing: border-box; border-radius: 6px; margin-top: 0.75em; position: relative; overflow: hidden; color: rgb(60, 60, 67); font-family: Inter, -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Roboto, sans-serif; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: -0.15px; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(248, 249, 250); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;"><div class="code-block-header" style="box-sizing: border-box; background: rgba(0, 0, 0, 0.08); justify-content: space-between; align-items: center; gap: 8px; padding: 4px 8px 4px 12px; font-size: 12px; line-height: 1; display: flex;"><button type="button" class="code-block-copy" data-code="liveness warning: eventLoopDelayMaxMs=3359.6 (one per turn, consistently)" aria-label="Copy code" style="box-sizing: border-box; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: 11px; line-height: inherit; font-family: Inter, -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Roboto, sans-serif; font-optical-sizing: inherit; font-size-adjust: inherit; font-kerning: inherit; font-feature-settings: inherit; font-variation-settings: inherit; font-language-override: inherit; color: rgb(110, 110, 115); appearance: none; cursor: pointer; border-radius: 6px; background: 0px 0px; border-width: medium; border-style: none; border-color: currentcolor; border-image: initial; padding: 2px 6px; transition: color 0.15s, background 0.15s;"><span class="code-block-copy__idle" style="box-sizing: border-box;">Copy</span></button></div><pre style="box-sizing: border-box; border-radius: 0px 0px 6px 6px; background: none 0% 0% / auto repeat scroll padding-box border-box rgb(236, 238, 240); padding: 10px 12px; overflow: auto; margin: 0px; border: 1px solid rgba(0, 0, 0, 0.1);"><code style="box-sizing: border-box; font-family: &quot;JetBrains Mono&quot;, ui-monospace, SFMono-Regular, &quot;SF Mono&quot;, Menlo, Monaco, Consolas, monospace; background: 0px 0px; border-radius: 6px; padding: 0px; font-size: 12px; white-space: pre;">liveness warning: eventLoopDelayMaxMs=3359.6 (one per turn, consistently) </code></pre></div><hr style="box-sizing: border-box; border-width: 0.666667px 0px 0px; border-style: solid none none; border-color: rgb(229, 229, 234) currentcolor currentcolor; border-image: initial; margin: 1em 0px; font-family: Inter, -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Roboto, sans-serif; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: -0.15px; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(248, 249, 250); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;"><p style="box-sizing: border-box; margin: 0px; color: rgb(60, 60, 67); font-family: Inter, -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Roboto, sans-serif; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: -0.15px; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(248, 249, 250); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;"><strong style="box-sizing: border-box;">Config — PDF is explicitly disabled</strong></p><details class="json-collapse" style="box-sizing: border-box; margin-top: 0.75em; color: rgb(60, 60, 67); font-family: Inter, -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Roboto, sans-serif; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: -0.15px; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(248, 249, 250); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;"><div class="code-block-wrapper" style="box-sizing: border-box; border-radius: 6px; margin-top: 0.75em; position: relative; overflow: hidden;"><div class="code-block-header" style="box-sizing: border-box; background: rgba(0, 0, 0, 0.08); justify-content: space-between; align-items: center; gap: 8px; padding: 4px 8px 4px 12px; font-size: 12px; line-height: 1; display: flex;"><button type="button" class="code-block-copy" data-code="{ &quot;tools&quot;: { &quot;deny&quot;: [&quot;pdf&quot;] } }" aria-label="Copy code" style="box-sizing: border-box; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: 11px; line-height: inherit; font-family: Inter, -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Roboto, sans-serif; font-optical-sizing: inherit; font-size-adjust: inherit; font-kerning: inherit; font-feature-settings: inherit; font-variation-settings: inherit; font-language-override: inherit; color: rgb(110, 110, 115); appearance: none; cursor: pointer; border-radius: 6px; background: 0px 0px; border-width: medium; border-style: none; border-color: currentcolor; border-image: initial; padding: 2px 6px; transition: color 0.15s, background 0.15s;"><span class="code-block-copy__idle" style="box-sizing: border-box;"></span></button></div><pre style="box-sizing: border-box; border-radius: 0px 0px 6px 6px; background: none 0% 0% / auto repeat scroll padding-box border-box rgb(236, 238, 240); padding: 10px 12px; overflow: auto; margin: 0px; border: 1px solid rgba(0, 0, 0, 0.1);"><code class="language-json" style="box-sizing: border-box; font-family: &quot;JetBrains Mono&quot;, ui-monospace, SFMono-Regular, &quot;SF Mono&quot;, Menlo, Monaco, Consolas, monospace; background: 0px 0px; border-radius: 6px; padding: 0px; font-size: 12px; white-space: pre;"></code></pre></div></details><p style="box-sizing: border-box; margin: 0px; color: rgb(60, 60, 67); font-family: Inter, -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Roboto, sans-serif; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: -0.15px; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(248, 249, 250); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">The<span> </span><code style="box-sizing: border-box; font-family: &quot;JetBrains Mono&quot;, ui-monospace, SFMono-Regular, &quot;SF Mono&quot;, Menlo, Monaco, Consolas, monospace; background: none 0% 0% / auto repeat scroll padding-box border-box rgb(236, 238, 240); border-radius: 6px; padding: 0.15em 0.35em; font-size: 0.9em; overflow-wrap: normal; word-break: keep-all; border: 1px solid rgba(0, 0, 0, 0.1);">tools.deny</code><span> </span>list correctly prevents the tool from appearing in the model schema, but does<span> </span><strong style="box-sizing: border-box;">not</strong><span> </span>prevent<span> </span><code style="box-sizing: border-box; font-family: &quot;JetBrains Mono&quot;, ui-monospace, SFMono-Regular, &quot;SF Mono&quot;, Menlo, Monaco, Consolas, monospace; background: none 0% 0% / auto repeat scroll padding-box border-box rgb(236, 238, 240); border-radius: 6px; padding: 0.15em 0.35em; font-size: 0.9em; overflow-wrap: normal; word-break: keep-all; border: 1px solid rgba(0, 0, 0, 0.1);">pdfjs-dist</code><span> </span>from loading at init time.</p><hr style="box-sizing: border-box; border-width: 0.666667px 0px 0px; border-style: solid none none; border-color: rgb(229, 229, 234) currentcolor currentcolor; border-image: initial; margin: 1em 0px; font-family: Inter, -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Roboto, sans-serif; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: -0.15px; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(248, 249, 250); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;"><p style="box-sizing: border-box; margin: 0px; color: rgb(60, 60, 67); font-family: Inter, -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Roboto, sans-serif; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: -0.15px; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(248, 249, 250); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;"><strong style="box-sizing: border-box;">Workarounds attempted (all failed)</strong></p> Attempt | Result -- | -- tools.deny: ["pdf"] | Stops tool usage, not initialisation agents.defaults.pdfModel: { primary: "__disabled__" } | Falls through to session default (anthropic/claude-sonnet-4-6), which is auth-backed + native-PDF capable — tool registers anyway tools.pdf: { enabled: false } | Schema rejected — "tools: Unrecognized key: pdf" Disabling document-extract plugin | Not configurable — built-in

<br class="Apple-interchange-newline"><!--EndFragment-->

</body> </html>

Root Cause

<html> <body> <!--StartFragment--><p style="box-sizing: border-box; margin: 0.75em 0px 0px; color: rgb(60, 60, 67); font-family: Inter, -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Roboto, sans-serif; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: -0.15px; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(248, 249, 250); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">Since upgrading to 2026.5.2,<span> </span><code style="box-sizing: border-box; font-family: &quot;JetBrains Mono&quot;, ui-monospace, SFMono-Regular, &quot;SF Mono&quot;, Menlo, Monaco, Consolas, monospace; background: none 0% 0% / auto repeat scroll padding-box border-box rgb(236, 238, 240); border-radius: 6px; padding: 0.15em 0.35em; font-size: 0.9em; overflow-wrap: normal; word-break: keep-all; border: 1px solid rgba(0, 0, 0, 0.1);">pdfjs-dist</code><span> </span>is loaded synchronously on every agent turn, blocking the Node.js event loop for 2.4–2.7 seconds. This happens unconditionally — even when the PDF tool is explicitly denied and no PDF has ever been requested.</p><p style="box-sizing: border-box; margin: 0.75em 0px 0px; color: rgb(60, 60, 67); font-family: Inter, -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Roboto, sans-serif; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: -0.15px; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(248, 249, 250); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">The per-turn trace shows it clearly:</p><div class="code-block-wrapper" style="box-sizing: border-box; border-radius: 6px; margin-top: 0.75em; position: relative; overflow: hidden; color: rgb(60, 60, 67); font-family: Inter, -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Roboto, sans-serif; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: -0.15px; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(248, 249, 250); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;"><div class="code-block-header" style="box-sizing: border-box; background: rgba(0, 0, 0, 0.08); justify-content: space-between; align-items: center; gap: 8px; padding: 4px 8px 4px 12px; font-size: 12px; line-height: 1; display: flex;"><button type="button" class="code-block-copy" data-code="openclaw-tools:pdf-tool:2620ms@3031ms ← 2.6s just from pdf init openclaw-tools:plugin-tools:322ms@3354ms tool-policy:403ms@403ms Total core-plugin-tool overhead: ~3.4s per turn" aria-label="Copy code" style="box-sizing: border-box; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: 11px; line-height: inherit; font-family: Inter, -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Roboto, sans-serif; font-optical-sizing: inherit; font-size-adjust: inherit; font-kerning: inherit; font-feature-settings: inherit; font-variation-settings: inherit; font-language-override: inherit; color: rgb(110, 110, 115); appearance: none; cursor: pointer; border-radius: 6px; background: 0px 0px; border-width: medium; border-style: none; border-color: currentcolor; border-image: initial; padding: 2px 6px; transition: color 0.15s, background 0.15s;"><span class="code-block-copy__idle" style="box-sizing: border-box;">Copy</span></button></div><pre style="box-sizing: border-box; border-radius: 0px 0px 6px 6px; background: none 0% 0% / auto repeat scroll padding-box border-box rgb(236, 238, 240); padding: 10px 12px; overflow: auto; margin: 0px; border: 1px solid rgba(0, 0, 0, 0.1);"><code style="box-sizing: border-box; font-family: &quot;JetBrains Mono&quot;, ui-monospace, SFMono-Regular, &quot;SF Mono&quot;, Menlo, Monaco, Consolas, monospace; background: 0px 0px; border-radius: 6px; padding: 0px; font-size: 12px; white-space: pre;">openclaw-tools:pdf-tool:2620ms@3031ms ← 2.6s just from pdf init openclaw-tools:plugin-tools:322ms@3354ms tool-policy:403ms@403ms Total core-plugin-tool overhead: ~3.4s per turn </code></pre></div><p style="box-sizing: border-box; margin: 0px; color: rgb(60, 60, 67); font-family: Inter, -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Roboto, sans-serif; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: -0.15px; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(248, 249, 250); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">Accompanying liveness warnings confirm event loop blocking:</p><div class="code-block-wrapper" style="box-sizing: border-box; border-radius: 6px; margin-top: 0.75em; position: relative; overflow: hidden; color: rgb(60, 60, 67); font-family: Inter, -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Roboto, sans-serif; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: -0.15px; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(248, 249, 250); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;"><div class="code-block-header" style="box-sizing: border-box; background: rgba(0, 0, 0, 0.08); justify-content: space-between; align-items: center; gap: 8px; padding: 4px 8px 4px 12px; font-size: 12px; line-height: 1; display: flex;"><button type="button" class="code-block-copy" data-code="liveness warning: eventLoopDelayMaxMs=3359.6 (one per turn, consistently)" aria-label="Copy code" style="box-sizing: border-box; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: 11px; line-height: inherit; font-family: Inter, -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Roboto, sans-serif; font-optical-sizing: inherit; font-size-adjust: inherit; font-kerning: inherit; font-feature-settings: inherit; font-variation-settings: inherit; font-language-override: inherit; color: rgb(110, 110, 115); appearance: none; cursor: pointer; border-radius: 6px; background: 0px 0px; border-width: medium; border-style: none; border-color: currentcolor; border-image: initial; padding: 2px 6px; transition: color 0.15s, background 0.15s;"><span class="code-block-copy__idle" style="box-sizing: border-box;">Copy</span></button></div><pre style="box-sizing: border-box; border-radius: 0px 0px 6px 6px; background: none 0% 0% / auto repeat scroll padding-box border-box rgb(236, 238, 240); padding: 10px 12px; overflow: auto; margin: 0px; border: 1px solid rgba(0, 0, 0, 0.1);"><code style="box-sizing: border-box; font-family: &quot;JetBrains Mono&quot;, ui-monospace, SFMono-Regular, &quot;SF Mono&quot;, Menlo, Monaco, Consolas, monospace; background: 0px 0px; border-radius: 6px; padding: 0px; font-size: 12px; white-space: pre;">liveness warning: eventLoopDelayMaxMs=3359.6 (one per turn, consistently) </code></pre></div><hr style="box-sizing: border-box; border-width: 0.666667px 0px 0px; border-style: solid none none; border-color: rgb(229, 229, 234) currentcolor currentcolor; border-image: initial; margin: 1em 0px; font-family: Inter, -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Roboto, sans-serif; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: -0.15px; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(248, 249, 250); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;"><p style="box-sizing: border-box; margin: 0px; color: rgb(60, 60, 67); font-family: Inter, -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Roboto, sans-serif; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: -0.15px; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(248, 249, 250); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;"><strong style="box-sizing: border-box;">Config — PDF is explicitly disabled</strong></p><details class="json-collapse" style="box-sizing: border-box; margin-top: 0.75em; color: rgb(60, 60, 67); font-family: Inter, -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Roboto, sans-serif; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: -0.15px; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(248, 249, 250); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;"><div class="code-block-wrapper" style="box-sizing: border-box; border-radius: 6px; margin-top: 0.75em; position: relative; overflow: hidden;"><div class="code-block-header" style="box-sizing: border-box; background: rgba(0, 0, 0, 0.08); justify-content: space-between; align-items: center; gap: 8px; padding: 4px 8px 4px 12px; font-size: 12px; line-height: 1; display: flex;"><button type="button" class="code-block-copy" data-code="{ &quot;tools&quot;: { &quot;deny&quot;: [&quot;pdf&quot;] } }" aria-label="Copy code" style="box-sizing: border-box; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: 11px; line-height: inherit; font-family: Inter, -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Roboto, sans-serif; font-optical-sizing: inherit; font-size-adjust: inherit; font-kerning: inherit; font-feature-settings: inherit; font-variation-settings: inherit; font-language-override: inherit; color: rgb(110, 110, 115); appearance: none; cursor: pointer; border-radius: 6px; background: 0px 0px; border-width: medium; border-style: none; border-color: currentcolor; border-image: initial; padding: 2px 6px; transition: color 0.15s, background 0.15s;"><span class="code-block-copy__idle" style="box-sizing: border-box;"></span></button></div><pre style="box-sizing: border-box; border-radius: 0px 0px 6px 6px; background: none 0% 0% / auto repeat scroll padding-box border-box rgb(236, 238, 240); padding: 10px 12px; overflow: auto; margin: 0px; border: 1px solid rgba(0, 0, 0, 0.1);"><code class="language-json" style="box-sizing: border-box; font-family: &quot;JetBrains Mono&quot;, ui-monospace, SFMono-Regular, &quot;SF Mono&quot;, Menlo, Monaco, Consolas, monospace; background: 0px 0px; border-radius: 6px; padding: 0px; font-size: 12px; white-space: pre;"></code></pre></div></details><p style="box-sizing: border-box; margin: 0px; color: rgb(60, 60, 67); font-family: Inter, -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Roboto, sans-serif; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: -0.15px; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(248, 249, 250); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">The<span> </span><code style="box-sizing: border-box; font-family: &quot;JetBrains Mono&quot;, ui-monospace, SFMono-Regular, &quot;SF Mono&quot;, Menlo, Monaco, Consolas, monospace; background: none 0% 0% / auto repeat scroll padding-box border-box rgb(236, 238, 240); border-radius: 6px; padding: 0.15em 0.35em; font-size: 0.9em; overflow-wrap: normal; word-break: keep-all; border: 1px solid rgba(0, 0, 0, 0.1);">tools.deny</code><span> </span>list correctly prevents the tool from appearing in the model schema, but does<span> </span><strong style="box-sizing: border-box;">not</strong><span> </span>prevent<span> </span><code style="box-sizing: border-box; font-family: &quot;JetBrains Mono&quot;, ui-monospace, SFMono-Regular, &quot;SF Mono&quot;, Menlo, Monaco, Consolas, monospace; background: none 0% 0% / auto repeat scroll padding-box border-box rgb(236, 238, 240); border-radius: 6px; padding: 0.15em 0.35em; font-size: 0.9em; overflow-wrap: normal; word-break: keep-all; border: 1px solid rgba(0, 0, 0, 0.1);">pdfjs-dist</code><span> </span>from loading at init time.</p><hr style="box-sizing: border-box; border-width: 0.666667px 0px 0px; border-style: solid none none; border-color: rgb(229, 229, 234) currentcolor currentcolor; border-image: initial; margin: 1em 0px; font-family: Inter, -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Roboto, sans-serif; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: -0.15px; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(248, 249, 250); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;"><p style="box-sizing: border-box; margin: 0px; color: rgb(60, 60, 67); font-family: Inter, -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Roboto, sans-serif; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: -0.15px; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(248, 249, 250); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;"><strong style="box-sizing: border-box;">Workarounds attempted (all failed)</strong></p> Attempt | Result -- | -- tools.deny: ["pdf"] | Stops tool usage, not initialisation agents.defaults.pdfModel: { primary: "__disabled__" } | Falls through to session default (anthropic/claude-sonnet-4-6), which is auth-backed + native-PDF capable — tool registers anyway tools.pdf: { enabled: false } | Schema rejected — "tools: Unrecognized key: pdf" Disabling document-extract plugin | Not configurable — built-in

<br class="Apple-interchange-newline"><!--EndFragment-->

</body> </html>

Fix Action

Fix / Workaround

<html> <body> <!--StartFragment--><p style="box-sizing: border-box; margin: 0.75em 0px 0px; color: rgb(60, 60, 67); font-family: Inter, -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Roboto, sans-serif; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: -0.15px; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(248, 249, 250); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">Since upgrading to 2026.5.2,<span> </span><code style="box-sizing: border-box; font-family: &quot;JetBrains Mono&quot;, ui-monospace, SFMono-Regular, &quot;SF Mono&quot;, Menlo, Monaco, Consolas, monospace; background: none 0% 0% / auto repeat scroll padding-box border-box rgb(236, 238, 240); border-radius: 6px; padding: 0.15em 0.35em; font-size: 0.9em; overflow-wrap: normal; word-break: keep-all; border: 1px solid rgba(0, 0, 0, 0.1);">pdfjs-dist</code><span> </span>is loaded synchronously on every agent turn, blocking the Node.js event loop for 2.4–2.7 seconds. This happens unconditionally — even when the PDF tool is explicitly denied and no PDF has ever been requested.</p><p style="box-sizing: border-box; margin: 0.75em 0px 0px; color: rgb(60, 60, 67); font-family: Inter, -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Roboto, sans-serif; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: -0.15px; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(248, 249, 250); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">The per-turn trace shows it clearly:</p><div class="code-block-wrapper" style="box-sizing: border-box; border-radius: 6px; margin-top: 0.75em; position: relative; overflow: hidden; color: rgb(60, 60, 67); font-family: Inter, -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Roboto, sans-serif; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: -0.15px; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(248, 249, 250); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;"><div class="code-block-header" style="box-sizing: border-box; background: rgba(0, 0, 0, 0.08); justify-content: space-between; align-items: center; gap: 8px; padding: 4px 8px 4px 12px; font-size: 12px; line-height: 1; display: flex;"><button type="button" class="code-block-copy" data-code="openclaw-tools:pdf-tool:2620ms@3031ms ← 2.6s just from pdf init openclaw-tools:plugin-tools:322ms@3354ms tool-policy:403ms@403ms Total core-plugin-tool overhead: ~3.4s per turn" aria-label="Copy code" style="box-sizing: border-box; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: 11px; line-height: inherit; font-family: Inter, -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Roboto, sans-serif; font-optical-sizing: inherit; font-size-adjust: inherit; font-kerning: inherit; font-feature-settings: inherit; font-variation-settings: inherit; font-language-override: inherit; color: rgb(110, 110, 115); appearance: none; cursor: pointer; border-radius: 6px; background: 0px 0px; border-width: medium; border-style: none; border-color: currentcolor; border-image: initial; padding: 2px 6px; transition: color 0.15s, background 0.15s;"><span class="code-block-copy__idle" style="box-sizing: border-box;">Copy</span></button></div><pre style="box-sizing: border-box; border-radius: 0px 0px 6px 6px; background: none 0% 0% / auto repeat scroll padding-box border-box rgb(236, 238, 240); padding: 10px 12px; overflow: auto; margin: 0px; border: 1px solid rgba(0, 0, 0, 0.1);"><code style="box-sizing: border-box; font-family: &quot;JetBrains Mono&quot;, ui-monospace, SFMono-Regular, &quot;SF Mono&quot;, Menlo, Monaco, Consolas, monospace; background: 0px 0px; border-radius: 6px; padding: 0px; font-size: 12px; white-space: pre;">openclaw-tools:pdf-tool:2620ms@3031ms ← 2.6s just from pdf init openclaw-tools:plugin-tools:322ms@3354ms tool-policy:403ms@403ms Total core-plugin-tool overhead: ~3.4s per turn </code></pre></div><p style="box-sizing: border-box; margin: 0px; color: rgb(60, 60, 67); font-family: Inter, -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Roboto, sans-serif; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: -0.15px; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(248, 249, 250); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">Accompanying liveness warnings confirm event loop blocking:</p><div class="code-block-wrapper" style="box-sizing: border-box; border-radius: 6px; margin-top: 0.75em; position: relative; overflow: hidden; color: rgb(60, 60, 67); font-family: Inter, -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Roboto, sans-serif; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: -0.15px; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(248, 249, 250); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;"><div class="code-block-header" style="box-sizing: border-box; background: rgba(0, 0, 0, 0.08); justify-content: space-between; align-items: center; gap: 8px; padding: 4px 8px 4px 12px; font-size: 12px; line-height: 1; display: flex;"><button type="button" class="code-block-copy" data-code="liveness warning: eventLoopDelayMaxMs=3359.6 (one per turn, consistently)" aria-label="Copy code" style="box-sizing: border-box; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: 11px; line-height: inherit; font-family: Inter, -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Roboto, sans-serif; font-optical-sizing: inherit; font-size-adjust: inherit; font-kerning: inherit; font-feature-settings: inherit; font-variation-settings: inherit; font-language-override: inherit; color: rgb(110, 110, 115); appearance: none; cursor: pointer; border-radius: 6px; background: 0px 0px; border-width: medium; border-style: none; border-color: currentcolor; border-image: initial; padding: 2px 6px; transition: color 0.15s, background 0.15s;"><span class="code-block-copy__idle" style="box-sizing: border-box;">Copy</span></button></div><pre style="box-sizing: border-box; border-radius: 0px 0px 6px 6px; background: none 0% 0% / auto repeat scroll padding-box border-box rgb(236, 238, 240); padding: 10px 12px; overflow: auto; margin: 0px; border: 1px solid rgba(0, 0, 0, 0.1);"><code style="box-sizing: border-box; font-family: &quot;JetBrains Mono&quot;, ui-monospace, SFMono-Regular, &quot;SF Mono&quot;, Menlo, Monaco, Consolas, monospace; background: 0px 0px; border-radius: 6px; padding: 0px; font-size: 12px; white-space: pre;">liveness warning: eventLoopDelayMaxMs=3359.6 (one per turn, consistently) </code></pre></div><hr style="box-sizing: border-box; border-width: 0.666667px 0px 0px; border-style: solid none none; border-color: rgb(229, 229, 234) currentcolor currentcolor; border-image: initial; margin: 1em 0px; font-family: Inter, -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Roboto, sans-serif; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: -0.15px; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(248, 249, 250); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;"><p style="box-sizing: border-box; margin: 0px; color: rgb(60, 60, 67); font-family: Inter, -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Roboto, sans-serif; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: -0.15px; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(248, 249, 250); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;"><strong style="box-sizing: border-box;">Config — PDF is explicitly disabled</strong></p><details class="json-collapse" style="box-sizing: border-box; margin-top: 0.75em; color: rgb(60, 60, 67); font-family: Inter, -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Roboto, sans-serif; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: -0.15px; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(248, 249, 250); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;"><div class="code-block-wrapper" style="box-sizing: border-box; border-radius: 6px; margin-top: 0.75em; position: relative; overflow: hidden;"><div class="code-block-header" style="box-sizing: border-box; background: rgba(0, 0, 0, 0.08); justify-content: space-between; align-items: center; gap: 8px; padding: 4px 8px 4px 12px; font-size: 12px; line-height: 1; display: flex;"><button type="button" class="code-block-copy" data-code="{ &quot;tools&quot;: { &quot;deny&quot;: [&quot;pdf&quot;] } }" aria-label="Copy code" style="box-sizing: border-box; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: 11px; line-height: inherit; font-family: Inter, -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Roboto, sans-serif; font-optical-sizing: inherit; font-size-adjust: inherit; font-kerning: inherit; font-feature-settings: inherit; font-variation-settings: inherit; font-language-override: inherit; color: rgb(110, 110, 115); appearance: none; cursor: pointer; border-radius: 6px; background: 0px 0px; border-width: medium; border-style: none; border-color: currentcolor; border-image: initial; padding: 2px 6px; transition: color 0.15s, background 0.15s;"><span class="code-block-copy__idle" style="box-sizing: border-box;"></span></button></div><pre style="box-sizing: border-box; border-radius: 0px 0px 6px 6px; background: none 0% 0% / auto repeat scroll padding-box border-box rgb(236, 238, 240); padding: 10px 12px; overflow: auto; margin: 0px; border: 1px solid rgba(0, 0, 0, 0.1);"><code class="language-json" style="box-sizing: border-box; font-family: &quot;JetBrains Mono&quot;, ui-monospace, SFMono-Regular, &quot;SF Mono&quot;, Menlo, Monaco, Consolas, monospace; background: 0px 0px; border-radius: 6px; padding: 0px; font-size: 12px; white-space: pre;"></code></pre></div></details><p style="box-sizing: border-box; margin: 0px; color: rgb(60, 60, 67); font-family: Inter, -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Roboto, sans-serif; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: -0.15px; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(248, 249, 250); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">The<span> </span><code style="box-sizing: border-box; font-family: &quot;JetBrains Mono&quot;, ui-monospace, SFMono-Regular, &quot;SF Mono&quot;, Menlo, Monaco, Consolas, monospace; background: none 0% 0% / auto repeat scroll padding-box border-box rgb(236, 238, 240); border-radius: 6px; padding: 0.15em 0.35em; font-size: 0.9em; overflow-wrap: normal; word-break: keep-all; border: 1px solid rgba(0, 0, 0, 0.1);">tools.deny</code><span> </span>list correctly prevents the tool from appearing in the model schema, but does<span> </span><strong style="box-sizing: border-box;">not</strong><span> </span>prevent<span> </span><code style="box-sizing: border-box; font-family: &quot;JetBrains Mono&quot;, ui-monospace, SFMono-Regular, &quot;SF Mono&quot;, Menlo, Monaco, Consolas, monospace; background: none 0% 0% / auto repeat scroll padding-box border-box rgb(236, 238, 240); border-radius: 6px; padding: 0.15em 0.35em; font-size: 0.9em; overflow-wrap: normal; word-break: keep-all; border: 1px solid rgba(0, 0, 0, 0.1);">pdfjs-dist</code><span> </span>from loading at init time.</p><hr style="box-sizing: border-box; border-width: 0.666667px 0px 0px; border-style: solid none none; border-color: rgb(229, 229, 234) currentcolor currentcolor; border-image: initial; margin: 1em 0px; font-family: Inter, -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Roboto, sans-serif; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: -0.15px; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(248, 249, 250); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;"><p style="box-sizing: border-box; margin: 0px; color: rgb(60, 60, 67); font-family: Inter, -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Roboto, sans-serif; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: -0.15px; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(248, 249, 250); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;"><strong style="box-sizing: border-box;">Workarounds attempted (all failed)</strong></p> Attempt | Result -- | -- tools.deny: ["pdf"] | Stops tool usage, not initialisation agents.defaults.pdfModel: { primary: "__disabled__" } | Falls through to session default (anthropic/claude-sonnet-4-6), which is auth-backed + native-PDF capable — tool registers anyway tools.pdf: { enabled: false } | Schema rejected — "tools: Unrecognized key: pdf" Disabling document-extract plugin | Not configurable — built-in

PR fix notes

PR #77005: fix: lazy-load pdfjs-dist to eliminate ~2.5s per-turn blocking overhead

Description (problem / solution / changelog)

Summary

pdfjs-dist was being loaded synchronously on every agent turn (~2.5s blocking), even when the PDF tool is explicitly denied. This converts the import to lazy loading so pdfjs-dist is only loaded when the PDF tool is actually invoked.

Changes

  • Add early return in createPdfTool when pdf is in tools.deny
  • This prevents PDF tool initialization and avoids ~2.5s pdfjs-dist loading overhead on every agent turn

Testing

All existing tests pass:

  • pdf-tool.test.ts: 28 tests passed
  • document-extractor.test.ts: 2 tests passed
  • document-extractors.runtime.test.ts: 2 tests passed
  • openclaw-tools.pdf-registration.test.ts: 1 test passed

Fixes openclaw/openclaw#76997

Changed files

  • src/agents/tools/pdf-tool.ts (modified, +6/-0)

PR #77031: fix: reduce gateway tool prep stalls

Description (problem / solution / changelog)

Summary

  • avoid cloning the full secrets runtime snapshot during plugin-tool prep by using config-only runtime snapshots, while preserving explicit caller configs
  • apply the effective tool allow/deny policy before optional PDF/media tool factories are constructed
  • reduce sessions.list per-row enrichment by memoizing thinking options per provider/model and skipping unused cost fallback checks in lightweight rows

Root Cause

  • plugin tool registration still had a full secrets snapshot path on a hot prep route
  • optional media factory planning could run setup work even for tools that would later be denied
  • session list rows repeatedly resolved identical provider/model thinking metadata and did cost fallback checks even when transcript fallback was disabled

Validation

  • pnpm test src/agents/openclaw-tools.browser-plugin.integration.test.ts src/agents/openclaw-tools.media-factory-plan.test.ts src/gateway/session-utils.test.ts
  • pnpm exec oxfmt --check --threads=1 CHANGELOG.md src/agents/openclaw-plugin-tools.ts src/agents/openclaw-tools.browser-plugin.integration.test.ts src/agents/openclaw-tools.media-factory-plan.test.ts src/agents/openclaw-tools.ts src/gateway/session-utils.test.ts src/gateway/session-utils.ts
  • Testbox pnpm check:changed: https://github.com/openclaw/openclaw/actions/runs/25296696327

Fixes #76295. Fixes #76931. Fixes #76997.

Changed files

  • CHANGELOG.md (modified, +3/-0)
  • src/agents/openclaw-plugin-tools.ts (modified, +26/-7)
  • src/agents/openclaw-tools.browser-plugin.integration.test.ts (modified, +46/-34)
  • src/agents/openclaw-tools.media-factory-plan.test.ts (modified, +18/-0)
  • src/agents/openclaw-tools.ts (modified, +15/-8)
  • src/gateway/session-utils.test.ts (modified, +88/-1)
  • src/gateway/session-utils.ts (modified, +32/-5)
RAW_BUFFERClick to expand / collapse

Bug type

Regression (worked before, now fails)

Beta release blocker

No

Summary

<html> <body> <!--StartFragment--><p style="box-sizing: border-box; margin: 0.75em 0px 0px; color: rgb(60, 60, 67); font-family: Inter, -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Roboto, sans-serif; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: -0.15px; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(248, 249, 250); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">Since upgrading to 2026.5.2,<span> </span><code style="box-sizing: border-box; font-family: &quot;JetBrains Mono&quot;, ui-monospace, SFMono-Regular, &quot;SF Mono&quot;, Menlo, Monaco, Consolas, monospace; background: none 0% 0% / auto repeat scroll padding-box border-box rgb(236, 238, 240); border-radius: 6px; padding: 0.15em 0.35em; font-size: 0.9em; overflow-wrap: normal; word-break: keep-all; border: 1px solid rgba(0, 0, 0, 0.1);">pdfjs-dist</code><span> </span>is loaded synchronously on every agent turn, blocking the Node.js event loop for 2.4–2.7 seconds. This happens unconditionally — even when the PDF tool is explicitly denied and no PDF has ever been requested.</p><p style="box-sizing: border-box; margin: 0.75em 0px 0px; color: rgb(60, 60, 67); font-family: Inter, -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Roboto, sans-serif; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: -0.15px; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(248, 249, 250); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">The per-turn trace shows it clearly:</p><div class="code-block-wrapper" style="box-sizing: border-box; border-radius: 6px; margin-top: 0.75em; position: relative; overflow: hidden; color: rgb(60, 60, 67); font-family: Inter, -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Roboto, sans-serif; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: -0.15px; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(248, 249, 250); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;"><div class="code-block-header" style="box-sizing: border-box; background: rgba(0, 0, 0, 0.08); justify-content: space-between; align-items: center; gap: 8px; padding: 4px 8px 4px 12px; font-size: 12px; line-height: 1; display: flex;"><button type="button" class="code-block-copy" data-code="openclaw-tools:pdf-tool:2620ms@3031ms ← 2.6s just from pdf init openclaw-tools:plugin-tools:322ms@3354ms tool-policy:403ms@403ms Total core-plugin-tool overhead: ~3.4s per turn" aria-label="Copy code" style="box-sizing: border-box; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: 11px; line-height: inherit; font-family: Inter, -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Roboto, sans-serif; font-optical-sizing: inherit; font-size-adjust: inherit; font-kerning: inherit; font-feature-settings: inherit; font-variation-settings: inherit; font-language-override: inherit; color: rgb(110, 110, 115); appearance: none; cursor: pointer; border-radius: 6px; background: 0px 0px; border-width: medium; border-style: none; border-color: currentcolor; border-image: initial; padding: 2px 6px; transition: color 0.15s, background 0.15s;"><span class="code-block-copy__idle" style="box-sizing: border-box;">Copy</span></button></div><pre style="box-sizing: border-box; border-radius: 0px 0px 6px 6px; background: none 0% 0% / auto repeat scroll padding-box border-box rgb(236, 238, 240); padding: 10px 12px; overflow: auto; margin: 0px; border: 1px solid rgba(0, 0, 0, 0.1);"><code style="box-sizing: border-box; font-family: &quot;JetBrains Mono&quot;, ui-monospace, SFMono-Regular, &quot;SF Mono&quot;, Menlo, Monaco, Consolas, monospace; background: 0px 0px; border-radius: 6px; padding: 0px; font-size: 12px; white-space: pre;">openclaw-tools:pdf-tool:2620ms@3031ms ← 2.6s just from pdf init openclaw-tools:plugin-tools:322ms@3354ms tool-policy:403ms@403ms Total core-plugin-tool overhead: ~3.4s per turn </code></pre></div><p style="box-sizing: border-box; margin: 0px; color: rgb(60, 60, 67); font-family: Inter, -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Roboto, sans-serif; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: -0.15px; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(248, 249, 250); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">Accompanying liveness warnings confirm event loop blocking:</p><div class="code-block-wrapper" style="box-sizing: border-box; border-radius: 6px; margin-top: 0.75em; position: relative; overflow: hidden; color: rgb(60, 60, 67); font-family: Inter, -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Roboto, sans-serif; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: -0.15px; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(248, 249, 250); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;"><div class="code-block-header" style="box-sizing: border-box; background: rgba(0, 0, 0, 0.08); justify-content: space-between; align-items: center; gap: 8px; padding: 4px 8px 4px 12px; font-size: 12px; line-height: 1; display: flex;"><button type="button" class="code-block-copy" data-code="liveness warning: eventLoopDelayMaxMs=3359.6 (one per turn, consistently)" aria-label="Copy code" style="box-sizing: border-box; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: 11px; line-height: inherit; font-family: Inter, -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Roboto, sans-serif; font-optical-sizing: inherit; font-size-adjust: inherit; font-kerning: inherit; font-feature-settings: inherit; font-variation-settings: inherit; font-language-override: inherit; color: rgb(110, 110, 115); appearance: none; cursor: pointer; border-radius: 6px; background: 0px 0px; border-width: medium; border-style: none; border-color: currentcolor; border-image: initial; padding: 2px 6px; transition: color 0.15s, background 0.15s;"><span class="code-block-copy__idle" style="box-sizing: border-box;">Copy</span></button></div><pre style="box-sizing: border-box; border-radius: 0px 0px 6px 6px; background: none 0% 0% / auto repeat scroll padding-box border-box rgb(236, 238, 240); padding: 10px 12px; overflow: auto; margin: 0px; border: 1px solid rgba(0, 0, 0, 0.1);"><code style="box-sizing: border-box; font-family: &quot;JetBrains Mono&quot;, ui-monospace, SFMono-Regular, &quot;SF Mono&quot;, Menlo, Monaco, Consolas, monospace; background: 0px 0px; border-radius: 6px; padding: 0px; font-size: 12px; white-space: pre;">liveness warning: eventLoopDelayMaxMs=3359.6 (one per turn, consistently) </code></pre></div><hr style="box-sizing: border-box; border-width: 0.666667px 0px 0px; border-style: solid none none; border-color: rgb(229, 229, 234) currentcolor currentcolor; border-image: initial; margin: 1em 0px; font-family: Inter, -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Roboto, sans-serif; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: -0.15px; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(248, 249, 250); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;"><p style="box-sizing: border-box; margin: 0px; color: rgb(60, 60, 67); font-family: Inter, -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Roboto, sans-serif; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: -0.15px; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(248, 249, 250); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;"><strong style="box-sizing: border-box;">Config — PDF is explicitly disabled</strong></p><details class="json-collapse" style="box-sizing: border-box; margin-top: 0.75em; color: rgb(60, 60, 67); font-family: Inter, -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Roboto, sans-serif; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: -0.15px; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(248, 249, 250); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;"><div class="code-block-wrapper" style="box-sizing: border-box; border-radius: 6px; margin-top: 0.75em; position: relative; overflow: hidden;"><div class="code-block-header" style="box-sizing: border-box; background: rgba(0, 0, 0, 0.08); justify-content: space-between; align-items: center; gap: 8px; padding: 4px 8px 4px 12px; font-size: 12px; line-height: 1; display: flex;"><button type="button" class="code-block-copy" data-code="{ &quot;tools&quot;: { &quot;deny&quot;: [&quot;pdf&quot;] } }" aria-label="Copy code" style="box-sizing: border-box; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: 11px; line-height: inherit; font-family: Inter, -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Roboto, sans-serif; font-optical-sizing: inherit; font-size-adjust: inherit; font-kerning: inherit; font-feature-settings: inherit; font-variation-settings: inherit; font-language-override: inherit; color: rgb(110, 110, 115); appearance: none; cursor: pointer; border-radius: 6px; background: 0px 0px; border-width: medium; border-style: none; border-color: currentcolor; border-image: initial; padding: 2px 6px; transition: color 0.15s, background 0.15s;"><span class="code-block-copy__idle" style="box-sizing: border-box;"></span></button></div><pre style="box-sizing: border-box; border-radius: 0px 0px 6px 6px; background: none 0% 0% / auto repeat scroll padding-box border-box rgb(236, 238, 240); padding: 10px 12px; overflow: auto; margin: 0px; border: 1px solid rgba(0, 0, 0, 0.1);"><code class="language-json" style="box-sizing: border-box; font-family: &quot;JetBrains Mono&quot;, ui-monospace, SFMono-Regular, &quot;SF Mono&quot;, Menlo, Monaco, Consolas, monospace; background: 0px 0px; border-radius: 6px; padding: 0px; font-size: 12px; white-space: pre;"></code></pre></div></details><p style="box-sizing: border-box; margin: 0px; color: rgb(60, 60, 67); font-family: Inter, -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Roboto, sans-serif; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: -0.15px; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(248, 249, 250); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">The<span> </span><code style="box-sizing: border-box; font-family: &quot;JetBrains Mono&quot;, ui-monospace, SFMono-Regular, &quot;SF Mono&quot;, Menlo, Monaco, Consolas, monospace; background: none 0% 0% / auto repeat scroll padding-box border-box rgb(236, 238, 240); border-radius: 6px; padding: 0.15em 0.35em; font-size: 0.9em; overflow-wrap: normal; word-break: keep-all; border: 1px solid rgba(0, 0, 0, 0.1);">tools.deny</code><span> </span>list correctly prevents the tool from appearing in the model schema, but does<span> </span><strong style="box-sizing: border-box;">not</strong><span> </span>prevent<span> </span><code style="box-sizing: border-box; font-family: &quot;JetBrains Mono&quot;, ui-monospace, SFMono-Regular, &quot;SF Mono&quot;, Menlo, Monaco, Consolas, monospace; background: none 0% 0% / auto repeat scroll padding-box border-box rgb(236, 238, 240); border-radius: 6px; padding: 0.15em 0.35em; font-size: 0.9em; overflow-wrap: normal; word-break: keep-all; border: 1px solid rgba(0, 0, 0, 0.1);">pdfjs-dist</code><span> </span>from loading at init time.</p><hr style="box-sizing: border-box; border-width: 0.666667px 0px 0px; border-style: solid none none; border-color: rgb(229, 229, 234) currentcolor currentcolor; border-image: initial; margin: 1em 0px; font-family: Inter, -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Roboto, sans-serif; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: -0.15px; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(248, 249, 250); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;"><p style="box-sizing: border-box; margin: 0px; color: rgb(60, 60, 67); font-family: Inter, -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Roboto, sans-serif; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: -0.15px; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(248, 249, 250); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;"><strong style="box-sizing: border-box;">Workarounds attempted (all failed)</strong></p> Attempt | Result -- | -- tools.deny: ["pdf"] | Stops tool usage, not initialisation agents.defaults.pdfModel: { primary: "__disabled__" } | Falls through to session default (anthropic/claude-sonnet-4-6), which is auth-backed + native-PDF capable — tool registers anyway tools.pdf: { enabled: false } | Schema rejected — "tools: Unrecognized key: pdf" Disabling document-extract plugin | Not configurable — built-in

<br class="Apple-interchange-newline"><!--EndFragment-->

</body> </html>

Steps to reproduce

See above

Expected behavior

If pdf is in tools.deny, the pdf-tool should not be initialised at all. pdfjs-dist should be loaded lazily — only when the PDF tool is actually invoked. (This appears to have been the pre-2026.5.2 behaviour based on absence of this overhead in prior versions.)

Actual behavior

pdfjs-dist loads eagerly on every single agent turn, regardless of tool policy, blocking the event loop for ~2.5s and causing liveness warnings on every message.

OpenClaw version

2026.5.2 (8b2a6e5) ·

Operating system

Windows 10 x64 · Node 24.14.0

Install method

No response

Model

Sonnet 4.7

Provider / routing chain

openclaw -> Sonnet

Additional provider/model setup details

No response

Logs, screenshots, and evidence

Impact and severity

High — affects every agent turn, regardless of PDF usage

Additional information

Restore lazy loading of pdfjs-dist (load only on first PDF tool invocation) Honour tools.deny at the initialisation level, not just the schema level Consider adding tools.pdf.enabled: false as a valid config escape hatch

extent analysis

TL;DR

The issue can be mitigated by implementing lazy loading of pdfjs-dist to prevent it from loading on every agent turn, honoring the tools.deny configuration at the initialization level.

Guidance

  • Investigate the pdfjs-dist loading mechanism to identify why it's loading eagerly despite being denied in the tools.deny list.
  • Consider modifying the code to load pdfjs-dist only when the PDF tool is actually invoked, restoring the pre-2026.5.2 behavior.
  • Evaluate adding a configuration option, such as tools.pdf.enabled: false, as a valid escape hatch to prevent pdfjs-dist from loading.
  • Review the tools.deny implementation to ensure it prevents initialization of denied tools, not just their usage.

Example

No code example is provided due to the lack of specific implementation details in the issue.

Notes

The provided information suggests a regression in the pdfjs-dist loading behavior, which was previously loaded lazily. The tools.deny configuration should be honored at the initialization level to prevent unnecessary loading of denied tools.

Recommendation

Apply a workaround by implementing lazy loading of pdfjs-dist or adding a configuration option to prevent its loading, as the root cause of the issue is not immediately clear and may require further investigation.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

If pdf is in tools.deny, the pdf-tool should not be initialised at all. pdfjs-dist should be loaded lazily — only when the PDF tool is actually invoked. (This appears to have been the pre-2026.5.2 behaviour based on absence of this overhead in prior versions.)

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - ✅(Solved) Fix [Bug]: pdf-tool eagerly loads pdfjs-dist on every agent turn in 2026.5.2, causing ~2.5s blocking overhead even when PDF is denied [2 pull requests, 1 comments, 2 participants]