Skip to content

fix(status): dedupe unchanged keyed pause re-declarations - #2511

Open
quinnbot-ai wants to merge 1 commit into
kunchenguid:mainfrom
quinnbot-ai:fm/upstream-status-pause-dedupe
Open

fix(status): dedupe unchanged keyed pause re-declarations#2511
quinnbot-ai wants to merge 1 commit into
kunchenguid:mainfrom
quinnbot-ai:fm/upstream-status-pause-dedupe

Conversation

@quinnbot-ai

Copy link
Copy Markdown

Problem

A worker that re-declares an unchanged paused: status (same key, same reason) appends a new line to state/<id>.status on every declaration. Each append registers as a fresh wake event, so a long-running declared pause produces a stream of wakes that all carry zero new information - a wake storm the supervisor has to absorb one by one.

Change

Dedupe at the producer side: fm-status-report.sh skips the append when the incoming keyed paused: line is byte-identical in key and reason to the task's most recent still-active pause declaration. A pause with a changed reason, a changed key, or any intervening non-pause event still appends normally, so no state transition is ever hidden - only literal repeats are suppressed.

Why producer-side

Deduping in the consumer (watcher/classifier) would still grow the status log unboundedly and still cost a wake per append. Suppressing the redundant append at the source keeps the log a faithful event history (every line is a real transition) and removes the storm at its origin.

Tests

  • New cases in tests/fm-status-report.test.sh covering: identical repeat suppressed, changed-reason appended, changed-key appended, repeat-after-intervening-event appended.
  • Existing brief/secondmate safety suites extended where they assert status append behavior.
  • Focused tests, lint, and docs checks green.

🤖 Generated with Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant