Repository navigation
mods: restore the interim-notification filter (7.165.0) - #218
Merged
Merged
Conversation
A subagent that parks on its own background shell, monitor or workflow still wakes its parent with a placeholder-only "finished" notification each time it stops to wait. Read on 2026-10-17: 481 such turns in e3ce7feb (MAWS) and 116 in b4948247, ~190M tokens of cached context re-read for nothing. The 3b2d3fa filter, unchanged, drops 745 of the 749 interim notifications in those sessions (engine 2.1.283-2.1.301); the four it keeps carry the safety classifier's warning. The README's stated cost is corrected: a parked agent killed after its interim notice goes unannounced with or without the filter, since the engine claims `notified` when it queues the notice, before any hook. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…g else The text must be exactly the envelope the engine builds around an interim notice: its header lines, the interim note with no clause appended, one placeholder result, and the usage and worktree lines. A second notification, an unknown element, a warning beside the result, or any text before or after the envelope now passes. Replay over e3ce7feb and b4948247 is unchanged: 745 of 749 interim notifications dropped. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…sion knows Four findings from the review, traced through the 2.1.300 source: - Hand-back provenance. The engine writes the waiting placeholder only for a task whose hand-back contract is on; outside it the agent's own words stand. The hook now reads the agent's transcript (grep, since transcripts run past $.fs.read's 4 MiB) as the engine's Qks does: the latest meta user record opening with the reminder or its countermand must be the reminder, and a compaction after both leaves it unknown. - Worktree. The first interim notice carrying a given worktree passes; the async launch result never names it. - Rerouted pointer. The pointer placeholder passes: a notification falls back to main when its parent agent ends, the report does not. The waiting placeholder drops only for an agent the session knows: spawned by its own loop ($.agent.list() parentId absent) or one whose earlier notice entered, so an orphan's first notice passes and its repeats drop. - The drop's row is the engine's system warning notice, drawn through no render hook; documented as what the filter gives up. Every lookup that errs or cannot tell passes the notification. Replay over the two sessions: 553 of 749 interim notifications dropped (was 745).
…file link The hook took the session's transcript directory from classic.SessionStart, so a module reloaded into a running session (a plugin update and /reload-plugins) filtered nothing until its next compaction. Each notification's <output-file> is a symlink to the agent's JSONL transcript: the hook now resolves it with $.fs.stat, requires it to land on agent-<task-id>.jsonl, and greps that file. No output file, a dangling link, or one landing elsewhere passes the notification. The SessionStart registration and the directory state are gone. Over the two sessions every one of the 725 waiting notifications carried the line, each a live link to its agent's transcript; the replay still drops 553 of 749.
The worktree and orphan rules kept what earlier notifications told the
session in module memory, recorded when next() resolved without a drop.
That memory is not the conversation: a hook beneath can answer without
core or rewrite the text without the worktree, and a rewind or a
compaction takes the first notice out while the agent lives on, so a
repeat was dropped though the conversation never kept the path.
The hook now asks the conversation as it stands, $.session.messages({ as:
"api" }): the engine's live messages from the last compaction on, rewinds
applied, with mid-turn notifications rendered into user text (the rows
form drops attachments). An orphan's repeat needs an earlier notification
of the task there, a worktree's one carrying that worktree; tool results
and assistant text do not count, and an unreadable conversation passes.
The hook keeps no state at all.
Replay over the two main transcripts in order, conversation rebuilt from
what the hook let in and emptied at each of the 65 compactions: 551 of
749 interim notifications dropped. The README names the collision cases
left by design (a fork inheriting its parent's reminder; a queued
notification read against a later run's reminder).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…n check Co-Authored-By: Claude Opus 5.5 <[email protected]>
…s conversation check Co-Authored-By: Claude Opus 5.5 <[email protected]>
SSFSKIM
added a commit
that referenced
this pull request
Oct 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Restores the interim-notification filter (
hooks/mods/interim.ts, retired in 7.145.0), rebuilt so that it cannot drop a subagent's report.Problem. A subagent that ends its turn while its own background shell, monitor or workflow runs makes the engine send the main session a notification with only the placeholder "This agent has not reported yet…", and does so again each time it parks. Each one wakes main for a turn with nothing to act on. e3ce7feb had 481 such turns (~161M cached tokens re-read) and b4948247 had 116.
What it drops. An interim notification whose whole text is the engine's envelope around the waiting placeholder, and only when all of these hold:
<output-file>link) shows the hand-back contract on, so the placeholder is the engine's;<worktree>it carries is already in the conversation.Pointer placeholders always pass. Every lookup fails open.
Verification.
Residuals are in
docs/doperpowers/TECH-DEBT.md: the engine's undroppable "Prompt dropped by a hook" row, two cases where an extra notice passes, the collision residual, quoted notices, and an engine report loss that happens with or without the filter.🤖 Generated with Claude Code