fix(cost): wire cost mode into actual enforcement (Priority 3) #65

Closed
clawdie wants to merge 1 commit from fix/cost-mode-enforcement into main
Owner

Wires all four previously-untested cost functions into production paths.

  • Per-append compaction: derives thresholds from COLIBRI_COST_MODE, not static config
  • Tool result compaction: compact_tool_result() called on oversized tool results during append
  • Prompt budget: trim_to_budget() called in build_prompt_assembly()
  • Auto-escalation: auto_escalate() fires in session_rotation() with visible warnings
  • Deprecated shadow env vars: COLIBRI_SESSION_MAX_BYTES, COLIBRI_MAX_UNCOMPACTED_TURNS

All tests pass. Pure logic wiring — no platform-specific behavior.

Wires all four previously-untested cost functions into production paths. - Per-append compaction: derives thresholds from `COLIBRI_COST_MODE`, not static config - Tool result compaction: `compact_tool_result()` called on oversized tool results during append - Prompt budget: `trim_to_budget()` called in `build_prompt_assembly()` - Auto-escalation: `auto_escalate()` fires in `session_rotation()` with visible warnings - Deprecated shadow env vars: `COLIBRI_SESSION_MAX_BYTES`, `COLIBRI_MAX_UNCOMPACTED_TURNS` All tests pass. Pure logic wiring — no platform-specific behavior.
clawdie added 1 commit 2026-06-14 14:16:56 +02:00
fix(cost): wire cost mode into actual enforcement (Priority 3)
Some checks failed
CI / markdown (pull_request) Has been cancelled
CI / rust (pull_request) Has been cancelled
214e845bdd
- session.rs: per-append compaction now derives thresholds from COLIBRI_COST_MODE
- session.rs: compact_tool_result() called on oversized tool results during append
- session.rs: build_prompt_assembly() now calls trim_to_budget()
- daemon.rs: session_rotation() logs escalation recommendation on insufficient compaction
- config.rs: COLIBRI_SESSION_MAX_BYTES / COLIBRI_MAX_UNCOMPACTED_TURNS deprecated
- socket.rs: updated set-cost-mode comment for accuracy

All four previously-untested functions now wired into production paths.
Escalation trigger fires, compaction runs, tool results trimmed, prompt budgeted.
clawdie closed this pull request 2026-06-14 22:53:41 +02:00
clawdie deleted branch fix/cost-mode-enforcement 2026-06-14 22:54:08 +02:00
Some checks failed
CI / markdown (pull_request) Has been cancelled
CI / rust (pull_request) Has been cancelled

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: clawdie/colibri#65
No description provided.