openclaw - 💡(How to fix) Fix [CLOSED] Fix gmail tool to always return proper email headers (From, To, Subject, Date) [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#59962Fetched 2026-04-08 02:38:16
View on GitHub
Comments
0
Participants
1
Timeline
3
Reactions
0
Participants
Timeline (top)
closed ×1locked ×1renamed ×1
RAW_BUFFERClick to expand / collapse

The gmail tool's 'read' action is inconsistently returning email headers. Sometimes it returns From/To/Subject/Date, other times it only returns the body text.

Observed Behavior

  • Email from [REDACTED]: Returned full headers including "From: [REDACTED] <[REDACTED]>"
  • Email ID 19d30e02c5ba85a0: Only returned body snippet, no headers at all
  • The 'list' and 'search' actions only return message IDs, no metadata

Expected Behavior

Every gmail read action should return:

  • From (name + email)
  • To (name + email)
  • Subject
  • Date
  • Body (text/html)
  • Thread ID
  • Labels

Impact

Can't properly triage emails without knowing who sent them. Makes the agent much less useful for email management.

Proposed Investigation

  • Check gws-gmail binary plugin implementation
  • Ensure consistent JSON output format
  • Consider adding a 'headers_only' flag for quick scanning

extent analysis

TL;DR

Investigate the gws-gmail binary plugin implementation to ensure consistent JSON output format for the 'read' action.

Guidance

  • Review the plugin's implementation to identify potential inconsistencies in handling email metadata.
  • Verify the JSON output format for the 'read' action to ensure it includes all required headers (From, To, Subject, Date) and body text.
  • Consider adding logging or debugging statements to the plugin to capture the email metadata processing and identify where the inconsistencies occur.
  • Evaluate the need for a 'headers_only' flag for quick scanning, as proposed, to potentially simplify the email processing and reduce inconsistencies.

Example

No specific code snippet can be provided without more context, but ensuring consistent JSON output might involve standardizing the email object structure, such as:

{
  "from": {
    "name": "",
    "email": ""
  },
  "to": {
    "name": "",
    "email": ""
  },
  "subject": "",
  "date": "",
  "body": {
    "text": "",
    "html": ""
  },
  "threadId": "",
  "labels": []
}

Notes

The investigation should focus on the gws-gmail binary plugin implementation and its JSON output format consistency. The issue might be related to how the plugin handles different types of emails or metadata.

Recommendation

Apply a workaround by modifying the gws-gmail binary plugin implementation to ensure consistent JSON output format for the 'read' action, as this seems to be the most direct approach to resolving the inconsistency in email header returns.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix [CLOSED] Fix gmail tool to always return proper email headers (From, To, Subject, Date) [1 participants]