Skip to content

fix(hooks): exclude sent and draft Gmail events - #56720

Merged
vincentkoc merged 1 commit into
openclaw:mainfrom
Lidang-Jiang:fix/gmail-exclude-labels-regression
Jul 29, 2026
Merged

vincentkoc merged 1 commit into
openclaw:mainfrom
Lidang-Jiang:fix/gmail-exclude-labels-regression

Conversation

@Lidang-Jiang

@Lidang-Jiang Lidang-Jiang commented Mar 29, 2026 •

Copy link
Copy Markdown
Contributor

Closes #56635

What Problem This Solves

Fixes an issue where Gmail hook users could have sent messages and draft saves forwarded into OpenClaw because the watcher inherited gog's narrower SPAM,TRASH exclusion default.

Why This Change Was Made

The shared Gmail watcher argument builder now always passes --exclude-labels SPAM,TRASH,DRAFT,SENT. This keeps the policy in the single path used by both Gateway auto-start and openclaw webhooks gmail run.

This rewrite intentionally removes the proposed hooks.gmail.excludeLabels config surface. OpenClaw's Gmail hook is an inbound-mail workflow, so excluding outbound and draft labels is a fixed product default rather than another operator setting.

The original report attributed the change to OpenClaw 2026.3.24, but package inspection found that the published 2026.2.24 and 2026.3.24 watcher builders both omitted the flag. The confirmed defect is implicit reliance on gog, whose current default excludes only SPAM,TRASH.

User Impact

Sent mail, drafts, spam, and trash are filtered by gog before hook delivery. Users no longer have their own outbound messages or draft saves enter the Gmail hook processing path.

Evidence

  • Regression test before the runtime change: src/hooks/gmail.test.ts failed because generated watcher args omitted --exclude-labels.
  • Focused exact-base tests: 44 passed, 1 integration case skipped by its existing environment guard.
  • Real dependency proof: OpenClaw-generated args were passed to installed gog v0.32.0 in isolated --dry-run mode; it exited 0 and reported exclude_labels: ["SPAM","TRASH","DRAFT","SENT"] with source: "flags".
  • Upstream contract: openclaw/gogcli documents --exclude-labels, defaults to SPAM,TRASH, and accepts an explicit empty string to disable filtering.
  • Static proof: oxfmt --check, scoped oxlint, and git diff --check passed.
  • Fresh autoreview after rebase: clean, no accepted/actionable findings, overall correctness 0.99.
  • Heavy changed-gate delegation could not start because this host lacks Blacksmith authentication; exact-head GitHub CI is the landing gate.

AI-assisted: yes. Maintainer rewrite preserves Lidang Jiang's contribution with a co-author trailer.

@greptile-apps

greptile-apps Bot commented Mar 29, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR restores the missing --exclude-labels flag to the gog CLI invocation in the Gmail watcher, fixing a regression where sent mail and draft saves were incorrectly triggering webhook notifications. The fix is well-structured: a DEFAULT_GMAIL_EXCLUDE_LABELS constant is introduced, the field is threaded through the schema, type definitions, runtime config resolver, and CLI arg builder, and comprehensive tests are added for all code paths.

Key findings:

  • The excludeLabels Zod schema field uses .default(X).optional() ordering, which means the Zod-level default is never applied at parse time (the outer ZodOptional short-circuits on undefined before the inner ZodDefault can fire). The end-to-end behaviour is still correct because resolveGmailHookRuntimeConfig has an explicit ?? DEFAULT_GMAIL_EXCLUDE_LABELS fallback, but the "default" annotation emitted into schema.base.generated.ts is misleading. The fix is to reverse the order to .optional().default([...]).
  • In buildGogWatchServeArgs, the cfg.excludeLabels && guard is redundant since excludeLabels is a required (string[]) field on GmailHookRuntimeConfig.

Confidence Score: 5/5

Safe to merge — the core bug fix is correct and all remaining findings are minor style issues (P2).

All P0/P1 concerns are absent. The two findings are purely cosmetic: a Zod chain-ordering issue that does not affect runtime behaviour thanks to an explicit fallback, and a redundant null guard on a non-nullable field. Neither blocks correctness or introduces a regression.

src/config/zod-schema.hooks.ts — the .default().optional() ordering deserves a quick fix before the next schema generation run to avoid a misleading "default" annotation in the generated JSON schema.

Important Files Changed

Filename Overview
src/hooks/gmail.ts Adds excludeLabels to GmailHookOverrides, GmailHookRuntimeConfig, resolveGmailHookRuntimeConfig, and buildGogWatchServeArgs — core logic is correct; minor redundant null guard on a required field.
src/config/zod-schema.hooks.ts Adds excludeLabels field with .default().optional() ordering, which means the Zod-level default is never applied at parse time; behaviour is rescued by the runtime fallback but the generated schema annotation is misleading.
src/config/types.hooks.ts Adds optional excludeLabels?: string[] to HooksGmailConfig — straightforward and correct.
src/config/schema.base.generated.ts Auto-generated JSON schema updated with excludeLabels field and default annotation — consistent with the Zod schema definition.
src/hooks/gmail.test.ts Comprehensive tests added covering default labels, custom labels, empty array omission, and resolveGmailHookRuntimeConfig override behaviour — good coverage.
Prompt To Fix All With AI
This is a comment left during a code review.
Path: src/config/zod-schema.hooks.ts
Line: 132-136

Comment:
**`.default().optional()` order means default is never applied**

In Zod v3 the chain `z.array(...).default(X).optional()` produces a `ZodOptional(ZodDefault(...))`. When the field is absent from the config (input is `undefined`), the outer `ZodOptional` short-circuits and returns `undefined` immediately — the inner `ZodDefault` is never reached. This means `gmail.excludeLabels` will always be `undefined` when the user hasn't set the field, rather than the intended `["SPAM", "TRASH", "DRAFT", "SENT"]`.

The behaviour is still correct end-to-end only because `resolveGmailHookRuntimeConfig` has the extra fallback `?? DEFAULT_GMAIL_EXCLUDE_LABELS`. However, the `"default"` annotation emitted into `schema.base.generated.ts` is therefore misleading: the Zod schema itself never applies it at parse time.

To actually have Zod apply the default, the ordering must be reversed (`.optional()` first, then `.default()`):

```suggestion
    excludeLabels: z
      .array(z.string())
      .optional()
      .default(["SPAM", "TRASH", "DRAFT", "SENT"])
      .describe("Gmail labels to exclude from webhook notifications"),
```

Alternatively, since every other field in this schema omits a Zod-level default and relies on the resolution function for its fallback, you could simply drop the `.default()` call here to stay consistent — just keep `.optional()` and rely on the `?? DEFAULT_GMAIL_EXCLUDE_LABELS` already present in `resolveGmailHookRuntimeConfig`.

How can I resolve this? If you propose a fix, please make it concise.

---

This is a comment left during a code review.
Path: src/hooks/gmail.ts
Line: 253-255

Comment:
**Redundant truthiness check on a required field**

`excludeLabels` is typed as `string[]` (non-optional) in `GmailHookRuntimeConfig`, so `cfg.excludeLabels` can never be `null` or `undefined`. The leading `cfg.excludeLabels &&` guard is unnecessary and slightly misleading about the field's nullability.

```suggestion
  if (cfg.excludeLabels.length > 0) {
    args.push("--exclude-labels", cfg.excludeLabels.join(","));
  }
```

How can I resolve this? If you propose a fix, please make it concise.

Reviews (1): Last reviewed commit: "fix(hooks): restore --exclude-labels in ..." | Re-trigger Greptile

Comment thread src/config/zod-schema.hooks.ts Outdated
Comment on lines +132 to +136
excludeLabels: z
.array(z.string())
.default(["SPAM", "TRASH", "DRAFT", "SENT"])
.describe("Gmail labels to exclude from webhook notifications")
.optional(),

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.

P2 .default().optional() order means default is never applied

In Zod v3 the chain z.array(...).default(X).optional() produces a ZodOptional(ZodDefault(...)). When the field is absent from the config (input is undefined), the outer ZodOptional short-circuits and returns undefined immediately — the inner ZodDefault is never reached. This means gmail.excludeLabels will always be undefined when the user hasn't set the field, rather than the intended ["SPAM", "TRASH", "DRAFT", "SENT"].

The behaviour is still correct end-to-end only because resolveGmailHookRuntimeConfig has the extra fallback ?? DEFAULT_GMAIL_EXCLUDE_LABELS. However, the "default" annotation emitted into schema.base.generated.ts is therefore misleading: the Zod schema itself never applies it at parse time.

To actually have Zod apply the default, the ordering must be reversed (.optional() first, then .default()):

Suggested change
excludeLabels: z
.array(z.string())
.default(["SPAM", "TRASH", "DRAFT", "SENT"])
.describe("Gmail labels to exclude from webhook notifications")
.optional(),
excludeLabels: z
.array(z.string())
.optional()
.default(["SPAM", "TRASH", "DRAFT", "SENT"])
.describe("Gmail labels to exclude from webhook notifications"),

Alternatively, since every other field in this schema omits a Zod-level default and relies on the resolution function for its fallback, you could simply drop the .default() call here to stay consistent — just keep .optional() and rely on the ?? DEFAULT_GMAIL_EXCLUDE_LABELS already present in resolveGmailHookRuntimeConfig.

Prompt To Fix With AI
This is a comment left during a code review.
Path: src/config/zod-schema.hooks.ts
Line: 132-136

Comment:
**`.default().optional()` order means default is never applied**

In Zod v3 the chain `z.array(...).default(X).optional()` produces a `ZodOptional(ZodDefault(...))`. When the field is absent from the config (input is `undefined`), the outer `ZodOptional` short-circuits and returns `undefined` immediately — the inner `ZodDefault` is never reached. This means `gmail.excludeLabels` will always be `undefined` when the user hasn't set the field, rather than the intended `["SPAM", "TRASH", "DRAFT", "SENT"]`.

The behaviour is still correct end-to-end only because `resolveGmailHookRuntimeConfig` has the extra fallback `?? DEFAULT_GMAIL_EXCLUDE_LABELS`. However, the `"default"` annotation emitted into `schema.base.generated.ts` is therefore misleading: the Zod schema itself never applies it at parse time.

To actually have Zod apply the default, the ordering must be reversed (`.optional()` first, then `.default()`):

```suggestion
    excludeLabels: z
      .array(z.string())
      .optional()
      .default(["SPAM", "TRASH", "DRAFT", "SENT"])
      .describe("Gmail labels to exclude from webhook notifications"),
```

Alternatively, since every other field in this schema omits a Zod-level default and relies on the resolution function for its fallback, you could simply drop the `.default()` call here to stay consistent — just keep `.optional()` and rely on the `?? DEFAULT_GMAIL_EXCLUDE_LABELS` already present in `resolveGmailHookRuntimeConfig`.

How can I resolve this? If you propose a fix, please make it concise.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good catch — fixed in 5f56d2e. Dropped the Zod-level .default() to stay consistent with the other fields in this schema (all rely on resolveGmailHookRuntimeConfig for defaults rather than Zod parse-time defaults).

Comment thread src/hooks/gmail.ts Outdated
Comment on lines +253 to +255
if (cfg.excludeLabels && cfg.excludeLabels.length > 0) {
args.push("--exclude-labels", cfg.excludeLabels.join(","));
}

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.

P2 Redundant truthiness check on a required field

excludeLabels is typed as string[] (non-optional) in GmailHookRuntimeConfig, so cfg.excludeLabels can never be null or undefined. The leading cfg.excludeLabels && guard is unnecessary and slightly misleading about the field's nullability.

Suggested change
if (cfg.excludeLabels && cfg.excludeLabels.length > 0) {
args.push("--exclude-labels", cfg.excludeLabels.join(","));
}
if (cfg.excludeLabels.length > 0) {
args.push("--exclude-labels", cfg.excludeLabels.join(","));
}
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/hooks/gmail.ts
Line: 253-255

Comment:
**Redundant truthiness check on a required field**

`excludeLabels` is typed as `string[]` (non-optional) in `GmailHookRuntimeConfig`, so `cfg.excludeLabels` can never be `null` or `undefined`. The leading `cfg.excludeLabels &&` guard is unnecessary and slightly misleading about the field's nullability.

```suggestion
  if (cfg.excludeLabels.length > 0) {
    args.push("--exclude-labels", cfg.excludeLabels.join(","));
  }
```

How can I resolve this? If you propose a fix, please make it concise.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good catch — fixed in 5f56d2e. Removed the redundant truthiness guard since excludeLabels is typed as string[] (non-optional) in GmailHookRuntimeConfig.

@openclaw-barnacle openclaw-barnacle Bot added the docs Improvements or additions to documentation label Mar 29, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the docs Improvements or additions to documentation label Apr 8, 2026
@openclaw-barnacle

Copy link
Copy Markdown

This pull request has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.

@clawsweeper

clawsweeper Bot commented Apr 30, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed July 3, 2026, 9:51 PM ET / July 4, 2026, 01:51 UTC.

Summary
The branch adds hooks.gmail.excludeLabels config/schema/docs/tests and passes resolved labels into gog gmail watch serve.

PR surface: Source +16, Tests +72, Docs +2, Generated +14. Total +104 across 11 files.

Reproducibility: yes. at source level. Current main and v2026.6.11 build the shared Gmail watcher argv without --exclude-labels, while gogcli defaults only exclude SPAM,TRASH; I did not run a live Gmail watcher in this read-only review.

Review metrics: 1 noteworthy metric.

  • Gmail Config Surface: 1 added. The PR adds hooks.gmail.excludeLabels, so maintainers need to review the public config semantics before merge.

Root-cause cluster
Relationship: fixed_by_candidate
Canonical: #56635
Summary: This PR is a candidate fix for the open Gmail watcher excluded-label regression; earlier reports and PRs are duplicates or superseded attempts, while the later token-argv PR overlaps the helper but addresses a distinct security problem.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge readiness
Overall: 🦪 silver shellfish
Proof: 🦪 silver shellfish
Patch quality: 🦐 gold shrimp
Result: blocked until stronger real behavior proof is added.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • [P1] Add redacted live watcher proof showing --exclude-labels SPAM,TRASH,DRAFT,SENT and a sent/draft filtering check after the fix.
  • [P1] Fix the excludeLabels: [] behavior or remove the documented empty-list opt-out.
  • [P1] Refresh the branch and get maintainer acceptance for the new config surface, or narrow the PR to the default-restore bug fix.

Proof guidance:

  • [P1] Needs stronger real behavior proof before merge: The PR body shows source-level argv output and local checks, but not redacted live watcher logs or a real sent/draft filtering check; add terminal/log/video proof with private details redacted, then update the PR body to trigger review or ask a maintainer for @clawsweeper re-review.

Risk before merge

  • [P1] The PR adds a new user-facing hooks.gmail.excludeLabels config/default surface; maintainers need to accept that surface or narrow the fix to the shipped default restoration.
  • [P1] The documented empty-list opt-out is wrong as implemented because omitting --exclude-labels leaves gogcli's SPAM,TRASH default active instead of disabling exclusions.
  • [P1] The contributor proof is source-level argv output and local checks only; it does not show redacted live watcher startup logs or a real Gmail sent/draft filtering check after the fix.
  • [P1] The branch is currently conflicting with main, and the open Gmail token-argv PR touches the same helper, so a refresh must preserve whichever secret-handling direction maintainers accept.

Maintainer options:

  1. Narrow To Default Restore (recommended)
    Remove the new config/docs/schema surface and restore only the default --exclude-labels SPAM,TRASH,DRAFT,SENT behavior, then refresh proof.
  2. Accept Config With Correct Semantics
    If maintainers want hooks.gmail.excludeLabels, require explicit empty-string forwarding, aligned docs/schema/tests, and fresh-install plus upgrade proof.
  3. Replace If Refresh Is Too Costly
    If conflicts with newer Gmail argv work are hard to resolve, keep the linked issue open and use a narrow replacement PR that preserves the useful fix.

Next step before merge

  • [P1] Manual review is needed because the PR is conflicting, contributor real-behavior proof is insufficient, and maintainers must accept, narrow, or repair the new Gmail config surface before merge.

Security
Cleared: The diff adds non-secret Gmail label args plus schema/docs/tests and does not add dependencies, workflows, or new secret handling; no concrete security or supply-chain regression was found.

Review findings

  • [P2] Forward empty exclude-label lists explicitly — src/hooks/gmail.ts:252-254
Review details

Best possible solution:

Land a refreshed fix that restores DRAFT/SENT exclusions by default, either without a new config knob or with accepted, correct, tested config semantics and redacted real watcher proof.

Do we have a high-confidence way to reproduce the issue?

Yes, at source level. Current main and v2026.6.11 build the shared Gmail watcher argv without --exclude-labels, while gogcli defaults only exclude SPAM,TRASH; I did not run a live Gmail watcher in this read-only review.

Is this the best way to solve the issue?

No, not as-is. Restoring the default flag in the shared helper is the right fix location, but the new config surface needs maintainer acceptance and the empty-list behavior must match gogcli's contract before merge.

Full review comments:

  • [P2] Forward empty exclude-label lists explicitly — src/hooks/gmail.ts:252-254
    The new help text says hooks.gmail.excludeLabels: [] makes every label trigger, but this branch omits --exclude-labels when the array is empty. gogcli treats an omitted flag as its SPAM,TRASH default, so pass --exclude-labels with an empty string or remove the documented empty-list opt-out.
    Confidence: 0.91

Overall correctness: patch is incorrect
Overall confidence: 0.87

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 2ffeedf406e7.

Label changes

Label justifications:

  • P1: This PR targets a shipped Gmail hook regression where sent mail and draft saves can trigger agent processing for affected users.
  • merge-risk: 🚨 compatibility: The diff adds a new hooks.gmail.excludeLabels config/default surface with upgrade and operator-facing semantics.
  • merge-risk: 🚨 message-delivery: Incorrect excluded-label handling can wrongly deliver or suppress Gmail hook events before OpenClaw processes them.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦐 gold shrimp.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs stronger real behavior proof before merge: The PR body shows source-level argv output and local checks, but not redacted live watcher logs or a real sent/draft filtering check; add terminal/log/video proof with private details redacted, then update the PR body to trigger review or ask a maintainer for @clawsweeper re-review.
Evidence reviewed

PR surface:

Source +16, Tests +72, Docs +2, Generated +14. Total +104 across 11 files.

View PR surface stats
Area Files Added Removed Net
Source 5 16 0 +16
Tests 2 72 0 +72
Docs 2 2 0 +2
Config 0 0 0 0
Generated 2 17 3 +14
Other 0 0 0 0
Total 11 107 3 +104

What I checked:

  • Root policy read: Read root AGENTS.md and docs/AGENTS.md; their ClawSweeper PR review, config-surface, dependency-contract, and docs-hosting guidance apply because the PR changes Gmail runtime args, config schema, generated config help, and docs. (AGENTS.md:1, 2ffeedf406e7)
  • Current main still omits excluded labels: buildGogWatchServeArgs() builds the watcher argv with account, bind, port, path, tokens, include-body, and max-bytes, but does not append --exclude-labels. (src/hooks/gmail.ts:234, 2ffeedf406e7)
  • Latest stable release still omits excluded labels: The v2026.6.11 tag has the same buildGogWatchServeArgs() shape without --exclude-labels, so the bug is not already shipped fixed. (src/hooks/gmail.ts:234, e085fa1a3ffd)
  • Gateway caller uses the affected helper: The gateway Gmail watcher spawn path calls buildGogWatchServeArgs(cfg), so the missing flag affects auto-started Gmail watchers. (src/hooks/gmail-watcher.ts:69, 2ffeedf406e7)
  • Foreground runner uses the same helper: runGmailService() resolves Gmail runtime config and spawns gog through the same serve-argv builder, so the shared helper is the correct bug-fix location. (src/hooks/gmail-ops.ts:278, 2ffeedf406e7)
  • Current config schema has no field: Current main's HooksGmailSchema includes Gmail fields such as account, includeBody, maxBytes, renewEveryMinutes, serve, and tailscale, but no excludeLabels field. (src/config/zod-schema.hooks.ts:113, 2ffeedf406e7)

Likely related people:

  • steipete: The shared Gmail hook helpers and setup surface appear to date to feat: add gmail hooks wizard, which added src/hooks/gmail.ts, src/hooks/gmail-ops.ts, and Gmail tests. (role: introduced behavior and recent area contributor; confidence: high; commits: 523d9ec3c2e4; files: src/hooks/gmail.ts, src/hooks/gmail-ops.ts, src/hooks/gmail.test.ts)
  • jverdi: The gateway auto-start path that calls the shared Gmail serve-argv helper was introduced by Gmail watcher: start when gateway (re)starts. (role: gateway watcher introducer; confidence: medium; commits: ca9b0dbc887d; files: src/hooks/gmail-watcher.ts, src/gateway/server.ts)
  • eleqtrizit: Recent work changed Gmail watcher startup argument redaction across the same serve/log helper surface. (role: recent adjacent contributor; confidence: medium; commits: 851294126b30; files: src/hooks/gmail.ts, src/hooks/gmail-watcher.ts, src/hooks/gmail-ops.ts)
  • vincentkoc: Recent work changed the Gmail serve invocation path for Windows gog command wrapping in the same helper file. (role: recent adjacent contributor; confidence: medium; commits: 5e7bb9cf9b4d; files: src/hooks/gmail.ts, src/hooks/gmail.windows.test.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@Lidang-Jiang
Lidang-Jiang force-pushed the fix/gmail-exclude-labels-regression branch from 2517985 to b881300 Compare April 30, 2026 07:27
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime labels Apr 30, 2026
@Lidang-Jiang

Lidang-Jiang commented Apr 30, 2026 •

Copy link
Copy Markdown
Contributor Author

Thanks for the review. The first update was superseded while main advanced; latest addressed commit is 4088dc12c9f8a560680284e72c69aa53da091d9f. The PR body now has the refreshed before/after and verification logs.

@Lidang-Jiang
Lidang-Jiang force-pushed the fix/gmail-exclude-labels-regression branch from b881300 to 607a301 Compare April 30, 2026 07:34
@Lidang-Jiang

Lidang-Jiang commented Apr 30, 2026 •

Copy link
Copy Markdown
Contributor Author

Main advanced again while updating the branch, so I removed the non-essential changelog entry to avoid repeated top-of-file conflicts and rebuilt the PR on 8375353. Latest addressed commit is 4088dc12c9f8a560680284e72c69aa53da091d9f, with the PR body refreshed to the new before/after and verification logs.

@Lidang-Jiang
Lidang-Jiang force-pushed the fix/gmail-exclude-labels-regression branch from 607a301 to 4088dc1 Compare April 30, 2026 07:42
@openclaw-barnacle openclaw-barnacle Bot removed the stale Marked as stale due to inactivity label May 1, 2026
@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 11, 2026
@openclaw-barnacle openclaw-barnacle Bot added triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. and removed proof: sufficient ClawSweeper judged the real behavior proof convincing. labels May 11, 2026
@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 11, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 11, 2026
@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 11, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 11, 2026
@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 11, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 11, 2026
@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 11, 2026
@clawsweeper clawsweeper Bot added status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Jun 10, 2026
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jun 16, 2026
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Jun 28, 2026
@openclaw-barnacle openclaw-barnacle Bot added the triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. label Jun 28, 2026
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. labels Jun 28, 2026
@clawsweeper

clawsweeper Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

@Lidang-Jiang thanks for the PR. ClawSweeper is still waiting on real behavior proof before this can move forward.

Useful proof can be a screenshot, short video, terminal output, copied live output, linked artifact, or redacted logs that show the changed behavior after the fix. Please redact private tokens, phone numbers, private endpoints, customer data, and anything else sensitive.

Once proof is added to the PR body or a comment, ClawSweeper or a maintainer can re-check it.

@vincentkoc vincentkoc self-assigned this Jul 29, 2026
@vincentkoc
vincentkoc force-pushed the fix/gmail-exclude-labels-regression branch from 4088dc1 to 2bdf9db Compare July 29, 2026 08:34
@openclaw-barnacle openclaw-barnacle Bot added size: XS and removed docs Improvements or additions to documentation gateway Gateway runtime size: S labels Jul 29, 2026
@vincentkoc vincentkoc changed the title fix(hooks): restore --exclude-labels in Gmail watcher args fix(hooks): exclude sent and draft Gmail events Jul 29, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. label Jul 29, 2026
@vincentkoc

Copy link
Copy Markdown
Member

Maintainer rewrite is ready on exact head 2bdf9db3f7bb38ecbececb40cab609175f9cc0ae.

ClawSweeper rank-up moves addressed:

  • Narrowed the PR to the default-restore bug fix. The prior config/schema/docs/generated surface and empty-list opt-out are gone.
  • The shared Gmail watcher argv builder now always passes --exclude-labels SPAM,TRASH,DRAFT,SENT, covering both the gateway watcher and foreground runner.
  • Live dependency proof with installed gog v0.32.0 and isolated state parsed the generated argv successfully and reported excludeLabels=["SPAM","TRASH","DRAFT","SENT"].

Validation on this exact head:

The local changed-check wrapper could not acquire Blacksmith Testbox because this host is not authenticated. No code proof was skipped: focused local validation and the complete exact-head hosted CI run cover the touched core and test lanes.

@vincentkoc
vincentkoc merged commit 8acadc6 into openclaw:main Jul 29, 2026
131 of 137 checks passed
@vincentkoc

Copy link
Copy Markdown
Member

Merged via squash.

pull Bot pushed a commit to yann0001/openclaw that referenced this pull request Jul 29, 2026
* origin/main:
  refactor(channels): deduplicate ingress monitor shells (openclaw#115792)
  feat(ui): first-class chat audio/video player cards (openclaw#115764)
  fix(qa): use SQLite Matrix E2EE state (openclaw#115748)
  fix(agents): expose CLI tool summaries in terminal results (openclaw#115797)
  fix(plugins): recover user turns with scoped reply hooks (openclaw#114836)
  fix(mattermost): preserve private-channel origin identity (openclaw#115726)
  fix(line): mark durably accepted webhook deliveries (openclaw#115796)
  chore: update dependencies across workspace (openclaw#115677)
  fix(hooks): exclude outbound Gmail labels (openclaw#56720)
  feat: add Fish Audio S2.1 and local MLX speech (openclaw#115790)
  feat(agents): add per-session tool overrides (openclaw#115785)
  fix(plugins): stop repeated manifest realpath scans (openclaw#115783)
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 30, 2026
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 30, 2026
* origin/main:
  refactor(channels): deduplicate ingress monitor shells (openclaw#115792)
  feat(ui): first-class chat audio/video player cards (openclaw#115764)
  fix(qa): use SQLite Matrix E2EE state (openclaw#115748)
  fix(agents): expose CLI tool summaries in terminal results (openclaw#115797)
  fix(plugins): recover user turns with scoped reply hooks (openclaw#114836)
  fix(mattermost): preserve private-channel origin identity (openclaw#115726)
  fix(line): mark durably accepted webhook deliveries (openclaw#115796)
  chore: update dependencies across workspace (openclaw#115677)
  fix(hooks): exclude outbound Gmail labels (openclaw#56720)
  feat: add Fish Audio S2.1 and local MLX speech (openclaw#115790)
  feat(agents): add per-session tool overrides (openclaw#115785)
  fix(plugins): stop repeated manifest realpath scans (openclaw#115783)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: XS status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Gmail watcher regression: --exclude-labels dropped in buildGogWatchServeArgs

2 participants