Repository navigation
fix(mcp): get_more_tools follows the conversation handle like any tool - #391
lucasheriques wants to merge 3 commits into
Conversation
|
@PostHog review |
|
@lucasheriques PostHog Review is reviewing this pull request. |
posthog-ruby-async Compliance ReportDate: 2026-11-30T10:36:58.913044+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-30T10:36:52.316595+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.
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 |
ed113a1 to
2f9aae2
Compare
A new stamphog review started for this PR — the fresh verdict replaces this approval.
There was a problem hiding this comment.
Not approved — escalated to a human reviewer.
Add the stamphog label to request another review once you have addressed this.
The disclosed changes enter API-contract and analytics-write territory without current-head independent assurance; the older review's unspecified finding provides no concrete concern to verify. Request a current-head review from Rafael Audibert, another teammate, or an agent reviewer covering these areas before re-requesting.
- Author wrote 14% of the modified lines and has 11 merged PRs in these paths (familiarity MODERATE).
- Risky territory without independent assurance: Public API contracts — lib/posthog/mcp/instrumentation.rb changes the virtual tool's advertised input schema and adds conversation handles to its responses.; Data ingestion or write paths — lib/posthog/mcp/instrumentation.rb changes session attribution and captured properties for missing-capability analytics events.
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 @ 2f9aae2 · reviewed head 2f9aae2 |
There was a problem hiding this comment.
Not approved — escalated to a human reviewer.
Add the stamphog label to request another review once you have addressed this.
The disclosed changes enter public-contract and telemetry-write territory without qualifying current-head assurance; the older bot review and discussion summaries do not supply that assurance. Request a current-head review from Rafael Audibert, another teammate, or an agent reviewer covering these changes before re-requesting.
- Author wrote 14% of the modified lines and has 11 merged PRs in these paths (familiarity MODERATE).
- Risky territory without independent assurance: Public API contracts — lib/posthog/mcp/instrumentation.rb adds a conversation identifier to the virtual tool's advertised input schema and can append a minted identifier to its response.; Data ingestion or write paths — lib/posthog/mcp/instrumentation.rb changes missing-capability telemetry grouping to use conversation identifiers and removes captured parameters from that event.
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 @ 2f9aae2 · reviewed head 2f9aae2 |
2f9aae2 to
f814c88
Compare
|
@PostHog review |
|
@lucasheriques PostHog Review is reviewing this pull request. |
f814c88 to
78e809c
Compare
|
@PostHog review |
|
@lucasheriques PostHog Review is reviewing this pull request. |
The PR was retargeted to a different base branch, so the approved diff is no longer what was reviewed. Stamphog re-reviews automatically.
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).
78e809c to
2cea45d
Compare
There was a problem hiding this comment.
Not approved — escalated to a human reviewer.
Add the stamphog label to request another review once you have addressed this.
The disclosed changes enter risky territory, but all supplied reviews are on older commits and the author has neither owning-team assurance nor STRONG familiarity. Request a current-head review from Rafael Audibert or another teammate covering the tool contract and event attribution before re-requesting.
- Author wrote 14% of the modified lines and has 12 merged PRs in these paths (familiarity MODERATE).
- Risky territory without independent assurance: Public API contracts — lib/posthog/mcp/instrumentation.rb changes the virtual tool's advertised input schema and adds conversation handles to returned results.; Data ingestion or write paths — lib/posthog/mcp/instrumentation.rb changes missing-capability event session attribution and removes captured parameters from those events.
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 @ 2cea45d · reviewed head 2cea45d |
💡 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.