#6071: fix(cli): add --thread-id option to message read command
cli
Cluster:
Discord Message Enhancements
## Summary
Adds the `--thread-id` option to the `openclaw message read` CLI command to enable reading thread replies on Slack and Telegram.
## Problem
When trying to read Slack thread replies using the message tool or CLI, the `threadId` parameter wasn't being passed through. The CLI `read` command was missing the `--thread-id` option entirely.
## Investigation
Traced through the codebase and found:
1. ✅ `slack.actions.ts` correctly reads `threadId` from params and passes it to `handleSlackAction`
2. ✅ `handleSlackAction` correctly passes `threadId` to `readSlackMessages`
3. ✅ `readSlackMessages` correctly uses `conversations.replies` when `threadId` is set
4. ✅ The message tool schema includes `threadId` (from `buildSendSchema`)
5. ✅ Existing test `slack.actions.test.ts` confirms threadId forwarding works
6. ❌ CLI `read` command was missing `--thread-id` option
## Changes
- Added `--thread-id <id>` option to the `message read` CLI command
## Testing
- [x] Code follows existing patterns
- [x] Existing test `slack.actions.test.ts` verifies the action handler works correctly
- [ ] Manual e2e testing pending
## AI Disclosure
🤖 This PR was AI-assisted (created with Claude). The investigation and fix were done by tracing through the codebase to identify where `threadId` support was missing.
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
Adds a missing `--thread-id <id>` option to the `openclaw message read` CLI command so the CLI can forward `threadId` into the existing message action pipeline (which already supports reading Slack thread replies / Telegram thread context).
This change is localized to the CLI command registration alongside the existing message read flags (limit/before/after/around/include-thread).
<h3>Confidence Score: 4/5</h3>
- This PR is low risk and likely safe to merge.
- The change is a single CLI option addition that forwards an existing parameter; no behavioral changes occur unless the new flag is used. The only concern is user-facing clarity/consistency of the flag’s description across platforms.
- src/cli/program/message/register.read-edit-delete.ts (help text wording/consistency)
<!-- greptile_other_comments_section -->
<sub>(2/5) Greptile learns from your feedback when you react with thumbs up/down!</sub>
**Context used:**
- Context from `dashboard` - CLAUDE.md ([source](https://app.greptile.com/review/custom-context?memory=fd949e91-5c3a-4ab5-90a1-cbe184fd6ce8))
- Context from `dashboard` - AGENTS.md ([source](https://app.greptile.com/review/custom-context?memory=0d0c8278-ef8e-4d6c-ab21-f5527e322f13))
<!-- /greptile_comment -->
Most Similar PRs
#12199: fix(message): add threadId parameter to fetch schema for Slack thre...
by dbg-vanie · 2026-02-09
85.1%
#6509: fix(slack): pass threadId param in read action
by morningstar-daemon · 2026-02-01
83.4%
#14720: fix(slack): pass threadId in plugin read action (#14706)
by lailoo · 2026-02-12
82.9%
#22216: fix(slack): enable thread reply reading in slack extension plugin
by lan17 · 2026-02-20
82.6%
#5098: fix(slack): forward threadId for message.read
by galligan · 2026-01-31
80.6%
#2917: Slack: fix thread context + prevent reply spillover
by SocialNerd42069 · 2026-01-27
80.0%
#22874: fix(slack): preserve numeric threadId for message read
by HarryMWinters · 2026-02-21
78.8%
#5514: Slack: fix threadId ignored on read + thread_broadcast dropped
by SanderHelgesen · 2026-01-31
78.5%
#22485: fix(slack): use threadId from delivery context as threadTs fallback...
by dorukardahan · 2026-02-21
77.8%
#4749: fix: handle string thread IDs in queue drain for Slack
by nvonpentz · 2026-01-30
76.8%