Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Feb 9, 2026

Multiple open PRs (#26, #6) had unresolved review feedback blocking merge. This consolidates both changesets with all reviewer suggestions applied.

PR #26 — Runtime bug fixes

  • stderr redirect: console.logconsole.error to avoid corrupting MCP StdioServerTransport stdout. Uses unknown[] not any[].
  • Pagination: Wire up lastMentionId as since_id using URLSearchParams instead of string concatenation.
  • Response validation: Array.isArray() guard in fetchThread before calling parseThread, preventing crashes on unexpected API shapes.
  • Immutable sort: [...tweets].sort() instead of in-place tweets.sort() in parseThread; index signature uses unknown not any.
  • Bounded memory: Cap processedMentions Set at 10k with safe iterator pruning:
    const { value, done } = iter.next();
    if (done) break;
    this.processedMentions.delete(value);
  • Chronological ordering: Process mentions via [...newMentions].reverse() (oldest→newest) so Set insertion order matches time order for correct eviction.

PR #6 — Reply targeting

  • Add mentionPostId param to analyzeAndDecide() / simulateAnalysis() so replies target the mention post, not the conversation root.
  • Replace const data: any with unknown + explicit type cast for Grok API response parsing.

Files changed

src/index.ts, src/services/xapi.ts, src/services/agent.ts, src/services/grok.ts, src/examples.ts


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits February 9, 2026 18:11
…RLSearchParams, Array.isArray guard, safe iterators, reply targeting

Co-authored-by: groupthinking <[email protected]>
Copilot AI changed the title [WIP] Review and implement suggestions from pending PRs Consolidate review feedback from PRs #26 and #6 into single mergeable changeset Feb 9, 2026
Copilot AI requested a review from groupthinking February 9, 2026 18:16
@groupthinking
Copy link
Owner

Closing stale draft — superseded by cleanup/ready-to-use merge to main

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants