Skip to content

fix(drive,gmail): pass through Drive filters + encode non-ASCII headers#266

Merged
steipete merged 4 commits intomainfrom
land/pr-260
Feb 15, 2026
Merged

fix(drive,gmail): pass through Drive filters + encode non-ASCII headers#266
steipete merged 4 commits intomainfrom
land/pr-260

Conversation

@steipete
Copy link
Copy Markdown
Collaborator

Supersedes #260 (cross-repo fork; conflict).

  • Drive: detect raw Drive API filter syntax and pass through; always append trashed = false unless explicitly constrained (predicate-only detection).
  • Gmail: RFC 2047-encode non-ASCII display names in From/To/Cc/Bcc/Reply-To.

Fixes #254, fixes #255.

Test: make ci

salmonumbrella and others added 4 commits February 15, 2026 03:52
…aders

Drive search now detects raw API filter syntax (field comparisons,
contains, membership, has) and passes it through instead of wrapping
in fullText contains. Plain-text searches always append trashed=false
to prevent false positives.

Gmail MIME now RFC 2047-encodes display names with non-ASCII characters
in From/To/Cc/Bcc/Reply-To headers using net/mail.

Fixes #254, fixes #255

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@steipete steipete merged commit 4272c68 into main Feb 15, 2026
7 checks passed
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 25b1fe338e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread internal/cmd/drive.go
driveSearchHasPattern = regexp.MustCompile(`(?i)\b(?:properties|appProperties)\b\s+has\s+\{`)
// Only treat as "already constrained" when the query contains a real trashed predicate,
// not just the word inside a quoted literal (e.g. "name contains 'trashed'").
driveTrashedPredicatePattern = regexp.MustCompile(`(?i)\btrashed\b\s*(?:=|!=)\s*(?:true|false)\b`)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Exclude quoted text when matching trashed predicates

driveTrashedPredicatePattern also matches trashed = true|false inside quoted literals, so a filter like name contains 'trashed = true' is treated as already constrained and buildDriveSearchQuery skips appending and trashed = false. In that scenario, trashed files are returned even though the user never set a trashed predicate, which regresses the default behavior this change is trying to preserve.

Useful? React with 👍 / 👎.

klodr pushed a commit to klodr/gogcli that referenced this pull request Apr 22, 2026
…rs (openclaw#266)

* fix(drive,gmail): pass-through filter queries and encode non-ASCII headers

Drive search now detects raw API filter syntax (field comparisons,
contains, membership, has) and passes it through instead of wrapping
in fullText contains. Plain-text searches always append trashed=false
to prevent false positives.

Gmail MIME now RFC 2047-encodes display names with non-ASCII characters
in From/To/Cc/Bcc/Reply-To headers using net/mail.

Fixes openclaw#254, fixes openclaw#255

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(drive,gmail): tighten trashed predicate detection

* chore(lint): silence goconst for auth services

* fix(auth): avoid goconst on services=all

---------

Co-authored-by: salmonumbrella <182032677+salmonumbrella@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 <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.

gog drive search returns folders but not files — gog drive ls works correctly UTF-8 double-encoding in From header display name

2 participants