Repository navigation
fix(gmail): restore --exclude-labels SPAM,TRASH,DRAFT,SENT in buildGogWatchServeArgs - #56736
JuniperTheDev wants to merge 1 commit into
Conversation
…gWatchServeArgs (fixes openclaw#56635) Add excludeLabels field to HooksGmailConfig, HooksGmailSchema, GmailHookRuntimeConfig, and GmailHookOverrides. Default to ['SPAM','TRASH','DRAFT','SENT']. Pass as --exclude-labels flag in buildGogWatchServeArgs() to prevent sent mail and draft saves from triggering webhook notifications. Co-Authored-By: JuniperTheDev <[email protected]>
Greptile SummaryThis PR restores the Key observations:
Confidence Score: 5/5Safe to merge — the fix is minimal, targeted, and correctly restores the previously working behavior with no logic errors. All three changed files contain straightforward, low-risk additions. The resolution chain, Zod schema inclusion, and CLI arg building are all correct. No P0 or P1 issues were found; only cosmetic/style observations remain. No files require special attention.
|
| Filename | Overview |
|---|---|
| src/hooks/gmail.ts | Adds DEFAULT_GMAIL_EXCLUDE_LABELS constant, excludeLabels to types, resolves it in resolveGmailHookRuntimeConfig, and passes --exclude-labels flag in buildGogWatchServeArgs — all correct. |
| src/config/types.hooks.ts | Adds excludeLabels?: string[] to HooksGmailConfig with a JSDoc comment; correct and consistent with the runtime types. |
| src/config/zod-schema.hooks.ts | Adds excludeLabels: z.array(z.string()).optional() to the strict HooksGmailSchema, required to avoid parse errors when users configure the field. |
Reviews (1): Last reviewed commit: "fix(gmail): restore --exclude-labels SPA..." | Re-trigger Greptile
|
This pull request has been automatically marked as stale due to inactivity. |
|
Thanks for the context here. I swept through the related work, and this is now duplicate or superseded. Close as duplicate/superseded. The Gmail watcher regression is still real on current main, but #56720 is already the fuller open canonical fix for #56635; this PR omits the generated config surfaces, regression tests, docs, and changelog needed before merge. So I’m closing this here and keeping the remaining discussion on the canonical linked item. Review detailsBest possible solution: Continue with #56720 or an equivalent canonical branch that restores the default Do we have a high-confidence way to reproduce the issue? Yes. A high-confidence source-level reproduction is to resolve the default Gmail hook config and inspect Is this the best way to solve the issue? No. Threading an excluded-label list into the Gmail watcher is the right narrow behavior, but this PR is not the best merge target because #56720 already carries the same fix with generated config surfaces, docs, and regression coverage. Security review: Security review cleared: The diff only threads non-secret Gmail label IDs through config validation and subprocess argv; it does not touch CI, dependencies, lockfiles, permissions, publishing, or secret handling. What I checked:
Likely related people:
Codex review notes: model gpt-5.5, reasoning high; reviewed against ef0eb126159f. |
Summary
Fixes #56635 — regression introduced in 2026.3.24 where
buildGogWatchServeArgs()stopped passing--exclude-labelstogog gmail watch serve, causing sent mail and draft saves to trigger webhook notifications.excludeLabelsfield toHooksGmailConfig(type) andHooksGmailSchema(Zod) with default['SPAM','TRASH','DRAFT','SENT']excludeLabelstoGmailHookRuntimeConfigandGmailHookOverridestypesexcludeLabelsinresolveGmailHookRuntimeConfig()(falls back to default)--exclude-labels <labels>inbuildGogWatchServeArgs()when list is non-emptyUsers can now override the excluded labels via
hooks.gmail.excludeLabelsin config.Test plan
tsc --noEmit)gog gmail watch serve --exclude-labels SPAM,TRASH,DRAFT,SENT ...🤖 Generated with Claude Code