Description
The SSE buffer caps added in #4727 are hardcoded constants and cannot be tuned per-deployment without a code change.
| Buffer |
File |
Constant |
Current cap |
| Tool-call JSON |
crates/zeph-llm/src/sse.rs:324 |
MAX_TOOL_JSON_BUF |
4 MiB |
| Thinking |
crates/zeph-llm/src/sse.rs:339 |
MAX_THINKING_BUF |
1 MiB |
| Compaction |
crates/zeph-llm/src/sse.rs:171 |
MAX_COMPACTION_BUF |
32 KiB |
Expected Behavior
Deployments handling large tool payloads (e.g., code generation tools that emit large JSON) or extended thinking sessions should be able to raise the caps via config without rebuilding.
Suggested config path: [llm.stream_limits] with max_tool_json_bytes, max_thinking_bytes, max_compaction_bytes; default values unchanged from current constants.
Actual Behavior
Caps are compile-time constants; exceed → warn + discard, no recovery possible.
Environment
- Version: HEAD 6585ebf
- Features: full
Logs / Evidence
Detected during CI-952 arch audit.
Description
The SSE buffer caps added in #4727 are hardcoded constants and cannot be tuned per-deployment without a code change.
crates/zeph-llm/src/sse.rs:324MAX_TOOL_JSON_BUFcrates/zeph-llm/src/sse.rs:339MAX_THINKING_BUFcrates/zeph-llm/src/sse.rs:171MAX_COMPACTION_BUFExpected Behavior
Deployments handling large tool payloads (e.g., code generation tools that emit large JSON) or extended thinking sessions should be able to raise the caps via config without rebuilding.
Suggested config path:
[llm.stream_limits]withmax_tool_json_bytes,max_thinking_bytes,max_compaction_bytes; default values unchanged from current constants.Actual Behavior
Caps are compile-time constants; exceed → warn + discard, no recovery possible.
Environment
Logs / Evidence
Detected during CI-952 arch audit.