Skip to content

feat(mcp): ask agents to report their model in server instructions - #4272

Open
riderx wants to merge 1 commit into
mainfrom
feat/mcp-analytics-model-instructions
Open

riderx wants to merge 1 commit into
mainfrom
feat/mcp-analytics-model-instructions

Conversation

@riderx

@riderx riderx commented Nov 29, 2026 •

Copy link
Copy Markdown
Member

Summary

Follow-up to #4235. In the first 24h of prod data (2026-11-27 15:21 → 2026-11-28 15:30 UTC) the hosted MCP emitted 136 $mcp_tool_call events (1:1 with Hosted MCP Tool Invoked), but 0 of 136 carried $mcp_llm_model, so PostHog's tool-quality-by-model view is empty.

The argument is advertised on all 85 tools and the pipeline works: a manual capgo_list_apps call with llm_model landed as $mcp_llm_model=claude-opus-5-5, $mcp_llm_model_source=self_reported. Agents just don't fill an optional argument that only the tool schema describes.

This adds one sentence to the initialize instructions asking agents to set llm_model on every Capgo tool call. Instructions stay within the 2048-byte Claude Code limit (1653 → ~1790 bytes).

Not included

Grouping sessions by Mcp-Session-Id: the stateless server never issues one, so clients never send it back. Doing that would require issuing (and then honoring) session IDs, which is out of scope here. Sessions stay one per HTTP request.

Test plan

  • tests/mcp-analytics.unit.test.ts: instructions ask for llm_model, and initialize returns them
  • tests/mcp-remote.unit.test.ts: instructions byte limit still holds
  • tsc --project tsconfig.backend.json, oxlint, eslint
  • After deploy: share of $mcp_tool_call with $mcp_llm_model set rises above 0

🤖 Generated with Claude Code

View guided diff Turn on auto-fix

In the first 24h of hosted MCP analytics, 0 of 136 tool calls carried
llm_model: agents skip optional arguments that only the tool schema
describes. The initialize instructions now ask them to set it on every
call, so PostHog can compare tool quality by model.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@riderx
riderx deployed to deepsec-pr November 29, 2026 04:08 — with GitHub Actions Active
@coderabbitai

coderabbitai Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 12 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: b45e1e7d-dae1-4f23-8c27-7bb2b50dfbcf
Commits

Reviewing files that changed from the base of the PR and between 00b594c and d085725.

Files selected for processing: 2

  • supabase/functions/_backend/mcp/protocol.ts
  • tests/mcp-analytics.unit.test.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

@codspeed

codspeed Bot commented Nov 29, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 43 untouched benchmarks
⏩ 2 skipped benchmarks1


Comparing feat/mcp-analytics-model-instructions (d085725) with main (00b594c)

Open in CodSpeed

Footnotes

  1. 2 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

@sonarqubecloud

Copy link
Copy Markdown

@riderx
riderx marked this pull request as ready for review November 29, 2026 04:15
@riderx

riderx commented Nov 29, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-29T04:15:56.119260Z d085725 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor
Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

This branch was successfully deployed

1 active deployment
deepsec-pr — d0857258 Deployed Nov 29, 2026 by riderx via Scan PR changes #12194
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