Skip to content

fix(guard): show blocked draft in cold-cache warning#212

Merged
fkiene merged 2 commits into
mainfrom
fix/guard-show-blocked-draft
Jul 23, 2026
Merged

fix(guard): show blocked draft in cold-cache warning#212
fkiene merged 2 commits into
mainfrom
fix/guard-show-blocked-draft

Conversation

@fkiene

@fkiene fkiene commented Jul 23, 2026

Copy link
Copy Markdown
Owner

Summary

  • Cold-cache blocks still set suppressOriginalPrompt so Claude Code does not nest Original prompt: into the warning.
  • The blocked draft is printed inside our own reason label (Not sent — draft…), because Claude Code clears the input box and never restores it — after fix(guard): suppress nested prompt echo and reinject blocked drafts #209 the text vanished from a cold TTY.
  • Disk stash + next-turn additionalContext reinject (when the next submit differs) is unchanged.

Test plan

  • cargo test -p llmtrim --lib guard:: (28 passed)
  • CI green
  • Live: resume a cold, large session → block message shows the draft under our label, not Original prompt:
  • Live: resend the same text → goes through; type something else → previous draft still reinjected as context

suppressOriginalPrompt hid the draft after Claude Code cleared the input
box; next-turn additionalContext only helped on a different follow-up.
Embed the draft in our reason under our own label so a cold TTY still
shows what was not sent.

Signed-off-by: François Kiene <46886660+fkiene@users.noreply.github.com>
@fkiene
fkiene enabled auto-merge (squash) July 23, 2026 10:09
Signed-off-by: François Kiene <46886660+fkiene@users.noreply.github.com>
@codecov

codecov Bot commented Jul 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@fkiene
fkiene merged commit a61a3ff into main Jul 23, 2026
30 checks passed
@fkiene
fkiene deleted the fix/guard-show-blocked-draft branch July 23, 2026 10:17
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