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/tools
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
..
execute enforce 128KB tool result ceiling unconditionally 2026-07-27 13:02:45 +02:00
stream.go streaming: emit partial tool output via context callback 2026-07-19 21:06:13 +02:00
tools.go tools: discover prompts from ollie:prompt script headers 2026-07-21 13:18:38 +02:00
tools_test.go pkg/tools: add contract tests, remove Close from Server/Dispatcher 2026-04-21 13:38:02 +02:00