Add restore and mark-spam commands - #186
Open
code-monger-givenall wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds SDK-backed mailbox controls for restoring trashed topics and marking individual entries as spam.
Changes:
- Adds and registers both commands with validation and output handling.
- Adds request, validation, help, and command-surface tests.
- Updates user and agent documentation.
Tip
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
skills/hey/SKILL.md |
Adds agent guidance and examples. |
README.md |
Documents both commands and ID types. |
internal/cmd/topic_controls.go |
Implements both mailbox controls. |
internal/cmd/topic_controls_test.go |
Tests requests and validation. |
internal/cmd/root.go |
Registers the commands. |
internal/cmd/help.go |
Adds commands to curated help. |
internal/cmd/help_test.go |
Updates the help snapshot. |
API-COVERAGE.md |
Records SDK endpoint coverage. |
.surface |
Updates the CLI surface baseline. |
Suppressed comments (1)
internal/cmd/topic_controls.go:65
- The user-facing
hey mark-spam --helpoutput only showsShort, so it omits the PR's promised warning to confirm the exact entry ID before changing mailbox state; the annotation is limited to agent help. Add the warning to aLongdescription.
Use: "mark-spam <entry-id>",
Short: "Mark an email entry as spam",
Example: " hey mark-spam 12345",
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
code-monger-givenall
force-pushed
the
agent/restore-mark-spam-refresh
branch
from
August 19, 2026 18:40
9c7b956 to
3c4c687
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
This adds two mailbox controls already exposed by the current SDK:
hey restore <topic-id>returns a trashed topic to active mailhey mark-spam <entry-id>marks one email entry as spamThey are separate from the existing posting actions because the APIs use different IDs.
hey trashandhey spamtake box item IDs, while these commands take a topic ID and an entry ID respectively.Both commands validate positive IDs and reject list-only output formats before authentication or any HTTP request. Their help and agent guidance call out that they change mailbox state and require confirmation of the exact ID.
Tests
make checkNo live mailbox mutations were used to test this change.
Summary by cubic
Adds two mailbox controls:
hey restore <topic-id>returns a trashed topic to active mail, andhey mark-spam <entry-id>marks a single email entry as spam. Previously onlyhey trash/hey spamexisted and used box item IDs; these use topic and entry IDs to target the correct objects.Topics().Restore,Entries().MarkSpam) and adds API coverage for the corresponding PUT endpoints.--ids-only/--countbefore auth or any HTTP request; both commands change mailbox state and require the exact ID.root.go; adds shared helpers intopic_controls.gofor ID parsing, list-format rejection, and summarized output..surface, README examples, andskills/hey/SKILL.md.Written for commit 3c4c687. Summary will update on new commits.