feat(daemon): headroom compression sidecar (hardened) #57

Merged
clawdie merged 2 commits from fix/headroom-sidecar-quality into main 2026-06-14 01:35:56 +02:00
Owner

Opt-in headroom-ai compression sidecar for tool results.

  • long-lived Unix-socket connection, newline-delimited JSON, multi-request (matches Rust client)
  • 5s daemon-side timeout → degrades to uncompressed (None)
  • hardened python sidecar: 1 MiB guard, 0660 socket, graceful shutdown, robust errors
  • opt-in via COLIBRI_HEADROOM_ENABLED / COLIBRI_HEADROOM_SOCKET (default off)
  • 2 new Rust tests (reuse-one-connection, timeout-fallback); docs/HEADROOM-SIDECAR.md

Reviewed: tests pass, fmt clean, py compiles, merges clean. The earlier full-clippy failure was the unrelated spawner.rs too_many_arguments lint, fixed separately in #56 (this branch does not touch spawner.rs).

Opt-in headroom-ai compression sidecar for tool results. - long-lived Unix-socket connection, newline-delimited JSON, multi-request (matches Rust client) - 5s daemon-side timeout → degrades to uncompressed (`None`) - hardened python sidecar: 1 MiB guard, 0660 socket, graceful shutdown, robust errors - opt-in via `COLIBRI_HEADROOM_ENABLED` / `COLIBRI_HEADROOM_SOCKET` (default off) - 2 new Rust tests (reuse-one-connection, timeout-fallback); docs/HEADROOM-SIDECAR.md Reviewed: tests pass, fmt clean, py compiles, merges clean. The earlier full-clippy failure was the unrelated spawner.rs too_many_arguments lint, fixed separately in #56 (this branch does not touch spawner.rs).
clawdie added 2 commits 2026-06-14 01:35:50 +02:00
feat(daemon): headroom-ai compression sidecar for tool results
Some checks failed
CI / rust (pull_request) Has been cancelled
CI / markdown (pull_request) Has been cancelled
edc1a5cdbf
- scripts/headroom-sidecar.py: Unix socket server (from headroom import compress)
- cost.rs: HeadroomSidecar struct with connect/compress methods
- session.rs: build_prompt_messages() now accepts optional sidecar
- daemon.rs: spawns sidecar on startup if COLIBRI_HEADROOM_ENABLED=true
- config.rs: headroom_enabled + headroom_socket_path config fields
- socket.rs: cmd_status reports headroom status, cmd_get_session uses sidecar
- All test fixtures updated with new DaemonConfig fields

40-50% token savings on tool outputs with zero accuracy loss.
Disabled by default (COLIBRI_HEADROOM_ENABLED=false).
Works identically on Linux and FreeBSD.
fix(headroom): harden sidecar protocol and timeout (Sam & Codex)
Some checks failed
CI / rust (pull_request) Has been cancelled
CI / markdown (pull_request) Has been cancelled
34929a6a53
Keep the Python sidecar connection open for multiple newline-delimited requests, add daemon-side request timeout/fallback tests, and document the opt-in Headroom sidecar contract.\n\nChecks: ./scripts/check-format.sh; cargo fmt --check; python3 -m py_compile scripts/headroom-sidecar.py; git diff --check; cargo test -p colibri-daemon cost -- --nocapture; cargo test -p colibri-daemon session:: -- --nocapture; cargo test -p colibri-daemon --all-targets; cargo check -p colibri-daemon; manual sidecar two-request smoke using a headroom-capable Python env.
clawdie merged commit 83abd586c3 into main 2026-06-14 01:35:56 +02:00
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#57
No description provided.