picoclaw/pkg/agent
Badgerbees 1a44752dc5 fix(agent): prevent double-counting system message tokens in estimator
Treat SystemParts as an alternative representation of message Content
rather than an additive one. This prevents systematic overestimation
of system message tokens which could trigger premature context
pruning or summarization.
- Picks the maximum of Content vs. SystemParts to stay conservative.
- Adds a per-part overhead (20 chars) to account for JSON metadata.
- Streamlines the ReasoningContent counting logic.
Fixes a deficiency where structured blocks for cache-aware adapters
caused overestimated budgets or hidden overflows.
2026-03-31 17:09:01 +07:00
..
context.go add pid file for gateway running and auth token for /reload and pico channel 2026-03-29 01:14:39 +08:00
context_budget.go fix(agent): prevent double-counting system message tokens in estimator 2026-03-31 17:09:01 +07:00
context_budget_test.go fix(agent): include SystemParts in token estimation and add reasoning guards 2026-03-31 16:33:24 +07:00
context_cache_test.go merge: resolve conflicts between refactor/agent and main 2026-03-22 19:21:58 +08:00
context_test.go fix(provider): deduplicate tool results and merge consecutive tool_result blocks for Anthropic API (#1793) 2026-03-23 17:24:46 +08:00
definition.go merge: resolve conflicts between refactor/agent and main 2026-03-22 19:21:58 +08:00
definition_test.go merge: resolve conflicts between refactor/agent and main 2026-03-22 19:21:58 +08:00
eventbus.go merge: resolve conflicts between refactor/agent and main 2026-03-22 19:21:58 +08:00
eventbus_test.go Merge branch 'main' into version 2026-03-23 10:54:08 +08:00
events.go merge: resolve conflicts between refactor/agent and main 2026-03-22 19:21:58 +08:00
hook_mount.go merge: resolve conflicts between refactor/agent and main 2026-03-22 19:21:58 +08:00
hook_mount_test.go Merge branch 'main' into version 2026-03-23 10:54:08 +08:00
hook_process.go merge: resolve conflicts between refactor/agent and main 2026-03-22 19:21:58 +08:00
hook_process_test.go merge: resolve conflicts between refactor/agent and main 2026-03-22 19:21:58 +08:00
hooks.go merge: resolve conflicts between refactor/agent and main 2026-03-22 19:21:58 +08:00
hooks_test.go Merge branch 'main' into version 2026-03-23 10:54:08 +08:00
instance.go fix(agent): use light provider for routed model calls (#2038) 2026-03-28 15:25:23 +08:00
instance_test.go feat(tools): add exec tool enhancement with background execution and PTY support (#1752) 2026-03-25 21:02:49 +08:00
loop.go feat(tools): add reaction tool and reply-aware message sends (#2156) 2026-03-30 16:31:34 +08:00
loop_mcp.go feat(mcp): per server deferred mode (#1654) 2026-03-19 17:03:17 +08:00
loop_mcp_test.go feat(mcp): per server deferred mode (#1654) 2026-03-19 17:03:17 +08:00
loop_media.go resolve conflicts 2026-03-22 23:36:25 +01:00
loop_test.go feat(channels): make Channel.Send return delivered message IDs (#2190) 2026-03-31 11:07:32 +08:00
memory.go refactor(modernize): apply safe modernize fixes 2026-02-27 16:35:07 +08:00
mock_provider_test.go feat(fmt): Fix formatting 2026-02-19 22:05:15 +02:00
model_resolution.go fix(agent): rebind provider after /switch model to (#1769) 2026-03-19 21:44:01 +08:00
registry.go feat(session): integrate JSONL persistence into agent loop (#1170) 2026-03-10 15:14:09 +08:00
registry_test.go refactor Config to add Version and migratable 2026-03-12 13:52:55 +08:00
steering.go fix(agent): fix subturn panic result, hard abort rollback, and drain bus exit 2026-03-22 20:35:14 +08:00
steering_test.go Merge branch 'main' into version 2026-03-23 10:54:08 +08:00
subturn.go fix(agent): fix subturn panic result, hard abort rollback, and drain bus exit 2026-03-22 20:35:14 +08:00
subturn_test.go Merge branch 'main' into version 2026-03-23 10:54:08 +08:00
thinking.go feat: add extended thinking support for Anthropic models (#1076) 2026-03-05 09:51:18 +08:00
thinking_test.go feat: add extended thinking support for Anthropic models (#1076) 2026-03-05 09:51:18 +08:00
turn.go merge: resolve conflicts between refactor/agent and main 2026-03-22 19:21:58 +08:00