Skip to content

fix(mcp): get_more_tools follows the conversation handle like any tool - #391

Open
lucasheriques wants to merge 3 commits into
mainfrom
lucas/mcp-virtual-tool-handle
Open

lucasheriques wants to merge 3 commits into
mainfrom
lucas/mcp-virtual-tool-handle

Conversation

@lucasheriques

@lucasheriques lucasheriques commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

💡 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_tools advertised no conversation_id, never took or minted a handle, and sent $mcp_parameters.

What changed

  • A get_more_tools listing advertises conversation_id, except to a handle-free client.
  • A report files under a handle the agent echoes. Otherwise it gets one minted and appended, through the same deliver_handle step as other tools.
  • $mcp_missing_capability carries $mcp_conversation_id and no longer sends $mcp_parameters.

💚 How did you test it?

  • spec/posthog/mcp/virtual_tool_session_spec.rb covers 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. rubocop and rake public_api:check pass.

📝 Checklist

  • All commits are signed (see Commit signing)
  • I reviewed the submitted code.
  • I added tests to verify the changes.
  • I updated the docs if needed.
  • No breaking change or entry added to the changelog.

If releasing new changes

  • Ran pnpm changeset to 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.

@lucasheriques
lucasheriques added this pull request to stack #393 November 25, 2026 19:37
@lucasheriques lucasheriques self-assigned this Nov 25, 2026
@lucasheriques lucasheriques changed the title lucas/mcp virtual tool handle fix(mcp): get_more_tools follows the conversation handle like any tool Nov 25, 2026
@lucasheriques
lucasheriques marked this pull request as ready for review November 25, 2026 19:38
@lucasheriques
lucasheriques requested a review from a team as a code owner November 25, 2026 19:38
@lucasheriques

Copy link
Copy Markdown
Contributor Author

@PostHog review

@posthog

posthog Bot commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

@lucasheriques PostHog Review is reviewing this pull request.

@veria-ai

veria-ai Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

PR overview

No security issues were found in this pull request.

Reviews

@github-actions

github-actions Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

posthog-ruby-async Compliance Report

Date: 2026-11-30T10:36:58.913044+00:00
Duration: 98764ms

✅ All Tests Passed!

47/47 tests passed


Capture Tests

✅ 30/30 tests passed

View Details
Test Status Duration
Format Validation.Event Has Required Fields ✅ 10ms
Format Validation.Event Has Uuid ✅ 105ms
Format Validation.Event Has Lib Properties ✅ 108ms
Format Validation.Distinct Id Is String ✅ 107ms
Format Validation.Token Is Present ✅ 107ms
Format Validation.Custom Properties Preserved ✅ 110ms
Format Validation.Event Has Timestamp ✅ 108ms
Format Validation.Non Utc Event Timestamp Is Converted To Utc ✅ 109ms
Retry Behavior.Retries On 503 ✅ 5311ms
Retry Behavior.Does Not Retry On 400 ✅ 2110ms
Retry Behavior.Does Not Retry On 401 ✅ 2109ms
Retry Behavior.Respects Retry After Header ✅ 8116ms
Retry Behavior.Implements Backoff ✅ 15717ms
Retry Behavior.Retries On 500 ✅ 5213ms
Retry Behavior.Retries On 502 ✅ 5212ms
Retry Behavior.Retries On 504 ✅ 5213ms
Retry Behavior.Max Retries Respected ✅ 15622ms
Deduplication.Generates Unique Uuids ✅ 119ms
Deduplication.Preserves Uuid On Retry ✅ 5212ms
Deduplication.Preserves Uuid And Timestamp On Retry ✅ 10418ms
Deduplication.Preserves Uuid And Timestamp On Batch Retry ✅ 5218ms
Deduplication.No Duplicate Events In Batch ✅ 111ms
Deduplication.Different Events Have Different Uuids ✅ 107ms
Compression.Sends Gzip When Enabled ✅ 106ms
Batch Format.Uses Proper Batch Structure ✅ 107ms
Batch Format.Flush With No Events Sends Nothing ✅ 4ms
Batch Format.Multiple Events Batched Together ✅ 110ms
Error Handling.Does Not Retry On 403 ✅ 2112ms
Error Handling.Does Not Retry On 413 ✅ 2112ms
Error Handling.Retries On 408 ✅ 5216ms

Feature_Flags Tests

✅ 17/17 tests passed

View Details
Test Status Duration
Request Payload.Request With Person Properties Device Id ✅ 107ms
Request Payload.Flags Request Uses V2 Query Param ✅ 108ms
Request Payload.Flags Request Hits Flags Path Not Decide ✅ 106ms
Request Payload.Flags Request Omits Authorization Header ✅ 107ms
Request Payload.Token In Flags Body Matches Init ✅ 107ms
Request Payload.Groups Round Trip ✅ 106ms
Request Payload.Groups Default To Empty Object ✅ 108ms
Request Payload.Disable Geoip False Propagates As Geoip Disable False ✅ 112ms
Request Payload.Disable Geoip Omitted Defaults To False ✅ 109ms
Request Payload.Flag Keys To Evaluate Contains Only Requested Key ✅ 107ms
Request Lifecycle.No Flags Request On Init Alone ✅ 3ms
Request Lifecycle.No Flags Request On Normal Capture ✅ 106ms
Request Lifecycle.Two Flag Calls Produce Two Remote Requests ✅ 110ms
Request Lifecycle.Mock Response Value Is Returned To Caller ✅ 107ms
Retry Behavior.Retries Flags On 502 ✅ 211ms
Retry Behavior.Retries Flags On 504 ✅ 259ms
Side Effect Events.Get Feature Flag Captures Feature Flag Called Event ✅ 111ms

@github-actions

github-actions Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

posthog-ruby-sync Compliance Report

Date: 2026-11-30T10:36:52.316595+00:00
Duration: 94319ms

✅ All Tests Passed!

47/47 tests passed


Capture Tests

✅ 30/30 tests passed

View Details
Test Status Duration
Format Validation.Event Has Required Fields ✅ 9ms
Format Validation.Event Has Uuid ✅ 6ms
Format Validation.Event Has Lib Properties ✅ 5ms
Format Validation.Distinct Id Is String ✅ 8ms
Format Validation.Token Is Present ✅ 6ms
Format Validation.Custom Properties Preserved ✅ 6ms
Format Validation.Event Has Timestamp ✅ 7ms
Format Validation.Non Utc Event Timestamp Is Converted To Utc ✅ 6ms
Retry Behavior.Retries On 503 ✅ 5319ms
Retry Behavior.Does Not Retry On 400 ✅ 2010ms
Retry Behavior.Does Not Retry On 401 ✅ 2011ms
Retry Behavior.Respects Retry After Header ✅ 8016ms
Retry Behavior.Implements Backoff ✅ 15343ms
Retry Behavior.Retries On 500 ✅ 5152ms
Retry Behavior.Retries On 502 ✅ 5118ms
Retry Behavior.Retries On 504 ✅ 5152ms
Retry Behavior.Max Retries Respected ✅ 15578ms
Deduplication.Generates Unique Uuids ✅ 18ms
Deduplication.Preserves Uuid On Retry ✅ 5114ms
Deduplication.Preserves Uuid And Timestamp On Retry ✅ 10320ms
Deduplication.Preserves Uuid And Timestamp On Batch Retry ✅ 5163ms
Deduplication.No Duplicate Events In Batch ✅ 18ms
Deduplication.Different Events Have Different Uuids ✅ 8ms
Compression.Sends Gzip When Enabled ✅ 5ms
Batch Format.Uses Proper Batch Structure ✅ 5ms
Batch Format.Flush With No Events Sends Nothing ✅ 3ms
Batch Format.Synchronous Capture Delivers Each Event Immediately ✅ 14ms
Error Handling.Does Not Retry On 403 ✅ 2007ms
Error Handling.Does Not Retry On 413 ✅ 2008ms
Error Handling.Retries On 408 ✅ 5157ms

Feature_Flags Tests

✅ 17/17 tests passed

View Details
Test Status Duration
Request Payload.Request With Person Properties Device Id ✅ 10ms
Request Payload.Flags Request Uses V2 Query Param ✅ 9ms
Request Payload.Flags Request Hits Flags Path Not Decide ✅ 8ms
Request Payload.Flags Request Omits Authorization Header ✅ 7ms
Request Payload.Token In Flags Body Matches Init ✅ 6ms
Request Payload.Groups Round Trip ✅ 6ms
Request Payload.Groups Default To Empty Object ✅ 5ms
Request Payload.Disable Geoip False Propagates As Geoip Disable False ✅ 5ms
Request Payload.Disable Geoip Omitted Defaults To False ✅ 6ms
Request Payload.Flag Keys To Evaluate Contains Only Requested Key ✅ 5ms
Request Lifecycle.No Flags Request On Init Alone ✅ 2ms
Request Lifecycle.No Flags Request On Normal Capture ✅ 5ms
Request Lifecycle.Two Flag Calls Produce Two Remote Requests ✅ 8ms
Request Lifecycle.Mock Response Value Is Returned To Caller ✅ 5ms
Retry Behavior.Retries Flags On 502 ✅ 109ms
Retry Behavior.Retries Flags On 504 ✅ 111ms
Side Effect Events.Get Feature Flag Captures Feature Flag Called Event ✅ 7ms

@posthog posthog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread lib/posthog/mcp/instrumentation.rb Resolved
stamphog[bot]

This comment was marked as outdated.

@github-actions

github-actions Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

SDK performance: posthog-ruby

Benchmarks 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
Test Measurement Before PR With PR Change Assessment
Capture and deliver events (32-byte payload, burst)
Shard: capture
Allocated memory per operation — — — unavailable; base:​ unsupported; head:​ unsupported; base:​ Ruby has no cumulative allocated-byte counter here; retained ObjectSpace bytes are not allocation volume.​; head:​ Ruby has no cumulative allocated-byte counter here; retained ObjectSpace bytes are not allocation volume.​
Capture and deliver events (4,096-byte payload, burst)
Shard: capture
Allocated memory per operation — — — unavailable; base:​ unsupported; head:​ unsupported; base:​ Ruby has no cumulative allocated-byte counter here; retained ObjectSpace bytes are not allocation volume.​; head:​ Ruby has no cumulative allocated-byte counter here; retained ObjectSpace bytes are not allocation volume.​
Capture and deliver events (32-byte payload, steady)
Shard: capture
Allocated memory per operation — — — unavailable; base:​ unsupported; head:​ unsupported; base:​ Ruby has no cumulative allocated-byte counter here; retained ObjectSpace bytes are not allocation volume.​; head:​ Ruby has no cumulative allocated-byte counter here; retained ObjectSpace bytes are not allocation volume.​
Capture and deliver events (4,096-byte payload, steady)
Shard: capture
Allocated memory per operation — — — unavailable; base:​ unsupported; head:​ unsupported; base:​ Ruby has no cumulative allocated-byte counter here; retained ObjectSpace bytes are not allocation volume.​; head:​ Ruby has no cumulative allocated-byte counter here; retained ObjectSpace bytes are not allocation volume.​
Queue an event (32-byte payload)
Shard: capture
Allocated memory per operation — — — unavailable; base:​ unsupported; head:​ unsupported; base:​ Background serialization has no public enqueue completion boundary; use completed-delivery workloads for process-wide allocation counts.​; head:​ Background serialization has no public enqueue completion boundary; use completed-delivery workloads for process-wide allocation counts.​
Queue an event (32-byte payload)
Shard: capture
Allocations per operation — — — unavailable; base:​ unsupported; head:​ unsupported; base:​ Background serialization has no public enqueue completion boundary; use completed-delivery workloads for process-wide allocation counts.​; head:​ Background serialization has no public enqueue completion boundary; use completed-delivery workloads for process-wide allocation counts.​
Queue an event (4,096-byte payload)
Shard: capture
Allocated memory per operation — — — unavailable; base:​ unsupported; head:​ unsupported; base:​ Background serialization has no public enqueue completion boundary; use completed-delivery workloads for process-wide allocation counts.​; head:​ Background serialization has no public enqueue completion boundary; use completed-delivery workloads for process-wide allocation counts.​
Queue an event (4,096-byte payload)
Shard: capture
Allocations per operation — — — unavailable; base:​ unsupported; head:​ unsupported; base:​ Background serialization has no public enqueue completion boundary; use completed-delivery workloads for process-wide allocation counts.​; head:​ Background serialization has no public enqueue completion boundary; use completed-delivery workloads for process-wide allocation counts.​
Evaluate all 10 flags
Shard: flags-scaling
Allocated memory per operation — — — unavailable; base:​ unsupported; head:​ unsupported; base:​ Ruby has no cumulative allocated-byte counter here; retained ObjectSpace bytes are not allocation volume.​; head:​ Ruby has no cumulative allocated-byte counter here; retained ObjectSpace bytes are not allocation volume.​
Evaluate all 100 flags
Shard: flags-scaling
Allocated memory per operation — — — unavailable; base:​ unsupported; head:​ unsupported; base:​ Ruby has no cumulative allocated-byte counter here; retained ObjectSpace bytes are not allocation volume.​; head:​ Ruby has no cumulative allocated-byte counter here; retained ObjectSpace bytes are not allocation volume.​
Evaluate all 1,000 flags
Shard: flags-scaling
Allocated memory per operation — — — unavailable; base:​ unsupported; head:​ unsupported; base:​ Ruby has no cumulative allocated-byte counter here; retained ObjectSpace bytes are not allocation volume.​; head:​ Ruby has no cumulative allocated-byte counter here; retained ObjectSpace bytes are not allocation volume.​
Evaluate one boolean flag
Shard: flags-single
Allocated memory per operation — — — unavailable; base:​ unsupported; head:​ unsupported; base:​ Ruby has no cumulative allocated-byte counter here; retained ObjectSpace bytes are not allocation volume.​; head:​ Ruby has no cumulative allocated-byte counter here; retained ObjectSpace bytes are not allocation volume.​
Evaluate a cohort-filtered flag
Shard: flags-single
Allocated memory per operation — — — unavailable; base:​ unsupported; head:​ unsupported; base:​ Ruby has no cumulative allocated-byte counter here; retained ObjectSpace bytes are not allocation volume.​; head:​ Ruby has no cumulative allocated-byte counter here; retained ObjectSpace bytes are not allocation volume.​
Evaluate a flag (early match)
Shard: flags-single
Allocated memory per operation — — — unavailable; base:​ unsupported; head:​ unsupported; base:​ Ruby has no cumulative allocated-byte counter here; retained ObjectSpace bytes are not allocation volume.​; head:​ Ruby has no cumulative allocated-byte counter here; retained ObjectSpace bytes are not allocation volume.​
Evaluate a flag (late match)
Shard: flags-single
Allocated memory per operation — — — unavailable; base:​ unsupported; head:​ unsupported; base:​ Ruby has no cumulative allocated-byte counter here; retained ObjectSpace bytes are not allocation volume.​; head:​ Ruby has no cumulative allocated-byte counter here; retained ObjectSpace bytes are not allocation volume.​
Evaluate a flag (no match)
Shard: flags-single
Allocated memory per operation — — — unavailable; base:​ unsupported; head:​ unsupported; base:​ Ruby has no cumulative allocated-byte counter here; retained ObjectSpace bytes are not allocation volume.​; head:​ Ruby has no cumulative allocated-byte counter here; retained ObjectSpace bytes are not allocation volume.​
Evaluate a property-filtered flag
Shard: flags-single
Allocated memory per operation — — — unavailable; base:​ unsupported; head:​ unsupported; base:​ Ruby has no cumulative allocated-byte counter here; retained ObjectSpace bytes are not allocation volume.​; head:​ Ruby has no cumulative allocated-byte counter here; retained ObjectSpace bytes are not allocation volume.​
Evaluate a regex-filtered flag
Shard: flags-single
Allocated memory per operation — — — unavailable; base:​ unsupported; head:​ unsupported; base:​ Ruby has no cumulative allocated-byte counter here; retained ObjectSpace bytes are not allocation volume.​; head:​ Ruby has no cumulative allocated-byte counter here; retained ObjectSpace bytes are not allocation volume.​
Evaluate a rollout flag
Shard: flags-single
Allocated memory per operation — — — unavailable; base:​ unsupported; head:​ unsupported; base:​ Ruby has no cumulative allocated-byte counter here; retained ObjectSpace bytes are not allocation volume.​; head:​ Ruby has no cumulative allocated-byte counter here; retained ObjectSpace bytes are not allocation volume.​
Evaluate a multivariate flag
Shard: flags-single
Allocated memory per operation — — — unavailable; base:​ unsupported; head:​ unsupported; base:​ Ruby has no cumulative allocated-byte counter here; retained ObjectSpace bytes are not allocation volume.​; head:​ Ruby has no cumulative allocated-byte counter here; retained ObjectSpace bytes are not allocation volume.​
Capture and deliver events (32-byte payload, burst)
Shard: capture
Allocations per operation 56.27 count/op 56.27 count/op No observed change Not flagged
Capture and deliver events (32-byte payload, burst)
Shard: capture
Time per operation 108.61 µs/op 108.67 µs/op <0.1% more time Not flagged
Capture and deliver events (32-byte payload, burst)
Shard: capture
Idle process memory (RSS) 28.36 MiB 28.38 MiB <0.1% more memory Not flagged
Capture and deliver events (32-byte payload, burst)
Shard: capture
Observed peak process memory (RSS) 31.14 MiB 31.16 MiB <0.1% more memory Not flagged
Capture and deliver events (32-byte payload, burst)
Shard: capture
Managed heap after settling 5.3 MiB 5.3 MiB <0.1% more memory Not flagged
Capture and deliver events (32-byte payload, burst)
Shard: capture
Process memory after settling (RSS) 31.14 MiB 31.16 MiB <0.1% more memory Not flagged
Capture and deliver events (32-byte payload, burst)
Shard: capture
Process CPU time per operation 19.08 µs/op 19.28 µs/op 1% more time Not flagged
Capture and deliver events (32-byte payload, burst)
Shard: capture
Lifetime peak process memory (RSS) 31.27 MiB 31.28 MiB <0.1% more memory Not flagged
Capture and deliver events (4,096-byte payload, burst)
Shard: capture
Allocations per operation 58.65 count/op 58.65 count/op No observed change Not flagged
Capture and deliver events (4,096-byte payload, burst)
Shard: capture
Time per operation 108.53 µs/op 108.52 µs/op <0.1% less time Not flagged
Capture and deliver events (4,096-byte payload, burst)
Shard: capture
Idle process memory (RSS) 33.21 MiB 33.2 MiB <0.1% less memory Not flagged
Capture and deliver events (4,096-byte payload, burst)
Shard: capture
Observed peak process memory (RSS) 42.31 MiB 42.28 MiB <0.1% less memory Not flagged
Capture and deliver events (4,096-byte payload, burst)
Shard: capture
Managed heap after settling 9.17 MiB 9.17 MiB <0.1% less memory Not flagged
Capture and deliver events (4,096-byte payload, burst)
Shard: capture
Process memory after settling (RSS) 38.67 MiB 39.15 MiB 1.3% more memory Not flagged
Capture and deliver events (4,096-byte payload, burst)
Shard: capture
Process CPU time per operation 26.82 µs/op 26.66 µs/op 0.6% less time Not flagged
Capture and deliver events (4,096-byte payload, burst)
Shard: capture
Lifetime peak process memory (RSS) 42.14 MiB 42.07 MiB 0.2% less memory Not flagged
Capture and deliver events (32-byte payload, steady)
Shard: capture
Allocations per operation 58.68 count/op 58.68 count/op No observed change Not flagged
Capture and deliver events (32-byte payload, steady)
Shard: capture
Time per operation 1.01 ms/op 1.01 ms/op <0.1% more time Not flagged
Capture and deliver events (32-byte payload, steady)
Shard: capture
Idle process memory (RSS) 28.37 MiB 28.36 MiB <0.1% less memory Not flagged
Capture and deliver events (32-byte payload, steady)
Shard: capture
Observed peak process memory (RSS) 30.36 MiB 30.36 MiB <0.1% more memory Not flagged
Capture and deliver events (32-byte payload, steady)
Shard: capture
Managed heap after settling 5.3 MiB 5.3 MiB <0.1% more memory Not flagged
Capture and deliver events (32-byte payload, steady)
Shard: capture
Process memory after settling (RSS) 30.36 MiB 30.36 MiB <0.1% more memory Not flagged
Capture and deliver events (32-byte payload, steady)
Shard: capture
Process CPU time per operation 30.76 µs/op 30.89 µs/op 0.4% more time Not flagged
Capture and deliver events (32-byte payload, steady)
Shard: capture
Lifetime peak process memory (RSS) 30.36 MiB 30.36 MiB <0.1% more memory Not flagged
Capture and deliver events (4,096-byte payload, steady)
Shard: capture
Allocations per operation 58.68 count/op 58.68 count/op No observed change Not flagged
Capture and deliver events (4,096-byte payload, steady)
Shard: capture
Time per operation 1.01 ms/op 1.01 ms/op <0.1% less time Not flagged
Capture and deliver events (4,096-byte payload, steady)
Shard: capture
Idle process memory (RSS) 33.3 MiB 33.24 MiB 0.2% less memory Not flagged
Capture and deliver events (4,096-byte payload, steady)
Shard: capture
Observed peak process memory (RSS) 40.96 MiB 40.96 MiB <0.1% less memory Not flagged
Capture and deliver events (4,096-byte payload, steady)
Shard: capture
Managed heap after settling 9.17 MiB 9.17 MiB <0.1% more memory Not flagged
Capture and deliver events (4,096-byte payload, steady)
Shard: capture
Process memory after settling (RSS) 40.96 MiB 40.46 MiB 1.2% less memory Not flagged
Capture and deliver events (4,096-byte payload, steady)
Shard: capture
Process CPU time per operation 36.28 µs/op 35.44 µs/op 2.3% less time Not flagged
Capture and deliver events (4,096-byte payload, steady)
Shard: capture
Lifetime peak process memory (RSS) 40.96 MiB 41.03 MiB 0.2% more memory Not flagged
Queue an event (32-byte payload)
Shard: capture
Caller-thread CPU time per operation 8.53 µs/op 8.54 µs/op 0.2% more time Not flagged
Queue an event (32-byte payload)
Shard: capture
Time per operation 8.52 µs/op 8.54 µs/op 0.2% more time Not flagged
Queue an event (4,096-byte payload)
Shard: capture
Caller-thread CPU time per operation 8.54 µs/op 8.54 µs/op <0.1% more time Not flagged
Queue an event (4,096-byte payload)
Shard: capture
Time per operation 8.54 µs/op 8.54 µs/op <0.1% more time Not flagged
Evaluate all 10 flags
Shard: flags-scaling
Allocations per operation 343.02 count/op 343.02 count/op No observed change Not flagged
Evaluate all 10 flags
Shard: flags-scaling
Time per operation 160.51 µs/op 159.2 µs/op 0.8% less time Not flagged
Evaluate all 10 flags
Shard: flags-scaling
Process CPU time per operation 160.51 µs/op 159.19 µs/op 0.8% less time Not flagged
Evaluate all 100 flags
Shard: flags-scaling
Allocations per operation 3,323.94 count/op 3,323.97 count/op <0.1% more Not flagged
Evaluate all 100 flags
Shard: flags-scaling
Time per operation 1.52 ms/op 1.52 ms/op <0.1% more time Not flagged
Evaluate all 100 flags
Shard: flags-scaling
Process CPU time per operation 1.52 ms/op 1.52 ms/op <0.1% more time Not flagged
Evaluate all 1,000 flags
Shard: flags-scaling
Allocations per operation 33,113.56 count/op 33,113.59 count/op <0.1% more Not flagged
Evaluate all 1,000 flags
Shard: flags-scaling
Time per operation 15.89 ms/op 15.42 ms/op 2.9% less time Not flagged
Evaluate all 1,000 flags
Shard: flags-scaling
Process CPU time per operation 15.88 ms/op 15.42 ms/op 2.9% less time Not flagged
Evaluate 1,000 flags under concurrent load
Shard: flags-memory
Idle process memory (RSS) 39.07 MiB 39.11 MiB <0.1% more memory Not flagged
Evaluate 1,000 flags under concurrent load
Shard: flags-memory
Observed peak process memory (RSS) 40.37 MiB 40.38 MiB <0.1% more memory Not flagged
Evaluate 1,000 flags under concurrent load
Shard: flags-memory
Managed heap after settling 8 MiB 8 MiB <0.1% more memory Not flagged
Evaluate 1,000 flags under concurrent load
Shard: flags-memory
Process memory after settling (RSS) 39.47 MiB 39.5 MiB <0.1% more memory Not flagged
Evaluate 1,000 flags under concurrent load
Shard: flags-memory
Lifetime peak process memory (RSS) 40.08 MiB 40.15 MiB 0.2% more memory Not flagged
Refresh 1,000 flag definitions
Shard: flags-memory
Idle process memory (RSS) 38.02 MiB 38.02 MiB No observed change Not flagged
Refresh 1,000 flag definitions
Shard: flags-memory
Observed peak process memory (RSS) 38.67 MiB 38.81 MiB 0.3% more memory Not flagged
Refresh 1,000 flag definitions
Shard: flags-memory
Managed heap after settling 9.5 MiB 9.5 MiB <0.1% more memory Not flagged
Refresh 1,000 flag definitions
Shard: flags-memory
Process memory after settling (RSS) 38.67 MiB 38.81 MiB 0.3% more memory Not flagged
Refresh 1,000 flag definitions
Shard: flags-memory
Lifetime peak process memory (RSS) 38.67 MiB 38.81 MiB 0.3% more memory Not flagged
Evaluate one boolean flag
Shard: flags-single
Allocations per operation 38 count/op 38 count/op No observed change Not flagged
Evaluate one boolean flag
Shard: flags-single
Time per operation 11.66 µs/op 11.84 µs/op 1.6% more time Not flagged
Evaluate one boolean flag
Shard: flags-single
Process CPU time per operation 11.66 µs/op 11.84 µs/op 1.5% more time Not flagged
Evaluate a cohort-filtered flag
Shard: flags-single
Allocations per operation 38 count/op 38 count/op No observed change Not flagged
Evaluate a cohort-filtered flag
Shard: flags-single
Time per operation 19.2 µs/op 19.38 µs/op 0.9% more time Not flagged
Evaluate a cohort-filtered flag
Shard: flags-single
Process CPU time per operation 19.2 µs/op 19.38 µs/op 0.9% more time Not flagged
Evaluate a flag (early match)
Shard: flags-single
Allocations per operation 55 count/op 55 count/op No observed change Not flagged
Evaluate a flag (early match)
Shard: flags-single
Time per operation 23.45 µs/op 23.43 µs/op <0.1% less time Not flagged
Evaluate a flag (early match)
Shard: flags-single
Process CPU time per operation 23.44 µs/op 23.42 µs/op <0.1% less time Not flagged
Evaluate a flag (late match)
Shard: flags-single
Allocations per operation 76 count/op 76 count/op No observed change Not flagged
Evaluate a flag (late match)
Shard: flags-single
Time per operation 33.06 µs/op 32.87 µs/op 0.6% less time Not flagged
Evaluate a flag (late match)
Shard: flags-single
Process CPU time per operation 33.06 µs/op 32.87 µs/op 0.6% less time Not flagged
Evaluate a flag (no match)
Shard: flags-single
Allocations per operation 67 count/op 67 count/op No observed change Not flagged
Evaluate a flag (no match)
Shard: flags-single
Time per operation 28.33 µs/op 28 µs/op 1.2% less time Not flagged
Evaluate a flag (no match)
Shard: flags-single
Process CPU time per operation 28.33 µs/op 28 µs/op 1.2% less time Not flagged
Evaluate a property-filtered flag
Shard: flags-single
Allocations per operation 34 count/op 34 count/op No observed change Not flagged
Evaluate a property-filtered flag
Shard: flags-single
Time per operation 13.65 µs/op 13.73 µs/op 0.6% more time Not flagged
Evaluate a property-filtered flag
Shard: flags-single
Process CPU time per operation 13.65 µs/op 13.73 µs/op 0.6% more time Not flagged
Evaluate a regex-filtered flag
Shard: flags-single
Allocations per operation 99 count/op 99 count/op <0.1% fewer Not flagged
Evaluate a regex-filtered flag
Shard: flags-single
Time per operation 40.44 µs/op 40.73 µs/op 0.7% more time Not flagged
Evaluate a regex-filtered flag
Shard: flags-single
Process CPU time per operation 40.43 µs/op 40.73 µs/op 0.7% more time Not flagged
Evaluate a rollout flag
Shard: flags-single
Allocations per operation 31 count/op 31 count/op No observed change Not flagged
Evaluate a rollout flag
Shard: flags-single
Time per operation 10.93 µs/op 10.84 µs/op 0.8% less time Not flagged
Evaluate a rollout flag
Shard: flags-single
Process CPU time per operation 10.93 µs/op 10.84 µs/op 0.9% less time Not flagged
Evaluate a multivariate flag
Shard: flags-single
Allocations per operation 37 count/op 37 count/op No observed change Not flagged
Evaluate a multivariate flag
Shard: flags-single
Time per operation 13.47 µs/op 13.52 µs/op 0.4% more time Not flagged
Evaluate a multivariate flag
Shard: flags-single
Process CPU time per operation 13.47 µs/op 13.52 µs/op 0.4% more time Not flagged

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 4b319f550cdeaf76b88d7dd679fc8065d3578cf1 → 2cea45dc80711f024bcc1b37c6e48833194e6e56.

Full report and diagnostics

102 metric rows; 102 rows shown in all results. Omitted or shortened data remain in comparison.json, including per-runner environments, resource limits, measurement methods, samples and checkpoints.

@lucasheriques
lucasheriques force-pushed the lucas/mcp-virtual-tool-handle branch from ed113a1 to 2f9aae2 Compare November 27, 2026 20:52
@stamphog
stamphog Bot dismissed their stale review November 27, 2026 20:52

A new stamphog review started for this PR — the fresh verdict replaces this approval.

@stamphog stamphog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@stamphog stamphog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@stamphog stamphog Bot removed the stamphog label Nov 27, 2026
@lucasheriques
lucasheriques force-pushed the lucas/mcp-virtual-tool-handle branch from 2f9aae2 to f814c88 Compare November 29, 2026 16:09
@lucasheriques

Copy link
Copy Markdown
Contributor Author

@PostHog review

@posthog

posthog Bot commented Nov 29, 2026

Copy link
Copy Markdown
Contributor

@lucasheriques PostHog Review is reviewing this pull request.

@posthog posthog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PostHog Review · Standard · reviewed f814c88: no findings.

@lucasheriques
lucasheriques force-pushed the lucas/mcp-virtual-tool-handle branch from f814c88 to 78e809c Compare November 29, 2026 19:31
@lucasheriques

Copy link
Copy Markdown
Contributor Author

@PostHog review

@posthog

posthog Bot commented Nov 30, 2026

Copy link
Copy Markdown
Contributor

@lucasheriques PostHog Review is reviewing this pull request.

@posthog posthog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PostHog Review · Standard · reviewed 78e809c: no findings.

stamphog[bot]

This comment was marked as outdated.

Base automatically changed from lucas/mcp-person-identity to main November 30, 2026 10:34
@stamphog
stamphog Bot dismissed their stale review November 30, 2026 10:34

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).
@lucasheriques
lucasheriques force-pushed the lucas/mcp-virtual-tool-handle branch from 78e809c to 2cea45d Compare November 30, 2026 10:34

@stamphog stamphog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@stamphog stamphog Bot removed the stamphog label Nov 30, 2026

This branch has not been deployed

No deployments
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.

1 participant