Repository navigation
fix(mcp): get_more_tools follows the conversation handle like any tool - #391
lucasheriques wants to merge 3 commits into
Conversation
sdk-specs "Optional events": a virtual tool gets every enabled injected argument except `context` and follows "Session identity" like any tool call; neither report event carries $mcp_parameters. - get_more_tools listings advertise `conversation_id` (left out for a handle-free client). A report files under an echoed handle, or mints and appends one when nothing else groups the call, through the same deliver_handle step as other tools. - $mcp_missing_capability carries $mcp_conversation_id and no longer sends $mcp_parameters. - ConversationId.resolve drops its virtual-tool exclusion. Tested: bundle exec rspec (2640 examples, 0 failures; the new virtual_tool_session_spec failed 4 of 5 first), rubocop clean, rake public_api:check passes.
/simplify on the stack: `minted ? nil : conversation_id` was repeated in four branches. Tested: bundle exec rspec spec/posthog/mcp (268 examples, 0 failures).
Tested: bundle exec rspec spec/posthog/mcp (no failures).
|
@PostHog review |
|
@lucasheriques PostHog Review is reviewing this pull request. |
PR overviewNo security issues were found in this pull request. Reviews
|
posthog-ruby-async Compliance ReportDate: 2026-11-25T19:39:27.565967+00:00 ✅ All Tests Passed!47/47 tests passed Capture Tests✅ 30/30 tests passed View Details
Feature_Flags Tests✅ 17/17 tests passed View Details
|
posthog-ruby-sync Compliance ReportDate: 2026-11-25T19:39:32.047606+00:00 ✅ All Tests Passed!47/47 tests passed Capture Tests✅ 30/30 tests passed View Details
Feature_Flags Tests✅ 17/17 tests passed View Details
|
There was a problem hiding this comment.
PostHog Review · Standard · reviewed ed113a1: 1 Should fix.
New pushes to this pull request won't start an automatic review. Comment @posthog review to review new changes.
See this review and its findings in PostHog Review. Comment @posthog review --deep for a Deep review. A Deep review takes longer and looks deeper than a Standard review.
There was a problem hiding this comment.
Approved.
The risky changes lack verified independent assurance: the current-head review reports a finding without supplying its details, so it cannot establish a concern-free review. Request review from Rafael Audibert or another teammate, and clarify or address the reported finding before re-requesting.
- Author wrote 14% of the modified lines and has 8 merged PRs in these paths (familiarity MODERATE).
- PostHog Review (Standard) reviewed the current head: 1 finding, posted on the PR.
- posthog[bot] reviewed the current head.
Gate mechanics and policy version
| Gate | Result | |
|---|---|---|
| prerequisites | ✓ | all clear |
| deny-list | ✓ | no deny categories matched |
| every_file_attested | ✓ | not a bot PR |
| size | ✓ | 85L, 3F substantive, 174L/7F incl. docs/generated/snapshots — within ceiling |
| tier | ✓ | T1-agent / T1d-complex (174L, 7F, cross-cutting, fix) |
| stamphog 2.9.1 | .stamphog/policy.yml @ ed113a1 · reviewed head ed113a1 |
SDK performance: posthog-rubyBenchmarks completed. No changes flagged for review. Flags require at least a 5% change in the median and all six pairs agreeing on direction. This is a noise filter, not proof of a performance change or a CI gate. View all results
Values are medians of paired measurements. Not flagged does not mean unchanged. Unavailable means a measurement could not be provided, not zero. Estimated allocation measurements retain their instrumentation uncertainty. RSS measures the whole process, not just SDK allocations; observed peaks are sampled checkpoints. Paired ranges in the diagnostics describe variability, not confidence intervals. Each shard uses its own runner; compare Before PR against With PR within a row, not across shards. Compared 102 metric rows; 102 rows shown in all results. Omitted or shortened data remain in |
💡 Motivation and Context
Stacked on #390. The sdk-specs "Optional events" requirement says a virtual tool "gets every enabled injected argument except
context" and "follows 'Session identity' like any tool call". It also says neither report event carries$mcp_parameters.get_more_toolsadvertised noconversation_id, never took or minted a handle, and sent$mcp_parameters.What changed
get_more_toolslisting advertisesconversation_id, except to a handle-free client.deliver_handlestep as other tools.$mcp_missing_capabilitycarries$mcp_conversation_idand no longer sends$mcp_parameters.💚 How did you test it?
spec/posthog/mcp/virtual_tool_session_spec.rbcovers advertising with anchoring on and off, minting, an echoed handle, and the missing$mcp_parameters. Four of its five examples failed first.bundle exec rspec: 0 failures.rubocopandrake public_api:checkpass.📝 Checklist
If releasing new changes
pnpm changesetto generate a changeset file🤖 Agent context
Autonomy: Human-driven (agent-assisted)
Claude Code (Opus) found this gap in a spec-alignment audit of #386 and checked it against sdk-specs main. It wrote the fix test-first. The pre-PR gate ran over the whole stack: /simplify, a comment pass, and an adversarial review by Opus and Sonnet. Every verified finding is fixed here with a test.