Skip to content

agents: reduce prompt token bloat from exec and context#16539

Merged
gumadeiras merged 9 commits intoopenclaw:mainfrom
CharlieGreenman:fix/reduce-agent-context-token-bloat
Feb 14, 2026
Merged

agents: reduce prompt token bloat from exec and context#16539
gumadeiras merged 9 commits intoopenclaw:mainfrom
CharlieGreenman:fix/reduce-agent-context-token-bloat

Conversation

@CharlieGreenman
Copy link
Contributor

@CharlieGreenman CharlieGreenman commented Feb 14, 2026

Email: charlie@razroo.
Intro: My name is Charlie Greenman, I have been a developer for 10 - 15 years. Have written in typescript/node for 10 years now. I understand fully code implemented here. If anyone has time to review appreciated.

I tweted about here, the tweet might be simpler to understand than this summary: https://x.com/razroo_chief/status/2022786437016436912?s=20

Summary

Describe the problem and fix in 2–5 bullets:

  • Problem: Agent prompts could bloat to very large input size from (a) repeated exec completion system events, (b) default full-history process log output, and (c) cumulative bootstrap file injection (AGENTS.md/SOUL.md/USER.md/HEARTBEAT.md, etc.).
  • Why it matters: Large prompt payloads increase cost/latency and can degrade response quality across models/providers.
  • What changed:
    • process log now defaults to a bounded tail window (last 200 lines) with paging guidance.
    • Exec completion system events are compacted; empty successful completions are suppressed by default.
    • Added opt-in flag to re-enable empty-success completion notifications: tools.exec.notifyOnExitEmptySuccess (global + per-agent override).
    • Added global bootstrap total cap across files and made it configurable via agents.defaults.bootstrapTotalMaxChars (in addition to per-file bootstrapMaxChars).
    • Reduced pending exec output default cap to lower repeated context replay.
  • What did NOT change (scope boundary): No provider-specific behavior, no auth/token changes, no new network calls, and no command authority expansion.

Change Type (select all)

  • Bug fix
  • Feature
  • Refactor
  • Docs
  • Security hardening
  • Chore/infra

Scope (select all touched areas)

  • Gateway / orchestration
  • Skills / tool execution
  • Auth / tokens
  • Memory / storage
  • Integrations
  • API / contracts
  • UI / DX
  • CI/CD / infra

Linked Issue/PR

  • Closes #
  • Related #

User-visible / Behavior Changes

  • process tool: action:"log" now defaults to last 200 lines when offset/limit are omitted; explicit pagination still works.
  • Background exec notifications: successful no-output completions are suppressed by default.
  • New config to restore prior signal behavior if desired:
    • tools.exec.notifyOnExitEmptySuccess (and agents.list[].tools.exec.notifyOnExitEmptySuccess)
  • Node exec finished events: output in system events is compacted/truncated; noisy empty-success events are suppressed.
  • Bootstrap injection now has both:
    • per-file cap: agents.defaults.bootstrapMaxChars
    • total cap across all bootstrap files: agents.defaults.bootstrapTotalMaxChars (default 24000)

Security Impact (required)

  • New permissions/capabilities? (Yes/No) No
  • Secrets/tokens handling changed? (Yes/No) No
  • New/changed network calls? (Yes/No) No
  • Command/tool execution surface changed? (Yes/No) Yes
  • Data access scope changed? (Yes/No) No
  • If any Yes, explain risk + mitigation:
    • Surface changed in output/notification behavior only (not command authorization).
    • Mitigation: failures/timeouts still notify; explicit log paging remains available; empty-success notifications can be re-enabled via config.

Repro + Verification

Environment

  • OS: macOS (darwin 24.6.0)
  • Runtime/container: local Node/pnpm workspace
  • Model/provider: model-agnostic
  • Integration/channel (if any): generic agent execution + node exec event path
  • Relevant config (redacted): defaults + optional new flags above

Steps

  1. Run a background exec that exits successfully with little/no output.
  2. Call process log without offset/limit after a high-output run.
  3. Run with multiple large bootstrap files.
  4. (Optional) set tools.exec.notifyOnExitEmptySuccess: true and repeat step 1.
  5. (Optional) set agents.defaults.bootstrapTotalMaxChars to a custom value and verify cap behavior.

Expected

  • No noisy empty-success completion events by default.
  • process log returns bounded tail + paging hint by default.
  • Bootstrap context respects total cap across files.
  • Optional flags override defaults as configured.

Actual

  • Matches expected in targeted tests and local verification.

Evidence

Attach at least one:

  • Failing test/log before + passing after
  • Trace/log snippets
  • Screenshot/recording
  • Perf numbers (if relevant)

Evidence notes:

  • Verified with:
    • pnpm vitest src/gateway/server-node-events.test.ts
    • pnpm vitest --config vitest.e2e.config.ts src/agents/bash-tools.e2e.test.ts
    • pnpm vitest --config vitest.e2e.config.ts src/agents/pi-embedded-helpers.buildbootstrapcontextfiles.e2e.test.ts
    • pnpm vitest --config vitest.e2e.config.ts src/agents/pi-embedded-helpers.resolvebootstrapmaxchars.e2e.test.ts
  • Lint clean on touched files.
  • Bootstrap worst-case injected context significantly reduced via global cap; now tunable.

Human Verification (required)

What you personally verified (not just CI), and how:

  • Verified scenarios:
    • Node exec event suppression/compaction.
    • Default bounded process log behavior and explicit paging.
    • Empty-success notification suppression by default and re-enable via config.
    • Bootstrap total cap enforcement and configurability.
  • Edge cases checked:
    • Success with empty output emits no event by default.
    • Long outputs are truncated.
    • Failures/timeouts still notify.
    • Invalid cap values fall back to defaults.
  • What you did not verify:
    • Full live end-to-end across all external channels/providers.

Compatibility / Migration

  • Backward compatible? (Yes/No) Yes
  • Config/env changes? (Yes/No) Yes (optional new config keys)
  • Migration needed? (Yes/No) No
  • If yes, exact upgrade steps: N/A

Failure Recovery (if this breaks)

  • How to disable/revert this change quickly:
    • Revert commits:
      • a98beb514 (core token-bloat reductions)
      • fdf42d6af (empty-success notification toggle)
      • 61b854036 (configurable bootstrap total cap)
  • Files/config to restore:
    • src/agents/bash-tools.process.ts
    • src/agents/bash-tools.exec-runtime.ts
    • src/gateway/server-node-events.ts
    • src/agents/pi-embedded-helpers/bootstrap.ts
    • src/config/types.tools.ts
    • src/config/types.agent-defaults.ts
    • src/config/zod-schema.agent-runtime.ts
    • src/config/zod-schema.agent-defaults.ts
  • Known bad symptoms reviewers should watch for:
    • Missing expected completion notifications for no-output success when toggle is unset.
    • Users expecting full-history logs from default process log.
    • Bootstrap context unexpectedly truncated due to low bootstrapTotalMaxChars.

Risks and Mitigations

  • Risk: Workflows depending on default full-history process log may miss older lines.
    • Mitigation: explicit offset/limit paging still supported; response includes paging hint.
  • Risk: Suppressing empty-success events may hide completion cues.
    • Mitigation: failures/timeouts still notify; configurable override notifyOnExitEmptySuccess.
  • Risk: Total bootstrap cap may omit lower-priority bootstrap content.
    • Mitigation: deterministic truncation markers and configurable bootstrapTotalMaxChars.

@openclaw-barnacle openclaw-barnacle bot added gateway Gateway runtime agents Agent runtime and tooling size: S size: M cli CLI command changes channel: signal Channel integration: signal and removed size: S labels Feb 14, 2026
@gumadeiras gumadeiras self-assigned this Feb 14, 2026
@CharlieGreenman CharlieGreenman force-pushed the fix/reduce-agent-context-token-bloat branch from 29921ce to dfbcb75 Compare February 14, 2026 23:10
@gumadeiras gumadeiras force-pushed the fix/reduce-agent-context-token-bloat branch from 5306a94 to 9bf3989 Compare February 14, 2026 23:21
@CharlieGreenman CharlieGreenman force-pushed the fix/reduce-agent-context-token-bloat branch from 2c6872d to e1aefbd Compare February 14, 2026 23:30
@gumadeiras gumadeiras force-pushed the fix/reduce-agent-context-token-bloat branch from e1aefbd to 1ca25e6 Compare February 14, 2026 23:30
@gumadeiras gumadeiras force-pushed the fix/reduce-agent-context-token-bloat branch from 1ca25e6 to 8e1635f Compare February 14, 2026 23:32
@gumadeiras gumadeiras merged commit dec6859 into openclaw:main Feb 14, 2026
9 checks passed
@gumadeiras
Copy link
Member

Merged via squash.

Thanks @CharlieGreenman!

@CharlieGreenman
Copy link
Contributor Author

Incredible!

@openclaw-barnacle openclaw-barnacle bot removed the channel: signal Channel integration: signal label Feb 14, 2026
akoscz pushed a commit to akoscz/openclaw that referenced this pull request Feb 15, 2026
Merged via /review-pr -> /prepare-pr -> /merge-pr.

Prepared head SHA: 8e1635f
Co-authored-by: CharlieGreenman <[email protected]>
Co-authored-by: gumadeiras <[email protected]>
Reviewed-by: @gumadeiras
GwonHyeok pushed a commit to learners-superpumped/openclaw that referenced this pull request Feb 15, 2026
Merged via /review-pr -> /prepare-pr -> /merge-pr.

Prepared head SHA: 8e1635f
Co-authored-by: CharlieGreenman <[email protected]>
Co-authored-by: gumadeiras <[email protected]>
Reviewed-by: @gumadeiras
vincentkoc pushed a commit to vincentkoc/openclaw that referenced this pull request Feb 15, 2026
Merged via /review-pr -> /prepare-pr -> /merge-pr.

Prepared head SHA: 8e1635f
Co-authored-by: CharlieGreenman <[email protected]>
Co-authored-by: gumadeiras <[email protected]>
Reviewed-by: @gumadeiras
snowzlm pushed a commit to snowzlm/openclaw that referenced this pull request Feb 15, 2026
Merged via /review-pr -> /prepare-pr -> /merge-pr.

Prepared head SHA: 8e1635f
Co-authored-by: CharlieGreenman <[email protected]>
Co-authored-by: gumadeiras <[email protected]>
Reviewed-by: @gumadeiras
Muggleee added a commit to Muggleee/openclaw that referenced this pull request Feb 15, 2026
…patches (#4)

* fix: validate state for manual Chutes OAuth

* test: fix Signal tool-result mocks

* test(signal): avoid unused monitor import

* refactor(test): table npm global update cases

* refactor(process): share stdin/session guards

* refactor(test): share temp home env harness

* fix(gateway): abort active runs during sessions.reset (openclaw#16576)

Merged via /review-pr -> /prepare-pr -> /merge-pr.

Prepared head SHA: 43da87f
Co-authored-by: Grynn <[email protected]>
Co-authored-by: gumadeiras <[email protected]>
Reviewed-by: @gumadeiras

* refactor(test): reuse nodes media gateway mock

* fix(security): add optional workspace-only path guards for fs tools

* docs(changelog): note exec allowlist command substitution fix

* docs(changelog): clarify exec allowlist mode only

* test(signal): ensure tool-result mocks apply before monitor import

* test(signal): load monitor after tool-result mocks

* tui: cap local shell output buffering

* fix: add safety timeout to session.compact() to prevent lane deadlock (openclaw#16533)

Merged via /review-pr -> /prepare-pr -> /merge-pr.

Prepared head SHA: 21e4045
Co-authored-by: BinHPdev <[email protected]>
Co-authored-by: gumadeiras <[email protected]>
Reviewed-by: @gumadeiras

* refactor(test): share cron isolated agent fixtures

* fix(process): satisfy tool execute typing

* fix(test): remove unused cron imports

* Memory/QMD: cap qmd command output buffering

* Memory/QMD: prefer exact docid lookup in index

* Memory/QMD: robustly parse noisy qmd JSON output

* Memory/QMD: add limit arg to search command

* Memory/QMD: optimize qmd readFile for line-window reads

* Memory/QMD: skip unchanged session export writes

* Memory/QMD: parse scope once in qmd scope checks

* docs(changelog): soften exec allowlist scope note

* docs: consolidate 2026.2.14 changelog

* perf(test): speed up session store lock suite

* perf(test): reuse memory manager batch suite

* perf(test): speed up web auto-reply last-route coverage

* chore(test): fix oxlint errors

* perf(test): speed up sessions suite

* perf(test): speed up dns cli test

* perf(test): reuse managers in embedding batches suite

* perf(test): reuse managers in embedding token limit suite

* perf(test): speed up archive suite

* perf(test): speed up session store pruning suite

* perf(test): reduce sync passes in memory batch failure test

* perf(test): speed up memory index suite

* perf(test): speed up path env suite

* fix(web): remove leaked SIGINT handler when keepAlive=false

* perf(test): consolidate web auto-reply suites

* test: fix processMessage contract test lint

* test: isolate OPENCLAW_HOME in withTempHome

* fix(sandbox): switch to root user for package installation in sandbox-common-setup

The base image (Dockerfile.sandbox) sets USER sandbox at the end, so
when sandbox-common-setup.sh builds FROM it, apt-get runs as the
unprivileged sandbox user and fails with 'Permission denied'.

Add USER root before apt-get/npm/curl install steps, and restore
USER sandbox at the end to preserve the non-root runtime default.

Fixes openclaw#16420

* fix(line): return 200 for webhook verification requests without signature

LINE Platform sends POST {"events":[]} without an X-Line-Signature
header when the user clicks 'Verify' in the LINE Developers Console.
Both webhook.ts and monitor.ts rejected this with 400 'Missing
X-Line-Signature header', causing verification to fail.

Now detect the verification pattern (no signature + empty events array)
and return 200 OK immediately, while still requiring valid signatures
for all real webhook deliveries with non-empty events.

Fixes openclaw#16425

* fix: LINE webhook verification 200; fix tsgo error (openclaw#16582) (thanks @arosstale)

* Memory/QMD: treat prefixed no-results markers as empty

* agents: reduce prompt token bloat from exec and context (openclaw#16539)

Merged via /review-pr -> /prepare-pr -> /merge-pr.

Prepared head SHA: 8e1635f
Co-authored-by: CharlieGreenman <[email protected]>
Co-authored-by: gumadeiras <[email protected]>
Reviewed-by: @gumadeiras

* docs: document bootstrap total cap and exec log/notify behavior

* fix(workspace): create BOOTSTRAP.md regardless of workspace state (openclaw#16457) (openclaw#16504)

Merged via /review-pr -> /prepare-pr -> /merge-pr.

Prepared head SHA: a57718c
Co-authored-by: robbyczgw-cla <[email protected]>
Co-authored-by: gumadeiras <[email protected]>
Reviewed-by: @gumadeiras

* Memory/QMD: make status checks side-effect free

* Memory/QMD: handle fallback init failures gracefully

* refactor(test): share overflow compaction mocks

* refactor(test): share auto-reply temp home harness

* refactor(test): share sessions_spawn e2e mocks

* fix(test): remove unused vitest imports

* refactor(test): share gateway server plugin mocks

* refactor(test): dedupe fuzzy model directive config

* refactor(test): dedupe discord handler setup

* refactor(test): share cron service fixtures

* fix(test): remove unused cron import

* fix(test): complete gateway plugin registry mock

* refactor(test): reuse base CLI program mocks

* refactor(test): dedupe pi subscribe text_end cases

* refactor(test): share slack monitor helpers

* refactor(test): share directive elevated config

* refactor(test): share telegram forum ctx helper

* refactor(test): reuse directive per-agent allowlist config

* refactor(test): reuse think directive fixtures

* refactor(test): dedupe discord status tool-result test setup

* refactor(test): dedupe gateway auth e2e lockout setup

* perf(test): reuse temp roots in session suites

* perf(test): consolidate inbound access-control suites

* perf(cron): make wakeMode now busy-wait configurable

* perf(test): speed up update-startup and docker-setup suites

* refactor(sandbox): add sandbox-common dockerfile

* ci(sandbox): add sandbox-common smoke

* refactor(line): extract node webhook handler + shared verification

* fix(nodes): raise transport timeout for exec.approval.request (openclaw#12098) (openclaw#12188)

`openclaw nodes run` always timed out after 35s with "gateway timeout
after 35000ms" even though `openclaw nodes invoke system.run` worked
instantly on the same node.

Root cause: the CLI's default --timeout of 35s was used as the WebSocket
transport timeout for exec.approval.request, but the gateway-side
handler waits up to 120s for user approval — so the transport was always
killed 85s too early.

Fix: override opts.timeout for the approval call to
Math.max(parseTimeoutMs(opts.timeout) ?? 0, approvalTimeoutMs + 10_000)
(130s by default), ensuring the transport outlasts the approval wait
while still honoring any larger user-supplied --timeout.

* feat(memory-lancedb): make auto-capture max length configurable

* Memory-lancedb: configurable capture limit (openclaw#16624) (thanks @ciberponk)

* Changelog: configurable LanceDB capture limit

* fix(test): avoid vitest mock type inference issues

* Browser: avoid single-page target lookup hang under blocked CDP attach

* fix: improve sqlite missing runtime error

* refactor: centralize exec approval timeout

* fix(workspace): persist bootstrap onboarding state

* changelog: add workspace onboarding attribution

* perf(test): reduce memory suite resets

* perf(test): streamline imessage monitor suites

* perf(test): avoid process.env cloning in update-startup suite

* perf(test): drop polling waits in qmd manager suite

* perf(test): drop recursive mkdir in qmd manager suite

* test(web): stabilize processMessage inbound contract cleanup

* test(web): stabilize processMessage inbound contract cleanup

* perf(test): remove sleeps from session store lock suite

* refactor(test): dedupe cron isolated-agent e2e setup

* refactor(test): dedupe web auto-reply last-route test

* refactor(test): dedupe cloudflare onboarding provider auth cases

* refactor(test): dedupe update-cli downgrade setup

* refactor(test): dedupe loadWorkspaceSkillEntries plugin setup

* refactor(test): dedupe pi-tools schema union checks

* refactor(test): dedupe trigger greeting prompt cases

* fix(test): align trigger harness config types

* fix(test): avoid base-to-string in nodes-media e2e logs

* refactor: share file lock via plugin-sdk

* refactor(bluebubbles): dedupe webhook normalization

* refactor(msteams): share Graph helpers

* refactor(test): dedupe gemini oauth fixture setup

* refactor(test): dedupe googlechat webhook routing setup

* fix(ci): avoid TS2742 vitest mock export types

* TUI/Gateway: emit internal hooks for /new and /reset

* TUI: honor explicit session key in global scope

* Changelog: note explicit TUI session override fix

* perf(test): stop polling cron job list

* perf(test): reuse temp root in slack prepare contract suite

* refactor(test): dedupe session reset policy setup

* perf(test): avoid per-test rm in update-startup suite

* perf(test): avoid dynamic imports in session reset suites

* perf(test): reduce mkdir churn in path env suite

* perf(test): reuse imports in models cli suite

* Sandbox: add shared bind-aware fs path resolver

* Sandbox: honor bind mounts in file tools

* perf(test): keep single media server and fast cleanup

* Changelog: note sandbox bind-mount file tool fix

* perf(test): avoid env cloning in docker-setup suite

* Media: include state workspace/sandbox in local path allowlist

* Changelog: note media local root allowlist update

* Lockfile: sync msteams specifiers

* refactor(onboarding): share promptAccountId helper

* refactor(zalo): share outbound chunker

* refactor(whatsapp): share target resolver

* refactor(slack): share message action helpers

* refactor(imessage): share target parsing helpers

* refactor(agents): dedupe claude oauth parsing

* refactor(gateway): share config restart sentinel builder

* refactor(telegram): share outbound param parsing

* refactor(bluebubbles): share send helpers

* refactor(memory): share sync indexing helper

* refactor(slack): dedupe member join/leave handlers

* perf(test): speed up qmd manager suite

* TUI: honor gateway bind mode for local connection URL

* Changelog: note TUI gateway bind URL fix

* Memory: reduce watcher FD pressure for markdown sync

* Changelog: note memory watcher FD-pressure hardening

* perf(test): remove gateway lock sleep waits

* fix(test): mock whatsapp outbound target resolver

* perf(test): avoid importing update-check in startup suite

* Protocol: regenerate Swift gateway models

* Diagnostics: bound in-memory session state tracking

* Changelog: note diagnostic session-state bounds

* fix(test): disable safeBins expectations on Windows

* fix(test): make sandbox fs-path expectations cross-platform

* fix(image): allow workspace and sandbox media paths (openclaw#15541)

* fix: media allowlist finalize (openclaw#16697) (thanks @tyler6204)

* refactor(line): share inbound context builder

* refactor(outbound): share tool payload extraction

* refactor(memory): dedupe batch embedding glue

* refactor(usage): share claude window builder

* refactor(gateway): share node session touch

* refactor(cli): share exec approvals save flow

* refactor(cli): dedupe browser start/stop

* refactor(feishu): share download buffer reader

* refactor(plugin-sdk): reuse dedupe cache

* Gateway: bound agent run sequence tracking

* Changelog: note agentRunSeq map hardening

* Auto-reply: bound abort memory map growth

* Changelog: note abort memory map hardening

* chore(release): bump versions to 2026.2.14

* Slack: bound thread starter cache growth

* Changelog: note Slack thread starter cache bounds

* Outbound: bound directory cache memory growth

* Changelog: note directory cache bounds hardening

* Skills: clean up remote node cache on disconnect

* Changelog: note remote skills cache disconnect cleanup

* fix(image): propagate workspace root for image allowlist (openclaw#16722)

Merged via /review-pr -> /prepare-pr -> /merge-pr.

Prepared head SHA: 24a1367
Co-authored-by: steipete <[email protected]>
Co-authored-by: steipete <[email protected]>
Reviewed-by: @steipete

* Memory/QMD: self-heal null-byte collection metadata on update

* Memory/QMD: add null-byte collection repair regressions

* Changelog: note QMD null-byte collection self-heal

* Subagents: retain announce queue items on send failure

* Subagents: add announce queue failure retry regressions

* Changelog: note subagent announce queue retry hardening

* chore (exec): add PTY background abort regression test

* fix: deliver tool result media when verbose is off (openclaw#16679)

Merged via /review-pr -> /prepare-pr -> /merge-pr.

Prepared head SHA: 6e16feb
Co-authored-by: christianklotz <[email protected]>
Co-authored-by: christianklotz <[email protected]>
Reviewed-by: @christianklotz

* fix(security): default apply_patch workspace containment

* fix(infra): avoid req.destroy(err) in request body limiters

* fix (memory/lancedb): harden memory recall and auto-capture

* chore (changelog): note memory-lancedb injection hardening

* fix (memory/lancedb): require explicit opt-in for auto-capture

* chore (changelog): note memory-lancedb auto-capture opt-in

* fix(config): stop defaulting slack/discord dm.policy

* fix(security): harden Windows child process spawning

* fix (tui): preserve active stream during concurrent run finals

* chore (changelog): note TUI concurrent stream hardening

* refactor(media): harden localRoots bypass (openclaw#16739)

Merged via /review-pr -> /prepare-pr -> /merge-pr.

Prepared head SHA: 89dce69
Co-authored-by: steipete <[email protected]>
Co-authored-by: steipete <[email protected]>
Reviewed-by: @steipete

* fix(agents): block workspaceOnly apply_patch delete symlink escape

* fix (tui): sanitize binary-heavy history text before render

* chore (tui): replace control-char regex with codepoint sanitizer

* chore (changelog): note TUI binary history render hardening

* fix(security): apply tools.fs.workspaceOnly to sandbox file tools

* chore (tests): format apply-patch e2e test

* fix(discord): harden voice message media loading

* fix (tui): preserve streamed text across tool boundary deltas

* chore (tui): add stream assembler regression for tool boundary drops

* chore (changelog): note TUI tool-boundary stream fix

* fix(memory): prevent QMD scope deny bypass

* fix (tui): harden render sanitization for narrow terminals

* chore (tui): add sanitizer regressions for narrow width safety

* chore (changelog): note narrow-terminal TUI sanitizer hardening

* fix(allowlist): canonicalize Slack/Discord allowFrom

* fix (memory/builtin): keep status dirty state stable across invocations

* chore (memory): add status dirty rebound regression test

* chore (changelog): note stable memory status dirty reporting

* docs: update Slack/Discord allowFrom references

* test: stabilize sessions_spawn e2e mocks

* ci: reduce docker e2e log brittleness

* fix: support file: npm specs in plugin install

* fix: accept auth code in chutes oauth manual flow

* test (agents): cover empty-chunk timeout failover behavior

* fix (agents): classify empty-chunk stream failures as timeout

* chore (changelog): document empty-chunk timeout handling

* docs(changelog): reorder 2026.2.14 notes

* fix (telegram): return webhook timeout responses to prevent retry storms

* test (telegram): assert webhook callback timeout-safe options

* chore (changelog): note telegram webhook timeout retry-storm fix

* test: quiet docker onboard e2e noise

* fix (signal): preserve case for group target normalization

* test (signal): cover mixed-case group target ids

* chore (changelog): note signal group-id normalization fix

* fix (memory/qmd): avoid multi-collection query ranking corruption

* test (memory/qmd): cover per-collection query fallback behavior

* chore (changelog): note qmd multi-collection query fix

* fix (discord): ignore empty guild channel maps in allowlist resolution

* test (discord): cover empty guild channels config fallback

* chore (changelog): note discord empty channels allowlist fix

* docs(changelog): mark 2026.2.14 released

* fix (cron): skip startup replay for interrupted running jobs

* test (cron): cover interrupted startup job replay guard

* chore (changelog): note cron interrupted-start replay fix

* fix (tui): keep assistant text contrast theme-adaptive

* test (tui): cover assistant default-foreground theme behavior

* chore (changelog): note tui light-theme contrast fix

* fix (agents): accept read file_path alias in tool-start path checks

* test (agents): cover read file_path alias in tool-start diagnostics

* chore (changelog): note read tool file_path alias warning fix

---------

Co-authored-by: Peter Steinberger <[email protected]>
Co-authored-by: Vishal Doshi <[email protected]>
Co-authored-by: Grynn <[email protected]>
Co-authored-by: gumadeiras <[email protected]>
Co-authored-by: Vignesh Natarajan <[email protected]>
Co-authored-by: Bin Deng <[email protected]>
Co-authored-by: BinHPdev <[email protected]>
Co-authored-by: artale <[email protected]>
Co-authored-by: Charlie Greenman <[email protected]>
Co-authored-by: CharlieGreenman <[email protected]>
Co-authored-by: Gustavo Madeira Santana <[email protected]>
Co-authored-by: Robby <[email protected]>
Co-authored-by: robbyczgw-cla <[email protected]>
Co-authored-by: Marcus Castro <[email protected]>
Co-authored-by: fan <fan@FANCOOL-P16V>
Co-authored-by: Tyler Yust <[email protected]>
Co-authored-by: Peter Steinberger <[email protected]>
Co-authored-by: steipete <[email protected]>
Co-authored-by: Christian Klotz <[email protected]>
Co-authored-by: christianklotz <[email protected]>
Co-authored-by: zackleeli <[email protected]>
Benkei-dev pushed a commit to Benkei-dev/openclaw that referenced this pull request Feb 15, 2026
Merged via /review-pr -> /prepare-pr -> /merge-pr.

Prepared head SHA: 8e1635f
Co-authored-by: CharlieGreenman <[email protected]>
Co-authored-by: gumadeiras <[email protected]>
Reviewed-by: @gumadeiras
@Raynos
Copy link

Raynos commented Feb 15, 2026

This change wildly changed the behavior of my agent because previously there was no bootstrapTotalMaxChars and only 20,000 limit applied per file and I could slurp all kinds of custom markdown files and really push the limits.

Now I have 24,000 limit of which 20,000 is my agents.md and all the other files have 4,000 left which basically means USER.md IDENTITY.md etc is never loaded, the SOUL.md is heavily truncated.

The fact I have large context files is a different problem I need to fix...

@Raynos
Copy link

Raynos commented Feb 15, 2026

I bumped mine from 24,000 to 160,000 ( it uses 133,000 ) and that fixed my issue.

@CharlieGreenman
Copy link
Contributor Author

CharlieGreenman commented Feb 15, 2026

I bumped mine from 24,000 to 160,000 ( it uses 133,000 ) and that fixed my issue.

Good glad to hear it! I think this constraint makes sense. Good to push back on large context size. Think about it, you are spending an extra 5x to 6x on tokens. Now you know you have an issue there. Moving forward all new people that use OpenClaw will be kept within this constraint :) It's good stuff

@CharlieGreenman
Copy link
Contributor Author

@Raynos I am working on a better self healing mechanism now

@Raynos
Copy link

Raynos commented Feb 16, 2026

@CharlieGreenman that's great because it definitely did a random order somehow where it truncated to 20,000 of agents.md as it's first then truncated soul.md by 70% (ahhhhh) and then the next thing was like 700 tokens remaining for TOOLS.md

And then every other file in the list basically got shafted. so it need to round robin the tokens around.

Also this 24,000 token thing is so dominating the behavior of everything that it should show up as a CRITICAL in openclaw doctor in my opinion.

@gumadeiras
Copy link
Member

This change wildly changed the behavior of my agent because previously there was no bootstrapTotalMaxChars and only 20,000 limit applied per file and I could slurp all kinds of custom markdown files and really push the limits.

that was an oversight on my part. It is unlimited by default now, and adding a truncation threshold is opt-in

@Raynos
Copy link

Raynos commented Feb 16, 2026

Unlimited by default may be too much, I'd say 300,000 or something as "ok this is a really bad idea" is something worth looking into. I'm really trying to get mine under 100,000 but I don't have the capacity to trim as everything I added was added for a reason... I need to fix this but also not delete 20 bug fixes.

@Raynos
Copy link

Raynos commented Feb 16, 2026

@gumadeiras also note that the 20,000 per file truncation has been here >2 weeks, it's the total bootstrap truncation that's a regression. In your PR you removed both by default.

@gumadeiras
Copy link
Member

gumadeiras commented Feb 16, 2026

@gumadeiras also note that the 20,000 per file truncation has been here >2 weeks, it's the total bootstrap truncation that's a regression. In your PR you removed both by default.

yes! 20k will stay per core file and use a permissive default of 150k for total context. Also adding more warnings around and bringing that information into /context so users can see the limits explicitly

see #18229

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling cli CLI command changes gateway Gateway runtime size: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments