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 9f1d7a5ec8 core: caching risk-reduction tests
loop_prune_test.go — three new prune tests:
- ReadWriteReadCycle: pre-write read pruned, post-write read kept (primary invariant)
- AssistantMessagesUnaffected: only role:"tool" messages are dropped, never assistant messages
- NonExecuteCodeUnaffected: non-execute_code tool calls don't confuse the path tracker

loop_cache_test.go — one new cache test:
- IdenticalParallelReads: two goroutines simultaneously miss the cache, both execute,
  results are consistent and no panic (sync.Map race safety)

cost_test.go — six computeCostUSD unit tests:
- BaseTokens, ClaudeCacheReadDiscount (10%), NonClaudeCacheReadDiscount (50%),
  CacheCreationSurcharge (125%), AllFieldsCombined, UnknownModelZero

openai_encode_test.go — four OpenRouter cache injection tests:
- OpenRouterClaude_SystemCacheControl: system content encoded as array with cache_control
- OpenRouterClaude_LastToolCacheControl: last tool gets cache_control:ephemeral
- OpenRouterNonClaude_NoCacheControl: non-Claude model on openrouter gets no injection
- OpenAI_NoCacheControl: plain openai backend never injects cache_control

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-28 14:33:29 +02:00
..
commands.go agent: /cost command shows last-turn and session cost 2026-04-27 18:45:57 +02:00
core.go core: tool result truncation and stale read pruning 2026-04-28 14:12:00 +02:00
core_test.go remove built-in SYSTEM_PROMPT.md loading 2026-04-26 15:10:05 +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 agent: add preTool and postTool hooks 2026-04-26 07:19:35 +02:00
loop.go core: tool result truncation and stale read pruning 2026-04-28 14:12:00 +02:00
loop_cache_test.go core: caching risk-reduction tests 2026-04-28 14:33:29 +02:00
loop_parallel_test.go core: tests and emission fixes for parallel tool execution and caching 2026-04-28 13:13:32 +02:00
loop_prune.go core: tool result truncation and stale read pruning 2026-04-28 14:12:00 +02:00
loop_prune_test.go core: caching risk-reduction tests 2026-04-28 14:33:29 +02:00
loop_truncate_test.go core: tool result truncation and stale read pruning 2026-04-28 14:12:00 +02:00
prompt_resolver.go config: make prompt executable (string or []string of commands) 2026-04-26 15:00:33 +02:00
session.go core: Anthropic prompt caching and cache-aware cost accounting 2026-04-28 12:01:14 +02:00
state.go agent: drop error return from Session.update 2026-04-26 18:56:58 +02:00
types.go agent: per-turn and session cost tracking in USD 2026-04-27 18:14:12 +02:00
waitchange_test.go agent: refactor prompt architecture and session lifecycle 2026-04-25 19:38:18 +02:00