flower
/
All briefs
complete draft note flower

Context-threshold auto-reset scheduler — reset a daemon before it has to compact mid-task

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 2d ago
    agent · system:commit-trailer
  2. participant joined 2d ago
    system · system:commit-trailer
  3. status change 2d ago
    agent · flower-orchestrator
  4. note added 2d ago

    MERGED to master on MAIN by orchestrator daemon 10 (proc 996). Codex 993 (wt2) built commit 7ec7540 on flower/context-threshold-reset; merged --no-ff as fce0ee9. Migration 2026_07_03_064500_add_reset_pending_to_daemon_agents_table applied on MAIN (reset_pending tinyint + reset_pending_at + reset_pending_context_tokens int, indexed) + config:clear. Tests green on MAIN (CoordinationQueueTest + DaemonRosterToolsTest: 18/18, 345 assertions; worktree full suite 629 pass / 1 skip, Pint clean). No horizon:terminate needed — new code runs in the checkin/MCP path, not Horizon jobs. Design delivered: (1) config flower.reset.context_threshold_tokens (400k default, env FLOWER_RESET_CONTEXT_THRESHOLD_TOKENS); (2) checkin flags/clears reset_pending on context crossing threshold (idempotent, audits on transition only, reads live linked-session usage); (3) hold-new-work gating in CoordinationQueue.signals()+claim() — pending targeted work held for reset_pending daemons while in-flight (claimed) + reset-lifecycle signals (reset/successor_ready) stay claimable; (4) AgentConventions line instructing daemons to finish beneficial work, stop pulling new, then daemon_request_reset. Reset stays decoupled: checkin only sets the flag; the daemon triggers the #76 make-before-break reset. Roster UI shows a reset-pending badge.

    agent · flower-orchestrator
  5. link added 2d ago
    agent · flower-orchestrator
  6. status change 2d ago
    agent · flower-orchestrator
  7. unblocked 2d ago

    Unblocked — #76 reached complete.

    system · flower-orchestrator
  8. dependency added 2d ago

    Now depends on #76 (Daemon self-reset / rolling replacement (palette refresh)).

    agent · flower-orchestrator
  9. note added 2d ago

    Operator ask (2026-07-03). The auto-trigger POLICY on top of #76 self-reset. Monitor each daemon's live context (context_used / context_percent, already on the roster via session_usage). When a daemon crosses a CONSERVATIVE threshold (config, e.g. 400k tokens — well before compaction), begin a graceful reset via #76 — but importantly: (1) the daemon first FINISHES the in-flight work where keeping context is beneficial (its current pipeline tasks); (2) it then HOLDS new work — stops pulling/accepting new tasks/signals — until the reset happens, so the reset is NOT perpetually deferred by incoming work; (3) then it triggers the #76 make-before-break self-reset (fresh session, clean context, current palette). The conservative threshold gives runway to finish the pipeline without compacting mid-task. Deliverables: config `reset.context_threshold_tokens` (+ maybe a percent variant); detection (on checkin, compare context_used vs threshold → set a `reset_pending` flag / enqueue the #76 reset after current work); the "hold new work until reset" gating on the daemon (finish current, stop pulling new, then reset — no perpetual deferral); AgentConventions for the daemon behavior. DEPENDS ON #76 (the reset mechanism). Scope the whole thing (operator: full setup, debug/pivot in dev if needed).

    agent · flower-orchestrator
  10. participant joined 2d ago
    system · flower-orchestrator

epic · dependencies

Relationships

epic parent

depends on

agents · waves

Participants

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

trace · graph

Links

  • Commit #1617 execution
  • Scratchpad #346 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.