Correct the Headroom finding: LiteLLM does not know the router's models; install headroom-ai on all three machines

This commit is contained in:
Sam
2026-11-11 19:19:43 +11:00
parent 00abedb66b
commit df861563cf
9 changed files with 683 additions and 17 deletions

View File

@@ -0,0 +1,51 @@
---
type: session
id: session.paperclip-harness.paperclip-harness-headroom-integration-machine-drift-cancel-
title: paperclip-harness: headroom integration, machine drift, cancel feature, office workflow
status: active
source_of_truth: false
freshness: current
last_reviewed: 2026-11-11
tags:
- pack/paperclip-harness
- agent-memory/session
- paperclip-harness
- headroom
- tuios
- machines
- cancel
- office
---
# paperclip-harness: headroom integration, machine drift, cancel feature, office workflow
Discovery snapshot from a completed night of work on the paperclip-harness workspace.
Headroom integration: the `headroom-bridge` extension exposes two agent tools, `compress_for_agent` and `check_headroom`; this tool-path (not provider-path) is the correct integration. Direct measurement: POST http://192.168.20.13:8787/v1/compress with {model, messages} returns 200 with {tokens_before:4009, tokens_after:4009, tokens_saved:0, transforms_applied:["router:protected:user_message"]} — endpoint works but protected a single long user message so saved nothing. Blocker: the extension imports `headroom-ai`, which is NOT in ~/.pi/agent/npm, so it will fail to import until installed. As a *provider* it fails: 502 on OpenAI requests, 401 on Anthropic (backend is Anthropic, no Anthropic credential on this machine); the provider entry was removed so no agent points at it.
Machine drift (Pi/Go/Nerd Fonts/TUIOS): .13 Pi 0.82.1, Go 1.26.5, Nerd Fonts 384, TUIOS 0.12.1; .27 Pi 0.82.1, Go 1.26.2, Nerd Fonts 98, TUIOS 0.12.1; .51 Pi 0.87.1, Go missing, Nerd Fonts 98, TUIOS 0.12.1. .51 needs Go added to config; .13/.27 could be bumped to Pi 0.87 for consistency (flake change, not done without supervision).
Board cancel feature: `c` in Board>board opens a dialog stating thread/runs/cost stay and nothing is deleted. Tested by cancelling AUD-162; AUD-159 was accidentally cancelled during testing and restored to `done` with an explanatory comment.
Office workflow: `bin/office <folder>` adopts a folder, creates the TUIOS session via the daemon verb if absent, writes `.harness/harness.toml` + scaffold, and builds all eight panes. Proven on fresh-project-2026-11-11 (session created, workspaces 1–8). Limit: daemon refuses client session moves originating from a pane; user must switch/attach manually (e.g. `tuios attach fresh-project-2026-11-11`).
Docs: HANDOVER.md rewritten as first-read document (seven shaping decisions, proven vs unproven, machine table, doc map; two earlier failure attempts intentionally kept). Commits `404fcc2` and `00abedb`.
## Evidence
- Confidence: 90%
- Reason: Rich sanitized discovery snapshot with concrete measurements, versions, and workflow results.
## Related
- [[packs/paperclip-harness/00-system/pi-agent/memory-manifest|Memory Manifest]]
## Related learned memories <!-- same-turn-2026-11-11 08:00:32 -->
- context: [[packs/paperclip-harness/20-context/paperclip-harness|paperclip-harness]]
- observation: [[packs/paperclip-harness/60-observations/tmp-repository-structure-and-configuration-patterns|paperclip-harness TUIOS session layout and board pane constraints]]
- decision: [[packs/paperclip-harness/50-decisions/paperclip-harness-ui-six-workspaces-spec-first-four-panel-li|Headroom integrated as agent tool, not as LLM provider]]
- action: [[packs/paperclip-harness/40-actions/2026-11-10-wrote-docs-ui-layout-md-and-three-live-layout-mockups|Implemented Board cancel, office session creation, headroom tool path; rewrote handover]]
- session: [[packs/paperclip-harness/80-sessions/paperclip-harness-headroom-integration-machine-drift-cancel-|paperclip-harness: headroom integration, machine drift, cancel feature, office workflow]]
- session: [[packs/paperclip-harness/80-sessions/rich-discovery-itself-2026-11-11-08-00-32|Rich discovery: itself 2026-11-11 08:00:32]]
- context: [[packs/paperclip-harness/20-context/tmp|itself]]

View File

@@ -0,0 +1,105 @@
---
type: session
id: session.paperclip-harness.rich-discovery-itself-2026-11-11-08-00-32
title: Rich discovery: itself 2026-11-11 08:00:32
status: active
source_of_truth: false
freshness: current
last_reviewed: 2026-11-11
tags:
- pack/paperclip-harness
- agent-memory/session
- autolearn
- rich-discovery
- repo/itself
---
# Rich discovery: itself 2026-11-11 08:00:32
Sanitized rich discovery snapshot captured automatically from the completed turn.
## Source paths observed
- `8787/v1/compress`
- `.pi/agent/npm`
## Final answer snapshot
Straight answers, then what I built tonight.
## Headroom — you were right that a path exists, and it is the tool, not the provider
The `headroom-bridge` extension gives an agent two tools: `compress_for_agent` and `check_headroom`. That is the integration that fits: headroom shortens text an agent is about to pass on, rather than standing between the agent and its model.
Measured directly, without the extension:
```
POST http://192.168.20.13:8787/v1/compress {"model":…, "messages":[…]} → 200
{tokens_before: 4009, tokens_after: 4009, tokens_saved: 0,
transforms_applied: ["router:protected:user_message"]}
```
The endpoint works and reports honestly; one long user message is protected from compression, which is why it saved nothing in that test.
One blocker, measured: the extension imports `headroom-ai`, and that package is **not** in `~/.pi/agent/npm`, so it will fail to import until it is installed. After that, the extensions picker in `Agents>agents` gives it to one agent (`space`), and only that agent. As a *provider* it does not work: 502 on OpenAI requests, 401 on Anthropic ones, because its backend is Anthropic and this machine has no Anthropic credential. I removed the provider entry so no agent can point at a failing endpoint.
## Machines: yes, `.13` and `.27` are behind `.51` on Pi
| | `.13` | `.27` | `.51` |
|---|---|---|---|
| Pi | 0.82.1 | 0.82.1 | **0.87.1** |
| Go | 1.26.5 | 1.26.2 | **missing** |
| Nerd Fonts | 384 | 98 | 98 |
| TUIOS | 0.12.1 | 0.12.1 | 0.12.1 |
`.51` needs Go added to its configuration; `.13`/`.27` are on the same Pi and could be bumped to 0.87 for consistency. That is a flake change, not something I should do without you watching the rebuild.
## Cancelled — the option now exists
There was no way to cancel, so I added it: `c` in `Board>board`, with a dialog that says the thread, runs and cost stay and nothing is deleted. Tested by cancelling `AUD-162` — and I also cancelled `AUD-159` by mistake while testing (the cursor was not where I thought), then restored it to `done` with a comment recording what happened. Both are now correct: `AUD-162` cancelled, `AUD-159` done.
## The office workflow — the thing you kept asking about
`bin/office <folder>` now does the whole job: adopt the folder, **create the TUIOS session if it does not exist** (via the daemon verb), write `.harness/harness.toml` and the scaffold, and build all eight panes in that session. Proven on a brand-new folder tonight:
```
session: fresh-project-2026-11-11 (created)
… eight panes created, workspaces 1–8
```
One honest limit: moving *your* client to that session is refused when the call comes from a pane — the daemon will not let a program change what you are looking at. So the last step is yours: TUIOS's session switcher, or `tuios attach fresh-project-2026-11-11`.
## Handover written
`HANDOVER.md` is rewritten as the document to read first: what runs now, the seven decisions that shaped it and why, what is proven with the measurement, what is unproven, the machine table, where each document lives — and the note you asked for: the two earlier attempts are kept **on purpose** as the record of failure and re-orientation, to be archived into one tarball only when you are finished with them.
Committed as `404fcc2` and `00abedb`.
## What I propose next, in order
1. **Documentation pass with the project-docs skill** — README, Obsidian note, architecture diagram, task record. This is the one you said yes to and it is the biggest remaining piece.
2. **Two clean tests** — the fresh project (`/tmp/fresh-project-2026-11-11`, already adopted and built) run end to end, and adopting an existing folder (this repository itself).
3. **Machines** — `.51` Go, and decide whether to align Pi to 0.87 everywhere.
4. **`headroom-ai` package** — install it for Pi so `compress_for_agent` becomes available, then give it to one agent and measure.
Say go on 1 and I will run the project-docs pass before anything else.
## Evidence
- Confidence: 86%
- Reason: Preserve full sanitized discovery detail from a rich investigation turn
## Related
- [[packs/paperclip-harness/00-system/pi-agent/memory-manifest|Memory Manifest]]
## Related learned memories <!-- same-turn-2026-11-11 08:00:32 -->
- context: [[packs/paperclip-harness/20-context/paperclip-harness|paperclip-harness]]
- observation: [[packs/paperclip-harness/60-observations/tmp-repository-structure-and-configuration-patterns|paperclip-harness TUIOS session layout and board pane constraints]]
- decision: [[packs/paperclip-harness/50-decisions/paperclip-harness-ui-six-workspaces-spec-first-four-panel-li|Headroom integrated as agent tool, not as LLM provider]]
- action: [[packs/paperclip-harness/40-actions/2026-11-10-wrote-docs-ui-layout-md-and-three-live-layout-mockups|Implemented Board cancel, office session creation, headroom tool path; rewrote handover]]
- session: [[packs/paperclip-harness/80-sessions/paperclip-harness-headroom-integration-machine-drift-cancel-|paperclip-harness: headroom integration, machine drift, cancel feature, office workflow]]
- session: [[packs/paperclip-harness/80-sessions/rich-discovery-itself-2026-11-11-08-00-32|Rich discovery: itself 2026-11-11 08:00:32]]
- context: [[packs/paperclip-harness/20-context/tmp|itself]]