Commit Graph

52 Commits

Author SHA1 Message Date
Peter Steinberger
ce21ef641a fix: replay compaction and skills api drift 2026-03-28 00:37:31 +00:00
Peter Steinberger
1f24181495 fix(ci): replay compaction and skills api drift 2026-03-28 00:32:53 +00:00
Peter Steinberger
0d12f1ab91 fix: replay compaction and skills api drift 2026-03-28 00:29:23 +00:00
Peter Steinberger
4c213a5de7 fix(ci): replay compaction and skills api drift 2026-03-28 00:24:28 +00:00
Peter Steinberger
542d62ba93 fix: replay compaction and skills api drift 2026-03-28 00:17:50 +00:00
Peter Steinberger
96a4df49b9 fix(ci): align compaction and skills api drift 2026-03-28 00:12:14 +00:00
Peter Steinberger
2d8351b3b4 fix: align anthropic and skills helpers with shared sdk 2026-03-28 00:08:52 +00:00
Peter Steinberger
de7bba14cc fix(ci): align compaction and skills api drift 2026-03-28 00:04:24 +00:00
Peter Steinberger
4b5aa6fd0b fix: refresh skill fixtures for pi-coding-agent 2026-03-27 23:58:41 +00:00
Peter Steinberger
41eb7c5056 fix(ci): align compaction and skills api drift 2026-03-27 23:52:27 +00:00
Peter Steinberger
8d95351217 fix: update skill and compaction test fixtures 2026-03-27 23:47:04 +00:00
Peter Steinberger
a27624437e fix(ci): align skills api drift and tui keybindings 2026-03-27 23:18:31 +00:00
Gustavo Madeira Santana
1fc4d7259f Agents/TUI: align with current pi APIs 2026-03-27 19:05:04 -04:00
Peter Steinberger
a5cb9ec674 fix(ci): align skills api and trim status startup 2026-03-27 22:24:54 +00:00
Peter Steinberger
a50455452d test: debrand plumbing labels and restore skill compat 2026-03-27 21:50:39 +00:00
Peter Steinberger
f09b449ab1 fix(ci): align skills source info and compaction args 2026-03-27 21:47:03 +00:00
Peter Steinberger
8ae90e16fc refactor: debrand core fixtures and align skill types 2026-03-27 21:43:03 +00:00
Peter Steinberger
c73c050276 fix(ci): align compaction and skills tests with upstream agent API 2026-03-27 20:48:48 +00:00
Peter Steinberger
cb5aefb790 fix: sync plugin sdk guardrails and test drift 2026-03-27 20:47:36 +00:00
Peter Steinberger
fa05c351a1 fix(ci): align compaction and skills tests with upstream agent API 2026-03-27 20:41:10 +00:00
Peter Steinberger
41901c19bf fix: restore green check after upstream API changes 2026-03-27 20:29:18 +00:00
Jacob Tomlinson
c774db9a1f fix(compaction): pass summary headers before abort signal 2026-03-27 18:35:31 +00:00
Peter Steinberger
52ef2ef790 fix(agents): align compaction and skill metadata APIs 2026-03-27 18:15:40 +00:00
Tak Hoffman
398af90a22 fix(ci): makin it green 2026-03-27 08:26:49 -05:00
Peter Steinberger
7dd196ed74 fix: apply live model switches during active retries 2026-03-27 12:01:55 +00:00
Peter Steinberger
a8066ad96d fix: align skills and compaction api drift 2026-03-27 06:18:41 +00:00
Tak Hoffman
55ab98dc40 fix(agents): adapt compaction and skill source types 2026-03-27 01:02:22 -05:00
Ayaan Zaidi
39fae14c72 fix(agents): adapt compaction request auth 2026-03-27 10:59:07 +05:30
Peter Steinberger
ee12f24760 fix: restore ci compatibility 2026-03-27 05:23:50 +00:00
Marcus Castro
2942df6b9f fix: align compaction call sites with upstream API drift 2026-03-27 01:49:58 -03:00
Ayaan Zaidi
b1d853d88b fix(agents): adapt compaction request auth 2026-03-27 09:56:35 +05:30
Peter Steinberger
70184d0a5e fix: compaction API drift + Skill sourceInfo→source migration
- compaction.ts: drop removed 'headers' param from generateSummary call
- compaction.retry.test.ts: align test call with new generateSummary signature
- compaction-safeguard.ts: replace getApiKeyAndHeaders with getApiKey (upstream removed)
- Migrate all Skill sourceInfo.source → flat source field across agents, cli, security
- Update 6 test files to match new Skill shape
2026-03-27 04:23:39 +00:00
Peter Steinberger
be6b841334 fix: align skill and compaction API usage 2026-03-27 03:27:51 +00:00
Peter Steinberger
b15d9eb565 fix(agents): restore compaction headers typing 2026-03-27 03:19:59 +00:00
Peter Steinberger
158c4c1f4f fix(repo): restore gate after upstream drift 2026-03-27 02:58:14 +00:00
Peter Steinberger
a331270f8a fix: restore green build after upstream API drift 2026-03-27 02:49:53 +00:00
Peter Steinberger
10527ff8a3 build: refresh deps and vitest cache lanes 2026-03-27 02:26:07 +00:00
JT
de9031da22 fix: improve compaction summary instructions to preserve active work (#8903)
fix: improve compaction summary instructions to preserve active work

Expand staged-summary merge instructions to preserve active task status, batch progress, latest user request, and follow-up commitments so compaction handoffs retain in-flight work context.

Co-authored-by: joetomasone <56984887+joetomasone@users.noreply.github.com>
Co-authored-by: Josh Lehman <josh@martian.engineering>
2026-03-02 22:36:19 -08:00
Rodrigo Uroz
0fe6cf06b2 Compaction: preserve opaque identifiers in summaries (openclaw#25553) thanks @rodrigouroz
Verified:
- pnpm install --frozen-lockfile
- pnpm build
- pnpm check
- pnpm test:macmini

Co-authored-by: rodrigouroz <384037+rodrigouroz@users.noreply.github.com>
Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
2026-02-27 08:14:05 -06:00
Tak Hoffman
05691be511 Compaction: ignore tool result details in oversized checks (#24057)
* Compaction: ignore tool result details in oversized checks

* Tests/Compaction: type estimateTokens message callback
2026-02-22 20:13:59 -06:00
Tak Hoffman
50c5f75904 Compaction: sanitize token split accounting (#24058)
* Compaction: sanitize token split accounting

* Tests/Compaction: type sanitize token estimate callback
2026-02-22 20:13:21 -06:00
Harry Cui Kepler
ffa63173e0 refactor(agents): migrate console.warn/error/info to subsystem logger (#22906)
Merged via /review-pr -> /prepare-pr -> /merge-pr.

Prepared head SHA: a806c4cb27
Co-authored-by: Kepler2024 <166882517+Kepler2024@users.noreply.github.com>
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com>
Reviewed-by: @gumadeiras
2026-02-21 17:11:47 -05:00
Val Alexander
b703ea3675 fix: prevent compaction "prompt too long" errors (#22921)
* includes: prompt overhead in compaction safeguard calculation.

Subtracts SUMMARIZATION_OVERHEAD_TOKENS from maxChunkTokens in both the main summarization path and the dropped-messages summarization path.

This ensures the chunk budget leaves room for the prompt overhead that generateSummary wraps around each chunk.

* adds: budget for overhead tokens to use an effectiveMax instead of maxTokens naïvely.

- Added `SUMMARIZATION_OVERHEAD_TOKENS = 4096` — a budget for the tokens that `generateSummary` adds on top of the serialized conversation (system prompt, `<conversation>` tags, summarization instructions, `<previous-summary>` block, and reasoning: "high" thinking budget).
- `chunkMessagesByMaxTokens` now divides `maxTokens` by `SAFETY_MARGIN` (1.2) before comparing against estimated token counts. Previously, the safety margin was only used in `computeAdaptiveChunkRatio` and `isOversizedForSummary` but not in the actual chunking loop — so chunks could be built that fit the estimated budget but exceeded the real budget once the API tokenized them properly.
2026-02-21 14:42:18 -06:00
amabito
068b9c9749 feat: wrap compaction generateSummary in retryAsync
Integrate retry logic with abort-classifier for /compact endpoint:
- Wrap generateSummary calls in retryAsync with exponential backoff
- Auto-skip retry on user cancellation and gateway restart (AbortError)
- Config: 3 attempts, 500ms-5s delay, 20% jitter
- Add comprehensive Vitest tests (5/5 passed)

Related: #16809, #5744, #17143
2026-02-17 00:01:03 +01:00
Peter Steinberger
a4bf619522 refactor(agents): share toolResult details stripping 2026-02-15 06:21:13 +00:00
Peter Steinberger
da55d70fb0 fix(security): harden untrusted web tool transcripts 2026-02-13 00:46:56 +01:00
Christian Klotz
f32eeae3bc fix: remove orphaned tool_results during compaction pruning
When pruneHistoryForContextShare drops chunks of messages, it could drop
an assistant message with tool_use blocks while leaving corresponding
tool_result messages in the kept portion. These orphaned tool_results
cause Anthropic's API to reject the session with 'unexpected tool_use_id'.

Fix by calling repairToolUseResultPairing after each chunk drop to clean
up any orphaned tool_results. This reuses existing battle-tested code
from session-transcript-repair.ts.

Fixes #9769, #9724, #9672
2026-02-05 20:37:53 +00:00
cpojer
f06dd8df06 chore: Enable "experimentalSortImports" in Oxfmt and reformat all imorts. 2026-02-01 10:03:47 +09:00
cpojer
5ceff756e1 chore: Enable "curly" rule to avoid single-statement if confusion/errors. 2026-01-31 16:19:20 +09:00
jigar
dde9605874 Agents: summarize dropped messages during compaction safeguard pruning (#2418) 2026-01-26 20:35:08 -06:00