Skip to content

revert: remove compaction destination reminder (PR #2327)#2412

Merged
gavrielc merged 1 commit into
mainfrom
revert/compaction-destination-reminder
May 11, 2026
Merged

revert: remove compaction destination reminder (PR #2327)#2412
gavrielc merged 1 commit into
mainfrom
revert/compaction-destination-reminder

Conversation

@gavrielc

Copy link
Copy Markdown
Collaborator

Summary

  • Reverts PR fix: inject destination reminder after SDK auto-compaction #2327 — the compacted event handler was injecting a [system]-tagged reminder into the live query after SDK auto-compaction, which caused the agent to send an unintended message
  • Removes the compacted variant from ProviderEvent, restores result yield for compact_boundary in ClaudeProvider, removes the compacted handler in poll-loop.ts, and removes the associated tests + CompactingProvider helper

Test plan

🤖 Generated with Claude Code

The compacted event handler injected a system-tagged reminder into the
live query after SDK auto-compaction, which caused the agent to send
an unintended message. Reverts the four changes from #2327:

- Remove `compacted` variant from ProviderEvent union
- Restore `result` yield for compact_boundary in ClaudeProvider
- Remove compacted event handler and getAllDestinations import in poll-loop
- Remove compaction integration tests and CompactingProvider helper

Closes #2325 differently — the reminder approach is not viable.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@gavrielc gavrielc requested a review from gabi-simons as a code owner May 11, 2026 09:39
@gavrielc gavrielc merged commit fcbc204 into main May 11, 2026
2 checks passed
romanbsd added a commit to romanbsd/nanoclaw that referenced this pull request May 13, 2026
Today (2026-05-13 10:30 IDT) a recurring daily-digest task fired on
time but produced no output. Unlike the 2026-05-11 incident (which
was the SDK auto-compacting the task prompt away — see PR nanocoai#2411 on
upstream/main), today no compaction happened. The agent saw the
<task> block, mis-read its row-insertion timestamp as the scheduled
fire time, conflated it with yesterday's manual-recovery delivery,
and explicitly logged "Sending again would be a duplicate. Skipped"
before ending the turn. markCompleted ran, next recurrence scheduled
for tomorrow, container sat idle until the absolute-ceiling kill.

Three coordinated changes:

1. formatter: expose `scheduled_for` on <task> blocks, populated from
   `process_after`. The existing `time` attribute reflects the row's
   insertion timestamp (often the previous fire), which today's agent
   read as the scheduled fire time. Keeping `time` for back-compat
   and adding `scheduled_for` removes the ambiguity.

2. scheduling.instructions.md: add a "When a scheduled task fires"
   section telling the agent each fire is independent, the scheduler
   guarantees no duplicates, and prior conversation history about
   late-delivered earlier fires is never about the current one.

3. compact-instructions.ts: extend the PreCompact custom-instructions
   so the compaction summarizer preserves the <task> body verbatim
   when the latest input is a task. This is the architectural analog
   of upstream PR nanocoai#2411 — that branch's push-after-compact mechanism
   was removed in PR nanocoai#2412, replaced with this PreCompact-driven
   approach.

Tests: new `formatTaskMessage` describe block with two cases —
distinct timestamp vs scheduled_for, and null process_after fallback.
91/91 agent-runner tests pass.

Container source is bind-mounted (-v container/agent-runner/src:/app/src:ro)
so no image rebuild is needed — next container spawn picks up the change.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
zenmindhacker pushed a commit to zenmindhacker/nanoclaw that referenced this pull request May 26, 2026
…ination-reminder

revert: remove compaction destination reminder (PR nanocoai#2327)
tamasPetki pushed a commit to tamasPetki/nanoclaw that referenced this pull request Jun 4, 2026
…ination-reminder

revert: remove compaction destination reminder (PR nanocoai#2327)
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