Skip to content

fix(context-guard): say the reading is unavailable after a compaction instead of naming the dumb zone - #8200

Merged
kyle-sexton merged 9 commits into
mainfrom
work-resolve-issue/issue-7883-39113367932-1
Oct 20, 2026
Merged

kyle-sexton merged 9 commits into
mainfrom
work-resolve-issue/issue-7883-39113367932-1

Conversation

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor

Closes #7883

Summary

Opened by the work-resolve-issue lane. The run's own summary:

With model_notices on, a compacted session with no figures yet now gets a factual line saying the context reading is unavailable until the next API response, instead of 'dumb zone (3 of 3, compacted)'. The restatement waits, and once figures arrive the normal compacted zone line is sent. The status tool JSON, band and blocking mode are untouched.

Not verified

  • The context-guard test file (imports claude-code/testing, not vitest) was refused by run-test-file, so the new and updated cases were not run; the change was checked by reading only. Left to the PR's CI.
  • No independent review subagent or build/lint was run; review-venue.txt was not read.

Fix

  • plugins/context-guard/hooks/register.tsx: restate events carry an unavailable flag when a compacted reading has no percent or tokens; a per-session awaiting flag keeps the restatement pending until figures arrive; the unavailable line is rendered and does not add the options line
  • plugins/context-guard/hooks/context-guard.test.ts: the compaction restatement test now expects the unavailable line; new cases for figures arriving after a compaction and for figures at the first reading
  • .changes/context-guard/fix-compaction-reading-unavailable-7883b4e1.md: patch fragment

Verification

The run reports:

Left out: the items under Not verified.

Related

#7883

… instead of naming the dumb zone

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@github-actions

github-actions Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

claude-security-review reviewed 7097f08ae4e18beb34ad0e83fa4f037c6523e3a3: 0 finding(s), 0 as inline comments.

No security issues found in PR #8200 at head 7097f08. I read the whole diff (gh pr diff 8200).

The PR changes five files. Two are documentation text: the plugin option description and the README table. Two are code: register.tsx and context-guard.test.ts. The fifth is a patch changelog fragment. In register.tsx, the change adds an unavailable restate event and an awaiting flag. When a session has been compacted and has no figures yet, it renders a fixed string saying the context reading is unavailable.

  • Untrusted input: The new line is a constant string. No user-controlled, tool-output or transcript data goes into it, so there is no injection path into model context.
  • Auth, secrets, commands: The diff touches no authentication, token, secret, filesystem, shell or network code. It adds no workflow or permission changes.
  • Instruction-surface deletions: The diff does not delete or soften a standing instruction (CLAUDE.md, AGENTS.md, rules, skill or agent bodies, or a hook allowlist or block list). The model_notices description is reworded, and the same notices are still sent. I did not consult the instruction exception register, because nothing in the diff calls for it.
  • State handling: The awaiting flag is reset on compaction and when figures arrive. This is ordinary logic with no trust-boundary effect.

@github-actions

github-actions Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

claude-review reviewed 7097f08ae4e18beb34ad0e83fa4f037c6523e3a3: 0 finding(s), 0 as inline comments.

No findings on PR #8200 at 7097f08. I read the whole diff and the surrounding register.tsx code, and checked the change against issue #7883 and its acceptance criteria. I did not run the tests: the test file imports claude-code/testing, and the PR description says its cases were not run.

Checked

  • recordReading holds the restatement while a compacted reading has no percent or tokens, and sends it once the figures arrive. A pending unavailable event is replaced by the real restatement through mergeRestated.
  • The awaiting flag stops the unavailable line repeating. A second compaction clears it, so the line is sent again, and the updated test expects that.
  • renderAll omits the options line for an unavailable-only batch. The status tool JSON, the band and blocking mode still read s.compacted as before.
  • The README table, the plugin.json option text and the changelog fragment agree with the code.

Minor, not reported: a reload (session.start with turns) that happens while the unavailable line is still pending drops that line, and awaiting stays true, so it is not resent. The normal compacted zone line still arrives once figures do.

Unverified: the PR description says the new test cases and the build and lint were not run. They remain unconfirmed until CI runs on this head.

@melodic-automation-lanes

melodic-automation-lanes Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor Author

Unattended merge: risk MED at head d470a9beeca85a5df2b97af493a9d90f6aeb815c. Only LOW merges without a human; this pull request waits for one.

MED evidence-unbound:claude-security-review: not bound: skip-not-no-change
MED findings:claude-review: 2 open

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

pr-unblock / address-feedback finished round 1 of 3 on d470a9b.

@melodic-automation-lanes melodic-automation-lanes Bot added the needs-human Human-in-the-loop required; autonomous sessions must not resolve items carrying this. label Oct 19, 2026
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The pr-unblock lane stopped on this pull request and needs a person: a fix the lane recorded did not reach the branch, so none of its review replies was posted.

  • Reason: feedback-not-landed
  • Resume key: d470a9beeca85a5df2b97af493a9d90f6aeb815c (the head the lane stopped on)

To resume, deal with the reason above, remove the needs-human label (and do-not-merge, if set), then dispatch the pr-unblock workflow with pr-number=8200 and activity=address-feedback:

gh workflow run pr-unblock.yml -R melodic-software/claude-code-plugins -f pr-number=8200 -f activity=address-feedback

Comment thread plugins/context-guard/README.md Resolved
kyle-sexton and others added 5 commits October 19, 2026 13:52
…from main

#8125 added three compaction tests that clear the figures after compact()
and expected the old zone restatement. With this PR's intent (#7883), a
compaction with no figures says the reading is unavailable, so those
expectations now name UNAVAILABLE.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WyWcv2NwzrPQ4dChfwFjM7
The model_notices option description, and its generated README row, now
say that a compaction with no figures yet gets the reading-unavailable
line; the Lines to Claude table quotes the emitted line exactly.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WyWcv2NwzrPQ4dChfwFjM7
@kyle-sexton
kyle-sexton added this pull request to the merge queue Oct 20, 2026
Merged via the queue into main with commit a388d8a Oct 20, 2026
26 checks passed
@kyle-sexton
kyle-sexton deleted the work-resolve-issue/issue-7883-39113367932-1 branch October 20, 2026 09:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-human Human-in-the-loop required; autonomous sessions must not resolve items carrying this.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(context-guard): say the reading is unavailable after a compaction instead of naming the dumb zone

1 participant