moeru-ai/airi · error · Error
Tweet ID is empty. Please provide a tweet ID to retweet.
Error message
Tweet ID is empty. Please provide a tweet ID to retweet.
What it means
Thrown by handleRetweet when the parsed command's content is falsy — i.e. 'retweet:' was sent with no tweet id. This is a plain Error raised before retweet() is invoked, so no browser action runs.
Source
Thrown at integrations/twitter-services/src/adapters/airi-adapter.ts:178
}
private async handleLikeTweet(content: string): Promise<void> {
if (content) {
await this.twitterServices.tweet.likeTweet(content)
logger.main.log(`Liked tweet: ${content}`)
}
else {
throw new Error('Tweet ID is empty. Please provide a tweet ID to like.')
}
}
private async handleRetweet(content: string): Promise<void> {
if (content) {
await this.twitterServices.tweet.retweet(content)
logger.main.log(`Retweeted: ${content}`)
}
else {
throw new Error('Tweet ID is empty. Please provide a tweet ID to retweet.')
}
}
private async handleGetUser(content: string): Promise<boolean> {
if (content) {
const userProfile = await this.twitterServices.user.getUserProfile(content)
logger.main.log(`Retrieved profile for user: @${content}`)
// Return user info to the user
this.client.send({
type: 'input:text',
data: {
text: `User Profile for @${userProfile.username}:
Display Name: ${userProfile.displayName}
Bio: ${userProfile.bio || 'N/A'}
Followers: ${userProfile.followersCount || 0}
Following: ${userProfile.followingCount || 0}`,
},
})View on GitHub (pinned to 27111382b4)
Solutions
- Provide a non-empty tweet id (or status URL) after 'retweet:'.
- Validate content in the parser and reprompt for the id before dispatch.
- Have the adapter reply with usage guidance instead of throwing.
Example fix
// before
if (content) { await this.twitterServices.tweet.retweet(content) } else {
throw new Error('Tweet ID is empty. Please provide a tweet ID to retweet.')
}
// after
const id = content?.trim()
if (!id) {
this.client.send({ type: 'input:text', data: { text: 'Usage: retweet: <tweetId>' } })
return
} Defensive patterns
Strategy: validation
Validate before calling
const id = (content ?? '').trim()
if (!id) {
throw new Error('Tweet ID required')
}
await adapter.handleRetweet(id) Type guard
function isEmptyRetweetIdError(e: unknown): boolean {
return e instanceof Error && /tweet ID to retweet/i.test(e.message)
} Try / catch
try {
await this.handleRetweet(content)
} catch (e) {
if (e instanceof Error && /tweet ID to retweet/i.test(e.message)) {
this.client.send({ type: 'input:text', data: { text: 'Usage: retweet: <tweetId>' } })
} else throw e
} Prevention
- Validate parsed content for the 'retweet' command before dispatch.
- Always include the tweet id or status URL after the prefix.
- Reply with usage hints instead of throwing on empty input.
When it happens
Trigger: User sends 'retweet:' with nothing after the colon; parseTwitterCommand matched the 'retweet' prefix but content is empty/whitespace.
Common situations: User forgot to paste the tweet id/status URL; LLM truncated the payload; empty input forwarded by the AIRI input:text event.
Related errors
- Tweet text is empty. Please provide text to post.
- Search query is empty. Please provide a query to search.
- Tweet ID is empty. Please provide a tweet ID to like.
- Username is empty. Please provide a username to retrieve.
- Unknown X command: ${input}. Supported commands: "post tweet
AI-assisted analysis of moeru-ai/airi@27111382b4 (2026-08-12).
Data as JSON: /api/errors/f35276e015f63b8b.
Report an issue: GitHub.