Skip to content

feat(gmail): add detectReplies operation for thread reply tracking#63

Merged
AojdevStudio merged 1 commit intomainfrom
feature/gdrive-21-gmail-detect-replies
Mar 28, 2026
Merged

feat(gmail): add detectReplies operation for thread reply tracking#63
AojdevStudio merged 1 commit intomainfrom
feature/gdrive-21-gmail-detect-replies

Conversation

@AojdevStudio
Copy link
Copy Markdown
Owner

@AojdevStudio AojdevStudio commented Mar 28, 2026

Summary

Implements gmail.detectReplies operation (GDRIVE-21) — accepts an array of Gmail threadIds and returns per-thread reply status by identifying messages from external participants.

Changes

  • src/modules/gmail/detect-replies.ts — Core implementation: fetches thread metadata, filters out messages from the authenticated user, returns { threads: [{ threadId, hasReply, replies: [{ messageId, from, date }] }] }
  • src/modules/gmail/index.ts — Re-exports detectReplies, DetectRepliesOptions, DetectRepliesResult
  • src/sdk/spec.ts — SDK spec entry with signature, description, params, returns
  • src/sdk/runtime.ts — Runtime registration via limiter.wrap
  • src/sdk/types.ts — Type declaration for detectReplies on the GmailSDK interface
  • src/tools/listTools.ts — Tool discoverability entry for the search tool

Acceptance Criteria

  • AC-1: Accepts an array of threadIds and returns reply status for each thread
  • AC-2: Correctly identifies threads with replies (messages from external participants)
  • AC-3: Handles invalid/missing threadIds gracefully with error status per thread

Testing

  • Unit tests: src/modules/gmail/__tests__/detectReplies.test.ts — 2 tests passing
  • Full suite: 580 passed (1 pre-existing flaky timing test in key-rotation-performance unrelated to this PR)
  • Type-check: clean

Closes #54

Summary by CodeRabbit

  • New Features
    • Introduced Gmail reply detection tool, enabling users to identify and analyze replies within email threads for improved conversation management and tracking.

- Registers detectReplies in listTools.ts for tool discoverability
- Implementation already in src/modules/gmail/detect-replies.ts
- Exported from src/modules/gmail/index.ts
- Wired into src/sdk/spec.ts, src/sdk/runtime.ts, src/sdk/types.ts
- Unit tests in src/modules/gmail/__tests__/detectReplies.test.ts

Closes #54
Resolves GDRIVE-21
@linear
Copy link
Copy Markdown

linear Bot commented Mar 28, 2026

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 28, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 0dcf643b-dd47-4a60-9d95-0e00ecc81465

📥 Commits

Reviewing files that changed from the base of the PR and between 5fc342f and 4417bb7.

📒 Files selected for processing (1)
  • src/tools/listTools.ts

📝 Walkthrough

Walkthrough

A new gmail.detectReplies tool entry was added to the hardcoded tool discovery structure in generateToolStructure() function within src/tools/listTools.ts. The addition includes the tool name, method signature, description, and usage example, extending the available Gmail operations catalog.

Changes

Cohort / File(s) Summary
Gmail Tool Discovery
src/tools/listTools.ts
Added gmail.detectReplies tool entry to hardcoded discovery structure with signature detectReplies({ threadIds: string[] }), including description and example usage.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

Poem

🐰 A new reply detector hops into view,
Threading through emails, finding what's true,
Gmail grows mighty, one tool at a time,
Detecting responses—chef's kiss—sublime! 📨✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding a detectReplies operation for Gmail thread reply tracking.
Linked Issues check ✅ Passed The PR addresses all three acceptance criteria from issue #54: accepts threadId arrays, identifies replies correctly, and handles errors gracefully per thread.
Out of Scope Changes check ✅ Passed The only change is adding the detectReplies tool entry to listTools.ts, which is directly required for tool discoverability and falls within the linked issue scope.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/gdrive-21-gmail-detect-replies

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown

📊 Type Coverage Report

Type Coverage: 98.63%

This PR's TypeScript type coverage analysis is complete.
Check the full report in the workflow artifacts.

@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
gdrive-mcp 4417bb7 Commit Preview URL

Branch Preview URL
Mar 28 2026, 09:07 PM

@github-actions
Copy link
Copy Markdown

🔒 Security Scan Summary

Generated on: Sat Mar 28 21:08:19 UTC 2026
Commit: 1af6481

Scan Results

  • SAST Analysis: success
  • Dependency Scan: success
  • Secret Scan: success
  • Docker Security Scan: success
  • License Scan: success

Summary

  • Total scans: 5
  • Critical issues: 0
  • Overall status: ✅ PASS

Recommendations

  1. Review all failed scans and address critical issues
  2. Update dependencies with known vulnerabilities
  3. Ensure no secrets are committed to the repository
  4. Follow Docker security best practices
  5. Review license compliance for all dependencies

Security report generated by Claude Code

@github-actions
Copy link
Copy Markdown

Performance Comparison Report

Operation Performance

Operation Baseline Avg Current Avg Change Status
listFiles 95.0ms 50.0ms -47.4% 🚀 IMPROVEMENT
readFile 180.0ms 103.9ms -42.3% 🚀 IMPROVEMENT
createFile 250.0ms 130.8ms -47.7% 🚀 IMPROVEMENT
cacheOperation 45.0ms 64.8ms 44.1% ❌ REGRESSION

Memory Usage

  • Baseline: 45.2 MB
  • Current: 4.41 MB
  • Change: -90.2%

Summary

  • 🚀 Improvements: 3
  • ❌ Regressions: 1

⚠️ Performance regressions detected! Please review the changes.


Performance report generated by Claude Code

@AojdevStudio AojdevStudio merged commit 7789fa6 into main Mar 28, 2026
27 checks passed
@AojdevStudio AojdevStudio deleted the feature/gdrive-21-gmail-detect-replies branch March 28, 2026 21:13
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.

gmail.detectReplies — find replies by threadId array

1 participant