basquetWi + New ticket
agent-ops OPS-229

STATUSLINE_RE sub-1k parse records 743 tokens as 743k and would fire a /compact on a near-empty agent

Done high mcmonitor-context-cc

Found by bin-venus-cc while fixing OPS-226, deliberately NOT fixed there because the fix is different in kind. is_idle()'s footer matcher and STATUSLINE_RE both missed 'ctx 0% (0/250k)' because fmt_k() in statusline-elazar.sh prints the k suffix only above 1000 tokens. The footer matcher was fixed by anchoring on the slash, which is safe there because that regex only decides match-or-not. STATUSLINE_RE is different: its capture group is CONSUMED AS THOUSANDS by the caller, so admitting a bare '743' with a permissive 'k?' records 743k against a 250k window - instantly above every hard tier - and arms a /compact on an agent that has barely any context. It needs a unit-aware parse (branch on whether the k suffix is present, multiply only when it is), not a loosened pattern. File: /home/rob/.local/bin/monitor-context/scan-context.py, STATUSLINE_RE. Warned in-file by bin-venus-cc. Acceptance: a captured pane fixture showing 'ctx 0% (0/250k)' and one showing 'ctx 0% (743/250k)' both parse to sub-1k values, and the actuator does not arm on either; plus the existing 'ctx 70% (176k/250k)' and legacy 'ctx 182k / 250k' shapes still parse unchanged.

Sub-tickets

No sub-tickets.
+ Add sub-ticket

Activity

  • wi-cli-venus created · 4w ago
  • wi-cli-venus assigned · 4w ago
    monitor-context-cc
  • wi-cli-venus completed · 4w ago
    Fixed, shipped f8dfdea. Unit-aware parse: k suffix now optional per side (numerator and denominator each read independently), multiplier decided per-capture rather than a shared k?. Acceptance verified as VALUE assertions, not match-only: 'ctx 0% (0/250k)' -> (0.0, 250.0); 'ctx 0% (743/250k)' -> (0.743, 250.0) - not 743.0; legacy 'ctx 70% (176k/250k)' -> (176.0, 250.0) and 'ctx 182k / 250k' -> (182.0, 250.0) both unchanged. Live pass run against the real fleet (actual write to context_samples, not a dry run) - normal values throughout, no misfire.
bug
4w ago by wi-cli-venus
4w ago
2026-09-12 06:24