Repository navigation
Clarify MCP conversationId uniqueness guidance - #108
Conversation
Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
📝 WalkthroughWalkthroughUpdated MCP server documentation and descriptions across two files to specify that clients should generate and reuse short random Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
🔎 Preview deployed: https://kody-pr-108.kentcdodds.workers.dev Worker: Mocks:
|
There was a problem hiding this comment.
🧹 Nitpick comments (1)
packages/worker/src/mcp/index.ts (1)
35-35: Consider centralizing the repeatedconversationIdinstruction text.Lines 35, 54, 84, and 105 duplicate near-identical wording. Extracting a shared constant (like
conversationIdGuidance) would reduce doc drift risk.♻️ Suggested refactor
+const conversationIdGuidance = + "Optionally pass `conversationId` and reuse it on later related tool calls. Generate short random values that attempt to avoid collisions. If omitted, Kody generates a short random value and returns it in `structuredContent.conversationId`." ... -- Optionally pass `conversationId` and reuse it on later related tool calls. Generate short random values that attempt to avoid collisions. If omitted, Kody generates a short random value and returns it in `structuredContent.conversationId`. +- ${conversationIdGuidance}Also applies to: 54-54, 84-84, 105-105
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/worker/src/mcp/index.ts` at line 35, Extract the duplicated "conversationId" instruction string in packages/worker/src/mcp/index.ts into a single exported constant (e.g., conversationIdGuidance) and replace the repeated inline texts at the four occurrences with that constant; update any local references in the same module to use conversationIdGuidance and export it if other modules consume the guidance so callers still receive identical wording. Ensure the constant contains the exact original wording including mention of optional conversationId and memoryContext, and run/adjust any tests or callers that compare the text to reference the new constant instead of the hardcoded string.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@packages/worker/src/mcp/index.ts`:
- Line 35: Extract the duplicated "conversationId" instruction string in
packages/worker/src/mcp/index.ts into a single exported constant (e.g.,
conversationIdGuidance) and replace the repeated inline texts at the four
occurrences with that constant; update any local references in the same module
to use conversationIdGuidance and export it if other modules consume the
guidance so callers still receive identical wording. Ensure the constant
contains the exact original wording including mention of optional conversationId
and memoryContext, and run/adjust any tests or callers that compare the text to
reference the new constant instead of the hardcoded string.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: a0fc87d1-549c-4578-80d4-b8126d2872f4
📒 Files selected for processing (2)
packages/worker/src/mcp/index.tspackages/worker/src/mcp/tools/tool-call-context.ts
Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
Summary
conversationIdvalues that attempt to avoid collisionsconversationIdschema description with the top-level MCP server instructionsconversationIdguidance inpackages/worker/src/mcp/index.tsvia a shared exported constantTesting
npm run test:mcpSummary by CodeRabbit
Summary by CodeRabbit