This repository has been archived on 2026-08-16. You can view files and clone it, but cannot push or open issues or pull requests.
ollie-core/pkg/agent
Levi Neely 75f11a7dc9 enforce 128KB tool result ceiling unconditionally
The tool result truncation had two bypasses:

1. Error results were exempt (!isErr condition) — a command returning
   output in its error message could flood the context with megabytes
   of untruncated data.

2. The streaming callback emitted chunks to the event handler (and
   thus D-Bus signals) with no size check, flooding the bus even
   when the final stored result would be truncated.

Fix:
- Remove the configurable ToolResultMaxBytes field; use the constant
  defaultToolResultMaxBytes (128KB) unconditionally for all results
  regardless of success/error status.
- Cap the streaming callback at 128KB so chunks stop being emitted
  once the ceiling is reached.
- Cap output embedded in execute server error messages to 8KB as
  defense in depth.
2026-07-27 13:02:45 +02:00
..
commands.go persist usage/cost data across session restarts 2026-07-26 19:01:19 +02:00
compaction.go fix compaction model to deepseek-v4-flash; accept error stop reason in loop 2026-05-30 10:46:12 +02:00
compaction_test.go updates 2026-06-01 08:05:38 +02:00
core.go enforce 128KB tool result ceiling unconditionally 2026-07-27 13:02:45 +02:00
core_test.go persist usage/cost data across session restarts 2026-07-26 19:01:19 +02:00
cost.go core: Anthropic prompt caching and cache-aware cost accounting 2026-04-28 12:01:14 +02:00
cost_test.go core: caching risk-reduction tests 2026-04-28 14:33:29 +02:00
fifo_test.go agent: add PromptFIFO unit tests 2026-04-11 10:03:47 +02:00
hooks.go hooks: skip non-existent CWD for remote sessions 2026-07-19 19:18:28 +02:00
loop.go enforce 128KB tool result ceiling unconditionally 2026-07-27 13:02:45 +02:00
loop_cache_test.go agent: plumb image ContentBlocks from tool results through to backend messages 2026-05-25 18:02:21 +02:00
loop_errlimit_test.go agent: plumb image ContentBlocks from tool results through to backend messages 2026-05-25 18:02:21 +02:00
loop_maxsteps_helpers_test.go agent: replace cold truncation with real LLM summarization 2026-06-01 09:45:27 +02:00
loop_maxsteps_test.go agent: plumb image ContentBlocks from tool results through to backend messages 2026-05-25 18:02:21 +02:00
loop_parallel_test.go agent: plumb image ContentBlocks from tool results through to backend messages 2026-05-25 18:02:21 +02:00
loop_texttool_test.go agent: plumb image ContentBlocks from tool results through to backend messages 2026-05-25 18:02:21 +02:00
loop_truncate_test.go enforce 128KB tool result ceiling unconditionally 2026-07-27 13:02:45 +02:00
loop_turnerror_test.go agent: plumb image ContentBlocks from tool results through to backend messages 2026-05-25 18:02:21 +02:00
prompt_resolver.go agent: layered preamble scaffolding 2026-07-21 12:53:51 +02:00
runtime.go enforce 128KB tool result ceiling unconditionally 2026-07-27 13:02:45 +02:00
session.go persist usage/cost data across session restarts 2026-07-26 19:01:19 +02:00
state.go agent: replace cold truncation with real LLM summarization 2026-06-01 09:45:27 +02:00
types.go agent: inject detached process output on exit 2026-07-17 22:07:26 +02:00
usage_log.go token efficiency: fix tier classification, expand cold tier, add usage log and compaction model override 2026-05-28 18:44:30 +02:00
waitchange_test.go agent: refactor prompt architecture and session lifecycle 2026-04-25 19:38:18 +02:00