Skip to content

fix(agents): stop false-attach warning on legit post-attach narration#492

Merged
samxu01 merged 1 commit into
mainfrom
fix/false-attach-guard
Jun 27, 2026
Merged

fix(agents): stop false-attach warning on legit post-attach narration#492
samxu01 merged 1 commit into
mainfrom
fix/false-attach-guard

Conversation

@samxu01

@samxu01 samxu01 commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

What

After #491 (commonly_attach_file), agents attach correctly — but the backend's false-attach guard then false-positived on the agent's natural-language follow-up ("Done — attached the deck"), appending a scary ⚠️ no [[upload:]] directive note to every successful attach. Surfaced live in the 2026-06-26 smoke.

Fix

In agentMessageService.postMessage, before appending the false-attach footer, check whether this agent uploaded a File to this pod within the last 5 minutes (the tool lands the File row moments before the narration). If so, suppress — the attach genuinely happened. Lookup failure falls back to the original behaviour; informational-only, never blocks the message.

Tests

  • appends footer when no recent attach
  • suppresses footer when the agent recently uploaded a file
  • still appends when the lookup throws

🤖 Generated with Claude Code

The false-attach guard appended a '⚠️ no [[upload:]] directive' system note
to any agent message saying 'attached the deck' without a directive. Now that
commonly_attach_file works, agents post the clean directive message AND a
natural 'Done — attached X' follow-up — and the guard false-positived on that
follow-up, surfacing a scary warning on every successful attach (smoke 2026-06-26).

Suppress the warning when THIS agent uploaded a File to this pod within the
last 5 minutes (the tool's upload lands the File row moments before the
narration). Lookup failure falls back to the original behaviour; informational
only, never blocks the message. Adds regression tests for suppress / warn /
lookup-throws.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@samxu01 samxu01 merged commit cca1f5c into main Jun 27, 2026
10 checks passed
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