Add optional Xquik search backend#11
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 696917516a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const { tweets, users } = env.SEARCH_BACKEND === 'twitter' | ||
| ? await createTwitterClient(clientInfo).searchTweets(input.query, input.count) | ||
| : await searchTweetsWithXquik(input.query, input.count, { | ||
| apiKey: env.XQUIK_API_KEY ?? env.HERMES_TWEET_API_KEY, |
There was a problem hiding this comment.
Honor Hermes API key when XQUIK key is blank
apiKey is selected with nullish coalescing, so an empty XQUIK_API_KEY (common when .env contains XQUIK_API_KEY=) wins over a populated HERMES_TWEET_API_KEY. In that configuration, searchTweetsWithXquik receives "", fails the trim check, and every search_tweets call errors even though the alternate key is set as documented. Use a fallback that treats blank strings as missing (e.g., trim before choosing, or use a non-empty check) so the Hermes key path actually works.
Useful? React with 👍 / 👎.
Summary
SEARCH_BACKEND=xquik/hermes-tweetpath for thesearch_tweetsMCP toolValidation
npm ci --ignore-scripts --no-audit --no-fundnpm run buildnpm run check-typesnpm testgit diff --cached --checkNotes
npm pack --dry-run --jsonis not available on currentmainbecausepackage.jsonhas nonamefield; this PR does not change package metadata.