Skip to content

gmail thread get: print Cc and Bcc in text output - #1248

Closed
alexpriest wants to merge 1 commit into
openclaw:mainfrom
alexpriest:thread-get-cc
Closed

alexpriest wants to merge 1 commit into
openclaw:mainfrom
alexpriest:thread-get-cc

Conversation

@alexpriest

Copy link
Copy Markdown

gog gmail thread get text output prints From, To, Subject and Date for each message, but never Cc or Bcc. On a thread where people are cc'd, they're invisible, so it looks as if they were dropped from the conversation.

This is the same gap #332 fixed for gmail get (in #343). thread get was missed.

Change: print Cc: and Bcc: after To: when the header is present. Empty headers are skipped, so threads without them look the same as before. JSON output is unchanged.

Test: the thread get plain-output test fixture now has a Cc header, and asserts the Cc: line appears and no empty Bcc: line is printed. go test ./internal/cmd passes.

Text output listed only To, so cc'd recipients were invisible and a
reader could conclude people had been dropped from a thread.
@clawsweeper

clawsweeper Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal priority bug or improvement with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 22, 2026
@clawsweeper

clawsweeper Bot commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge.

What this changes

This PR prints nonempty Cc and Bcc headers after To in Gmail thread text output.

Example: Thread t1 contains a message addressed to b@example.com with Cc c@example.com and no Bcc header.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) The implementation is narrow and appears correct, but test-only evidence does not satisfy the external-PR behavior-proof gate.
Proof confidence 🧂 unranked krab (1/6) Real behavior proof is necessary before merge. See Before merge.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: People copied on a conversation are invisible in thread text output, making the recipient list appear incomplete.
Reason: Displaying headers already returned by Gmail restores useful recipient information consistently with the existing single-message command.

Merge readiness

⛔ Blocked before merge - 1 item remains

Keep open: current main still omits thread recipient headers, and this PR provides a focused repair with no identified code defect.

Priority: P2
Reviewed head: 06d257181a8d4e76eee7f2052c1f11da804ac0e1

Before merge

  • Add real behavior proof - The added assertions exercise the real command dispatcher and thread renderer against an httptest Gmail response, and the body reports package tests passing; no supplied artifact shows the shipped CLI rendering recipient headers from a real Gmail thread after the fix. The contributor should provide terminal output or a screenshot covering present Cc/Bcc and absent headers, with addresses, IPs, keys, and non-public endpoints redacted. After adding proof, update the PR body, then request a new review with @clawsweeper re-review. The PR author or someone with repository write access can request it.

Findings

None.

Tests

  • Missing end-to-end proof: Supply a redacted real CLI run showing present Cc and Bcc headers and omission of absent headers; a base-fail/head-pass regression run has not been shown.
Agent review details

How this fits together

The Gmail thread command fetches full messages through the authenticated Gmail client and renders their headers and bodies as text or JSON.

flowchart LR
  A[Gmail thread get command] --> B[Authenticated Gmail client]
  B --> C[Full thread messages]
  C --> D[JSON output]
  C --> E[Header lookup and optional sanitization]
  E --> F[Text output]
Loading

Technical review

Best possible solution:

Retain the small addition to the existing thread renderer and record the user-visible fix in Unreleased when landing.

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

The current-main renderer deterministically omits Cc and Bcc even when Gmail returns them; this was verified in source without executing target code.

Is this the best way to solve the issue?

The patch is the smallest complete repair: it reuses case-insensitive header lookup and optional sanitization, skips empty values, and leaves the JSON branch untouched.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against ea582609ec6e.

Provenance checked

  • Thread header rendering and sanitization keeps the original intent (33284f0: The historical commit added sanitized content reads; this PR uses its existing header closure for both added headers.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 33284f0 adds internal/cmd/gmail_thread.go:140 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 33284f03bbdd; files: internal/cmd/gmail_thread.go)
  • salmonumbrella: Raw commit 0866dae adds internal/cmd/gmail_thread.go:134 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 0866dae212d7; files: internal/cmd/gmail_thread.go)

Review metrics

Metric Value Why it matters
Change size Production +5 lines; tests +7 lines; no deletions The growth directly implements conditional recipient display and extends an existing command-path fixture.

Labels

Label changes:

  • add P2: Missing recipient information can mislead users reading a thread, while JSON retains the headers and delivery is unaffected.
  • add rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Label justifications:

  • P2: Missing recipient information can mislead users reading a thread, while JSON retains the headers and delivery is unaffected.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Provide redacted terminal evidence of the changed recipient-header output through the shipped CLI.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed October 22, 2026, 2:55 PM ET / 18:55 UTC.

steipete added a commit that referenced this pull request Oct 23, 2026
Preserve Gmail search results and reduce retry work: back off on recognized 403 rate limits, retain response bodies and read errors, cancel remaining detail fetches after a failure, and keep quoted operators out of label filters. Include nonempty Cc/Bcc in thread text and isolate reply/forward header direction without altering plain text or quoted HTML.

Preserve requested false booleans in Drive and Sites list JSON for grouped fields, slash paths, and wildcards while leaving conditional fields omitted.

Reproduces and incorporates #1242, #1246, #1247, #1248, and #1250; addresses #1241. Focused regression tests and independent Codex review pass.

Co-authored-by: Serghei <xyrolle@gmail.com>
Co-authored-by: Sebastien Tardif <SebTardif@ncf.ca>
Co-authored-by: Kit <kit@alexpriest.com>
Co-authored-by: Malo Bourgon <mbourgon@gmail.com>
@steipete

Copy link
Copy Markdown
Collaborator

Thanks for this fix. Incorporated into #1253 with contributor credit and a changelog acknowledgment: including nonempty Cc and Bcc headers in thread text.

The regression was reproduced before the change. Focused regression tests, the full remote make ci gate, and independent Codex review passed. Exact-head CI: https://github.com/openclaw/gogcli/actions/runs/39888593907. Landed as 60ae623da5b5955b5e3127d8bb9d5f63d23f8397. Closing this PR because the fix is now on main.

@steipete steipete closed this Oct 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal priority bug or improvement with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants