Skip to content

fix(gmail): ensure blocklist records on single-message path and scope to scan_id#25979

Merged
asharma53 merged 1 commit into
mainfrom
swarm/b7e3/task-4
Apr 16, 2026
Merged

fix(gmail): ensure blocklist records on single-message path and scope to scan_id#25979
asharma53 merged 1 commit into
mainfrom
swarm/b7e3/task-4

Conversation

@asharma53

@asharma53 asharma53 commented Apr 16, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Extract blocklist recording into a recordBlocklist() helper that requires scanId to be present before writing
  • Call recordBlocklist() from both the single-message optimization path and the batch archive path
  • Fixes: single-message early return (messageIds.length === 1) no longer bypasses blocklist persistence
  • Fixes: blocklist writes are now scoped to scan_id-validated paths only, preventing unverified sender emails from being recorded via bare message_ids + sender_ids

Addresses review feedback from #25971.

Test plan

  • Verify single-message scan archive records sender to blocklist
  • Verify batch scan archive still records senders to blocklist
  • Verify bare message_ids + sender_ids (no scan_id) does NOT write to blocklist
  • Verify query path and fallback path are unaffected

🤖 Generated with Claude Code


Open with Devin

… to scan_id

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@asharma53 asharma53 self-assigned this Apr 16, 2026
@asharma53 asharma53 requested a review from awlevin as a code owner April 16, 2026 00:21

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 potential issue.

View 1 additional finding in Devin Review.

Open in Devin Review

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚩 Fallback query path does not record to blocklist

When scanId && senderIds?.length is true but the scan has expired (resolved === null), the code falls back to query-based archiving per sender (lines 132-198) and returns directly at line 195 without calling recordBlocklist. This means successfully archived senders via the fallback path won't be added to the blocklist for future sessions. This is pre-existing behavior (unchanged by this PR) — the old inline blocklist code was also unreachable from this path. However, given that the senders are successfully decoded and archived, it seems like an oversight that they aren't recorded. The SKILL.md at line 187 says "The blocklist is updated automatically when gmail_archive runs with scan_id + sender_ids" which could be read as covering this path too.

(Refers to lines 187-198)

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

@asharma53 asharma53 merged commit 7fdedcb into main Apr 16, 2026
12 checks passed
@asharma53 asharma53 deleted the swarm/b7e3/task-4 branch April 16, 2026 00:26
asharma53 added a commit that referenced this pull request Apr 18, 2026
Addresses review feedback from #25977:
- Move drainQueue() after tailMessages are pushed/persisted in agent-wake.ts
  so queued user messages are dequeued against up-to-date history
- Revert build.sh default VELLUM_ENVIRONMENT back to local for run/fallback
  commands (was changed to dev, which would connect local builds to dev platform)
- gmail-archive.ts blocklist fix was already landed in #25979, no action needed

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
asharma53 added a commit that referenced this pull request Apr 18, 2026
)

Addresses review feedback from #25977:
- Move drainQueue() after tailMessages are pushed/persisted in agent-wake.ts
  so queued user messages are dequeued against up-to-date history
- Revert build.sh default VELLUM_ENVIRONMENT back to local for run/fallback
  commands (was changed to dev, which would connect local builds to dev platform)
- gmail-archive.ts blocklist fix was already landed in #25979, no action needed

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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