fix(deja): skip host-injected notification prompts - #163
Merged
Merged
Conversation
In a long cloud session the only prompts left can be ones the host injects (<task-notification>, <system-reminder>, <wake>, an agent's hand-back). buildSummary took the first as the session's task, so every check-in minted a summary claim of the wrapper text, and the next notification surfaced it as a deja-vu hit. Skip such prompts on both sides: the summary uses the first prompt a person typed (or the files touched), and a notification never triggers a lookup. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UUhB8JaPayd43w37dxiXrW Signed-off-by: Claude <noreply@anthropic.com>
…ss-prompts Signed-off-by: Claude <noreply@anthropic.com> # Conflicts: # CHANGELOG.md
CodeWithJuber
marked this pull request as ready for review
September 24, 2026 04:36
…ss-prompts Signed-off-by: Claude <noreply@anthropic.com> # Conflicts: # CHANGELOG.md
…ss-prompts Signed-off-by: Claude <noreply@anthropic.com> # Conflicts: # CHANGELOG.md
…ss-prompts Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UUhB8JaPayd43w37dxiXrW Signed-off-by: Claude <noreply@anthropic.com>
…ss-prompts Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UUhB8JaPayd43w37dxiXrW Signed-off-by: Claude <noreply@anthropic.com>
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.
What & why
In a long Claude Code cloud session, the only "prompts" left are often ones the host injects, not ones a person typed. Examples:
<task-notification>(a background task finished, a scheduled check-in, PR activity),<system-reminder>,<wake …>and another agent's hand-back.buildSummaryused the first prompt as the session's task. So on the HostLelo repo (CodeWithJuber/my-next-app), every check-in minted asummaryclaim whose text was the wrapper itself, for example<task-notification> <task-type>queued-remote-notifications</task-type> …. That caused two problems:Forge déjà vu — similar task seen day …: <task-notification> ….The fix adds
isHarnessPrompt(text)tosrc/deja.js. It matches a prompt that starts with one of the host wrapper tags, and it is applied on both sides:buildSummarytakes the first prompt a person typed. If there is none, it falls back to the files touched ("touched …"). With no edits either, it records nothing.dejaAdvisoryreturns "" for a host-injected prompt.A tag in the middle of a sentence ("fix the
<Header>overflow") or a JSX name at the start ("<Hero>spacing is off") is still treated as a person's prompt.Checklist
npm testpasses (Node 18/20/22). It passed locally on Node 22: 1442 tests, 1439 pass, 0 fail, 3 skipped. CI covers Node 20 and 22.npm run checkpasses (Biome lint + format)isHarnessPrompt, plus the newbuildSummaryanddejaAdvisorycases)feat:/fix:/docs:…)CHANGELOG.mdupdated under## [Unreleased]forge substrate,forge impact, router/gate, or MCP substrate tools (n/a)Risk & rollback
FORGE_DEJA=0still switches deja off entirely.Extra checks (tick if applicable)
npm run typecheckpassesisHarnessPromptcoerces non-strings, and deja stays best-effort)Found while driving the HostLelo PRs from a Claude Code cloud session.
🤖 Generated with Claude Code
https://claude.ai/code/session_01UUhB8JaPayd43w37dxiXrW
Generated by Claude Code