Commit Graph

25 Commits

Author SHA1 Message Date
Peter Steinberger
2a1e47ffcb fix(agents): restore raw model run type coverage 2026-04-28 09:20:58 +01:00
Peter Steinberger
fb3ea9efb1 fix: keep gateway model probes raw 2026-04-28 09:11:47 +01:00
Peter Steinberger
11e6928b3e fix: keep runtime context out of user turns 2026-04-27 21:24:56 +01:00
Peter Steinberger
5b616e2bec fix(agents): narrow session lock scope 2026-04-27 09:09:19 +01:00
Peter Steinberger
e97bd70264 perf: speed up slow test imports 2026-04-26 13:10:57 +01:00
Peter Steinberger
58a31b12f7 fix(agents): keep runtime wakeups out of chat transcript 2026-04-26 06:23:27 +01:00
Peter Steinberger
e918e5f75c fix: hide runtime context from submitted prompts 2026-04-26 00:57:04 +01:00
Peter Steinberger
4a7ddd7ff5 test(agents): slim embedded runner hotspot coverage 2026-04-25 03:15:23 +01:00
Peter Steinberger
41f9768cd8 fix: preserve context engine safeguard compaction 2026-04-25 02:30:41 +01:00
EVA
c138368040 feat: add Codex harness extension seams
Co-authored-by: Eva <100yenadmin@users.noreply.github.com>
2026-04-24 09:32:27 +01:00
Peter Steinberger
97e528ed54 test: use synthetic agent session fixtures 2026-04-21 01:24:34 +01:00
Gustavo Madeira Santana
74c198f2e8 Tests: slim context engine runtime coverage 2026-04-17 02:23:49 -04:00
Peter Steinberger
35dcd06764 test: trim agent test hotspots 2026-04-17 07:15:27 +01:00
Josh Lehman
a327b6750d fix: stabilize context engine prompt cache touches (#67767)
* fix: stabilize context engine prompt cache touches

* fix(changelog): document context-engine prompt cache touch stabilization
2026-04-16 11:53:42 -07:00
Josh Lehman
75e7fc97f8 fix: preserve runtime token budget in deferred context-engine maintenance (#66820)
* fix(context-engine): pass deferred maintenance token budget

Thread tokenBudget through the after-turn runtime context so background context-engine maintenance reuses the real model context window instead of falling back to 128k. Also pass through a best-effort currentTokenCount from the latest call total and make the runtime context type explicit about both fields.

Regeneration-Prompt: |
  OpenClaw already passed the real context token budget into direct context-engine calls like afterTurn and assemble, but deferred maintain() reused only the runtimeContext object and that object did not carry tokenBudget. Lossless Claw therefore fell back to 128k during background maintenance, which made budget-trigger fire much more aggressively than the live model context warranted. Thread the real contextTokenBudget into buildAfterTurnRuntimeContext so deferred maintenance receives the same budget, and pass a straightforward best-effort currentTokenCount from the latest call total while the relevant data is already in scope. Keep the change additive, update the runtime-context type, and cover the background maintenance/runtime-context behavior with focused tests.

* fix(context-engine): use prompt usage for deferred maintenance
2026-04-14 15:30:37 -07:00
Peter Steinberger
ce28073970 test: move context-engine cache coverage to helpers 2026-04-09 04:58:36 +01:00
Josh Lehman
e46e32b98c feat: expose prompt-cache runtime context to context engines (#62179)
* Context engine: plumb prompt cache runtime context

Add a typed prompt-cache payload to the context-engine runtime context and populate it from the embedded runner's resolved retention, last-call usage, cache-break observation, and cache-touch metadata. Also pass the same payload through the retry compaction runtime context when a run attempt already has it.

Regeneration-Prompt: |
  Expose OpenClaw prompt-cache telemetry to context engines in a narrow,
  additive way without changing compaction policy. Keep the public change on
  the OpenClaw side only: add a typed promptCache payload to the context-engine
  runtime context, thread it into afterTurn, and also into compact where the
  existing run loop already has the data cheaply available.

  Use OpenClaw's resolved cache retention, not raw config. Use last-call usage
  for the new payload, not accumulated retry or tool-loop totals. Reuse the
  existing prompt-cache observability result and tracked change causes instead
  of inventing a new heuristic. If cache-touch metadata is already available
  from the cache-TTL bookkeeping, include it; do not invent expiry timestamps
  for providers where OpenClaw cannot know them confidently.

  Keep the interface backward-compatible for engines that ignore the new field.
  Add focused tests around the existing attempt/context-engine helpers and the
  compaction runtime-context propagation path rather than broad new integration
  coverage.

* Agents: fix prompt-cache afterTurn usage

Regeneration-Prompt: |
  Fix PR #62179 so context-engine prompt-cache metadata uses only the current attempt's usage. The review comment pointed out that early exits could reuse a prior turn's assistant usage when no new assistant message was produced. Restrict the prompt-cache lastCallUsage lookup to assistant messages added after prePromptMessageCount, and fall back to current-attempt usage totals instead of stale snapshot history. Also repair the PR's new context-engine test typings and add a regression test for the stale prior-turn case. Two import-only fixes in doctor-state-integrity and config/talk were already broken on origin/main, but they blocked build/check and the gateway-watch regression harness, so include the minimum unblocking imports as well.

* Agents: document prompt-cache context

* Agents: address prompt-cache review feedback

* Doctor: drop unused isRecord import
2026-04-07 09:29:57 -07:00
Vincent Koc
294ee477ac fix(memory-wiki): stabilize compiled digest prompts 2026-04-07 08:56:41 +01:00
Vincent Koc
2988203a5e feat(context-engine): add memory prompt helper 2026-04-07 08:56:41 +01:00
Peter Steinberger
d83dd9b536 test: split embedded runner cleanup seams 2026-04-05 22:20:02 +01:00
samzong
61fef8c689 [Fix] Isolate teardown steps so session lock release is unconditional (#59194)
Merged via squash.

Prepared head SHA: 52b3bb46bb
Co-authored-by: samzong <13782141+samzong@users.noreply.github.com>
Co-authored-by: frankekn <4488090+frankekn@users.noreply.github.com>
Reviewed-by: @frankekn
2026-04-03 17:07:24 +08:00
Vincent Koc
af694def5b fix(agents): fail closed on silent turns (#52593)
* fix(agents): fail closed on silent turns

* fix(agents): suppress all silent turn emissions

* fix(agents): pass silent turns into embedded subscribe
2026-03-29 17:40:20 +09:00
Peter Steinberger
781295c14b refactor: dedupe test and script helpers 2026-03-24 15:48:35 +00:00
Peter Steinberger
41850c3880 refactor: isolate attempt context engine thread helpers 2026-03-23 05:27:44 -07:00
Peter Steinberger
4e661d5c4b test: split attempt spawn-workspace thread fixtures 2026-03-23 05:21:59 -07:00