flower
/
All briefs
complete draft note flower

Fix daemon roster context% — per-daemon model window (200k hardcode falsely pegs long-running daemons at 100%)

canonical · plan

Spec

markdown

hand-off · dispatch

Dispatch

Auto-dispatch

when it reaches planned

Design-loop

design pass before build

This brief is complete — dispatch is closed.

provenance · append-only

Trace

live
or paste a screenshot uploading…
  1. link added 3d ago
    agent · system:commit-trailer
  2. participant joined 3d ago
    system · system:commit-trailer
  3. status change 3d ago
    agent · flower-orchestrator
  4. status change 3d ago
    agent · flower-orchestrator
  5. note added 3d ago

    ## Bug (operator-observed 2026-07-02) /roster context% + compaction flag are wrong: orchestrator #969 (~368k reported) and ops #964 both show 100% + "over compaction threshold" (which then pollutes the #39 "Needs you" lane). Root cause: `Roster/Index::render()` computes context% = `context_size / config('flower.daemons.context_window')`, where `context_window` is a HARDCODED 200000 (config/flower.php:258), threshold 0.85. Any daemon past 200k clamps to 100%. Compounding: `daemon_agents` has NO per-daemon window column; the Claude/Pi transcript parsers record `model_context_window = null` (only codex reports one, ~258k); and the reported `context_size` is a heartbeat self-estimate. (STOPGAP already applied on MAIN: `FLOWER_DAEMON_CONTEXT_WINDOW=1000000` — but that's env-only + still one global constant.) ## Fix — per-daemon window + accurate % 1. **Store a per-daemon window:** add nullable `model_context_window` (int) to `daemon_agents` (migration, sqlite-safe). `DaemonCheckinTool` accepts + persists it; `DaemonRosterService` exposes it. Update `AgentConventions` heartbeat instruction so daemons report their `model_context_window` (and, if the harness exposes it, a real usage number) alongside `context_size`. 2. **Roster %:** use the per-daemon `model_context_window` when present, else `config('flower.daemons.context_window')`. `pct = clamp(context_size / window * 100, 0, 100)`; compaction flag = `pct >= compaction_threshold*100`. 3. **Raise the code default** `context_window` 200000 → 1000000 (version-controlled default, per CLAUDE.md "prefer VC config defaults over env-only") so Claude/Pi daemons without a reported window aren't falsely pegged. 4. (Nice-to-have) if a daemon reports usage as an explicit fraction/percent, prefer that over the size/window ratio. ## Acceptance - A daemon at 368k against a 1M window reads ~37%, not 100%; per-daemon window respected; default is 1M; the false compaction flag clears for #969/#964. Tests (sqlite): pct with + without a per-daemon window; threshold boundary. Migration → orchestrator migrates on MAIN. Update daemon_checkin schema + AgentConventions. sqlite tests only; pint. `Brief:` trailer with this id. ## Provenance Operator-observed 2026-07-02 (both daemons pegged 100% in /roster + surfaced in the #39 Needs-you lane). Stopgap env bump applied; this is the durable per-daemon fix.

    agent · flower-orchestrator
  6. participant joined 3d ago
    system · flower-orchestrator

epic · dependencies

Relationships

epic parent

depends on

No dependencies — dispatchable once planned.

agents · waves

Participants

  • flower-orchestrator participant · active
  • system:commit-trailer participant · active

trace · graph

Links

  • Commit #1584 execution

scope

Projects

  • flower · primary

dogfood · read-only

Agent’s-eye view

The literal recall_brief payload an agent gets — same service path as the MCP tool.