Skip to content

feat: add conversation lookup by user#76

Merged
gnapse merged 5 commits intomainfrom
ernesto/find-dm-thread
Mar 11, 2026
Merged

feat: add conversation lookup by user#76
gnapse merged 5 commits intomainfrom
ernesto/find-dm-thread

Conversation

@gnapse
Copy link
Collaborator

@gnapse gnapse commented Mar 10, 2026

Adds a new tw conversation with <user-ref> command to find your exact 1:1 DM with a user.

The command also supports --include-groups to list any matching group conversations, pages through conversations/get so older DMs are found, and prints clean ambiguity errors without a stack trace while still exiting non-zero. By default it shows a compact conversation summary, and --snippet opts into the latest message preview.

tw conversation with "Henning"
tw conversation with "Henning" --include-groups
tw conversation with "Pedro Alves" --snippet
tw conversation with "Alex"   # prints matches, exits 1

Tests were added for the new resolution flow, including older paged conversations, and the Twist CLI skill content was updated to document the new command.

@doistbot doistbot requested a review from rfgamaral March 10, 2026 01:15
@gnapse gnapse self-assigned this Mar 10, 2026
@gnapse gnapse added the 👀 Show PR PR must be reviewed before or after merging label Mar 10, 2026
@gnapse gnapse changed the title Add conversation lookup by user feat: add conversation lookup by user Mar 10, 2026
@gnapse gnapse force-pushed the ernesto/find-dm-thread branch 2 times, most recently from 4acb7ad to 565dc9b Compare March 10, 2026 01:23
Copy link

@doist-bot doist-bot bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR introduces a helpful new tw conversation with <user-ref> command for quickly looking up 1:1 and group conversations, complete with solid test coverage and updated documentation. Reusing the existing conversation view output is a great approach that keeps the CLI consistent. A couple of minor adjustments are noted regarding the JSON and NDJSON formatters to ensure the --full flag is properly respected by passing the correct 'conversation' entity type.

Share FeedbackReview Logs

@gnapse gnapse marked this pull request as draft March 10, 2026 01:38
@gnapse gnapse removed the request for review from rfgamaral March 10, 2026 01:38
@gnapse gnapse force-pushed the ernesto/find-dm-thread branch 4 times, most recently from 2451bec to 4616609 Compare March 10, 2026 02:08
@gnapse gnapse marked this pull request as ready for review March 10, 2026 02:52
@doistbot doistbot requested a review from frankieyan March 10, 2026 02:53
@gnapse gnapse requested review from rfgamaral and removed request for frankieyan March 10, 2026 02:53
@gnapse gnapse force-pushed the ernesto/find-dm-thread branch from 4616609 to b2af243 Compare March 10, 2026 02:54
Copy link

@doist-bot doist-bot bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR introduces a helpful new tw conversation with command for easily locating 1:1 and group conversations, complete with robust ambiguity handling and test coverage. The addition provides great utility and improves the CLI's overall workflow for finding specific DMs. There is just one minor inconsistency noted regarding the --full flag, which currently acts as a no-op due to missing entity types in the JSON formatting calls and should be adjusted to properly filter or expand the output.

Share FeedbackReview Logs

Copy link
Member

@rfgamaral rfgamaral left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great addition 👏 (just left a few comments for your consideration)

Comment on lines +446 to +449
} catch (error) {
console.error((error as Error).message)
process.exit(1)
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other command handlers in this file let errors propagate rather than catching and calling process.exit(1). Should this follow the same pattern for consistency? 🤔

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’d keep the local catch for now. This command hit a real UX issue without it: lookup failures like ambiguous user refs bubbled up as a noisy exception trace. If we want consistency here, I think the right fix is a top-level error handler in src/index.ts, then we can remove ad hoc console.error(...); process.exit(1) patterns across commands in one pass. But I'd rather not do that here.

@gnapse gnapse requested a review from rfgamaral March 10, 2026 22:53
@gnapse gnapse force-pushed the ernesto/find-dm-thread branch from d13bfd9 to 7193054 Compare March 11, 2026 04:10
@gnapse gnapse merged commit 50ebe3b into main Mar 11, 2026
2 checks passed
@gnapse gnapse deleted the ernesto/find-dm-thread branch March 11, 2026 04:16
github-actions bot pushed a commit that referenced this pull request Mar 11, 2026
# [2.9.0](v2.8.0...v2.9.0) (2026-03-11)

### Features

* add conversation lookup by user ([#76](#76)) ([50ebe3b](50ebe3b))
@github-actions
Copy link

🎉 This PR is included in version 2.9.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released 👀 Show PR PR must be reviewed before or after merging

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants