A compaction reads as a failure: say it is coming, show it happening, and let the context ring drop after it #185

Closed
opened 2026-10-17 10:47:45 -04:00 by cmoriarty · 2 comments
Owner

Seen on 2026-10-17 in the #172 comparison's single-step run (run_01M55284MNP9F2CE8NK5D3D96A, context per agent 90,000, alarm 67,500). openspec.apply[all] compacted in place three times, each working: 69k → 9k, 72k → 10k, 73k → 10k. What the console showed did not say so.

What is wrong

  1. The transcript reads like an error. At each alarm it draws budget alarm: stp_01M552936MKDZRZYCPJ1MHEGV6, a rule, and then interrupted (the turn cut at the alarm). The step id means nothing to the operator, "interrupted" sounds like a failure, and nothing says a compaction is under way or what came of it until the "context compacted" line appears.
  2. No warning before it happens. Other coding agents say a compaction is coming. The spine row's context ring turns colour but says nothing.
  3. The ring never drops after a compaction. It held at 82% (73k / 90k) before and after all three. Cause: the digest's reading is max() of the primary session's turns since the last respawn (src/osf/engine/digest.py, _SESSION_PEAK_SQL). A handoff moves that start to the new session; a compaction in place keeps the same session, so the pre-compaction turn stays in the max.

What it should do

  • Before: when the live reading nears the alarm, the ring says so beside it: "compaction soon" (or "handoff soon" for a step that hands off).
  • During: the alarm line names what is happening in words, with no step id: "Context at 69k of 90k: compacting…", with an animated indicator on that line and on the ring until it settles. The turn cut at the alarm reads as paused for the compaction, not interrupted.
  • After: one line that resolves it: "Compacted: 69k → 9k (14 tasks left)", and the ring shows the session's context after the compaction (the reading counts from the last compaction, as it already does from the last respawn).
  • The same words in osfd transcript and notifications (osf/format.py parity).

Done when

  • The three seen above are tested (unit, vitest, and a Playwright spec on a fixture step that compacts), and the ring drops after a compaction in a sim.
  • Checked on production in a real run that compacts.
Seen on 2026-10-17 in the #172 comparison's single-step run (run_01M55284MNP9F2CE8NK5D3D96A, context per agent 90,000, alarm 67,500). `openspec.apply[all]` compacted in place three times, each working: 69k → 9k, 72k → 10k, 73k → 10k. What the console showed did not say so. ## What is wrong 1. **The transcript reads like an error.** At each alarm it draws `budget alarm: stp_01M552936MKDZRZYCPJ1MHEGV6`, a rule, and then `interrupted` (the turn cut at the alarm). The step id means nothing to the operator, "interrupted" sounds like a failure, and nothing says a compaction is under way or what came of it until the "context compacted" line appears. 2. **No warning before it happens.** Other coding agents say a compaction is coming. The spine row's context ring turns colour but says nothing. 3. **The ring never drops after a compaction.** It held at 82% (73k / 90k) before and after all three. Cause: the digest's reading is `max()` of the primary session's turns since the last *respawn* (`src/osf/engine/digest.py`, `_SESSION_PEAK_SQL`). A handoff moves that start to the new session; a compaction in place keeps the same session, so the pre-compaction turn stays in the max. ## What it should do - **Before:** when the live reading nears the alarm, the ring says so beside it: "compaction soon" (or "handoff soon" for a step that hands off). - **During:** the alarm line names what is happening in words, with no step id: "Context at 69k of 90k: compacting…", with an animated indicator on that line and on the ring until it settles. The turn cut at the alarm reads as paused for the compaction, not interrupted. - **After:** one line that resolves it: "Compacted: 69k → 9k (14 tasks left)", and the ring shows the session's context after the compaction (the reading counts from the last compaction, as it already does from the last respawn). - The same words in `osfd transcript` and notifications (`osf/format.py` parity). ## Done when - The three seen above are tested (unit, vitest, and a Playwright spec on a fixture step that compacts), and the ring drops after a compaction in a sim. - Checked on production in a real run that compacts.
Author
Owner

Also in scope, seen in the same run: the spine's activity line reads "Starting · 6m 23s" (code review) and "Starting · 50m 14s" (the apply step) while the transcript shows the agent thinking. The line derives from durable events only, and a long reasoning stretch persists nothing until it ends, so after an alarm it stays on "Starting". It should say "Thinking" while reasoning streams (stream B's reasoning deltas), and "compacting" during a compaction.

Also in scope, seen in the same run: the spine's activity line reads **"Starting · 6m 23s"** (code review) and **"Starting · 50m 14s"** (the apply step) while the transcript shows the agent thinking. The line derives from durable events only, and a long reasoning stretch persists nothing until it ends, so after an alarm it stays on "Starting". It should say "Thinking" while reasoning streams (stream B's reasoning deltas), and "compacting" during a compaction.
Author
Owner

Shipped in 443263a (merge a2a4fd8), live since 19:00Z on 2026-10-17. It was adapted to #186 in 86dc37f (20:11Z), and the activity-line fixes went out in fdd6c70 (23:28Z). Archived in OpenSpec as compaction-reads-as-progress in 874eb27.

What shipped

  1. Before: as the live reading nears the alarm, the ring says "compaction soon". Every alarm records what the engine will do about it.
  2. During: the transcript reads "Context at 68k of 90k: compacting…" with no step id, and the cut turn reads "paused for the compaction". Until the compaction is recorded, the ring turns and the activity line reads "Compacting ·
  3. After: the transcript reads "Compacted: 69k → 9k (14 tasks left)". The ring counts from the last compaction, so it drops.
  4. After a step's first turn, the activity line reads Thinking or Resuming, not Starting. While the continuation's turn begins, it reads "Resuming after the compaction".
  5. A fixture run that compacts on cue, with its own browser spec, and a simulated run that checks the ring's drop.

Commits: c149a13, ca68b1c, 16598f7, 93c7ac1, d17bd6b, 6724257, and after review fdb5e65, 6b79b1c, d3117d2. The activity line: 11fe6c5, 54e295f, 4a5d36a.

Checked on production, on run 74 (86dc37f, one step at 90,000), at 20:22Z:

  • "compaction soon" at 66k of 90k, with the ring at 73.
  • Then "Compacting · 1s" to "21s", with the ring turning.
  • The transcript read "Context at 68k of 90k: compacting…" and then "paused for the compaction".
  • Afterwards the ring dropped from 75 to 11 (9.6k).

Not seen on production yet: the same run showed "Starting · 12m 52s" for about 90 s after a compaction. The fix (11fe6c5, with the follow-ups 54e295f and 4a5d36a) went out in fdd6c70, but nobody has watched a compaction on production since. Half of the change's workflow note, watching a step through a handoff, no longer applies: #186 removed the handoff.

Closing. Please reopen if a compaction on fdd6c70 still reads "Starting".

Shipped in 443263a (merge a2a4fd8), live since 19:00Z on 2026-10-17. It was adapted to #186 in 86dc37f (20:11Z), and the activity-line fixes went out in fdd6c70 (23:28Z). Archived in OpenSpec as `compaction-reads-as-progress` in 874eb27. **What shipped** 1. **Before:** as the live reading nears the alarm, the ring says "compaction soon". Every alarm records what the engine will do about it. 2. **During:** the transcript reads "Context at 68k of 90k: compacting…" with no step id, and the cut turn reads "paused for the compaction". Until the compaction is recorded, the ring turns and the activity line reads "Compacting · <time>". 3. **After:** the transcript reads "Compacted: 69k → 9k (14 tasks left)". The ring counts from the last compaction, so it drops. 4. After a step's first turn, the activity line reads Thinking or Resuming, not Starting. While the continuation's turn begins, it reads "Resuming after the compaction". 5. A fixture run that compacts on cue, with its own browser spec, and a simulated run that checks the ring's drop. Commits: c149a13, ca68b1c, 16598f7, 93c7ac1, d17bd6b, 6724257, and after review fdb5e65, 6b79b1c, d3117d2. The activity line: 11fe6c5, 54e295f, 4a5d36a. **Checked on production**, on run 74 (86dc37f, one step at 90,000), at 20:22Z: - "compaction soon" at 66k of 90k, with the ring at 73. - Then "Compacting · 1s" to "21s", with the ring turning. - The transcript read "Context at 68k of 90k: compacting…" and then "paused for the compaction". - Afterwards the ring dropped from 75 to 11 (9.6k). **Not seen on production yet:** the same run showed "Starting · 12m 52s" for about 90 s after a compaction. The fix (11fe6c5, with the follow-ups 54e295f and 4a5d36a) went out in fdd6c70, but nobody has watched a compaction on production since. Half of the change's workflow note, watching a step through a handoff, no longer applies: #186 removed the handoff. Closing. Please reopen if a compaction on fdd6c70 still reads "Starting".
Sign in to join this conversation.
No labels
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
cmoriarty/braid#185
No description provided.