-
Notifications
You must be signed in to change notification settings - Fork 2
bug(core): JIT tool reference injection broken after overflow migration to SQLite #1818
Description
Problem
JIT tool reference injection (PR #1771, #1740) is silently broken after the overflow storage migration to SQLite (PR #1782).
Root cause
OVERFLOW_NOTICE_PREFIX in crates/zeph-core/src/agent/tool_execution/mod.rs:18:
pub(crate) const OVERFLOW_NOTICE_PREFIX: &str = "[full output saved to ";PR #1782 changed the actual overflow notice format from:
[full output saved to {path} — {bytes} bytes, use read tool to access]
to:
[full output stored as overflow:{uuid} — {bytes} bytes, use read_overflow tool]
extract_overflow_ref() in summarization.rs:21-26 uses OVERFLOW_NOTICE_PREFIX to detect overflow notices in tool output bodies. Since no tool output will ever contain [full output saved to after PR #1782, the function always returns None.
As a result, the pruning logic in summarization.rs:332 never substitutes [tool output pruned; full content at {path}] — the JIT reference is never injected.
Fix sketch
Update OVERFLOW_NOTICE_PREFIX to match the new SQLite format:
pub(crate) const OVERFLOW_NOTICE_PREFIX: &str = "[full output stored as overflow:";And update extract_overflow_ref() to extract the UUID instead of a file path, then format the JIT reference using the UUID (so the agent can call read_overflow {uuid} instead of read {path}).
Severity
Medium — feature is silently broken (no error, no regression visible in short sessions), but the JIT context preservation pattern never activates for any pruned tool output.