Skip to content

perf(mcp)!: default to compact input schema advertisements - #5975

Merged
gensokyo-dev merged 9 commits into
mainfrom
perf/5861-mcp-input-catalog
Oct 21, 2026
Merged

gensokyo-dev merged 9 commits into
mainfrom
perf/5861-mcp-input-catalog

Conversation

@gensokyo-dev

@gensokyo-dev gensokyo-dev commented Oct 21, 2026 •

Copy link
Copy Markdown
Collaborator

Behavior

Refs #5861. Omitted REA_MCP_INPUT_SCHEMA_PROFILE now selects the existing compact advertisement. Explicit full retains complete input guidance and nested advertised constraints. All 213 tools, canonical input validation, output contracts and complete Evidence remain available. This changes the default advertisement and is marked breaking.

Catalog ownership distinguishes canonical full from default identity. Runtime identity requires an explicit catalog; CLI status honors parsed input/output profiles and readiness records the live server identity.

Evidence and validation

  • Twelve completed SDK tasks on unmodified Alpine ripgrep/Zellij, three alternating pairs each: whole-task estimates ~204.3k → ~51.7k tokens including input catalog, every argument and text reply. Independent ELF/zlib/JSON oracle; complete parent Evidence agrees. No stable wall/CPU/memory gain.
  • Six actual Codex questions answered correctly. Actual Codex token savings are not established; compact required an extra call for the broad question.
  • Latest-main integration on 8e3bf56e1 preserved complete Zellij Evidence and input catalog. Production CLI/MCP profile parity, full/compact workflows, canonical negative cases, static and documentation checks passed. Earlier incomplete or failed local attempts and unchanged-limit retries remain recorded.
  • Native Claude 2.1.296 persisted its ~55KB status; the existing inline-only verifier also fails on untouched baseline. Persisted statuses validate and match selected identities; full Claude end-to-end success is not claimed.

CI passed. Codex reviewed the final head with no findings; Greptile 5/5; all actionable threads resolved.

Reproduction, receipts and remaining limits.

Author readiness

Human owner: @gensokyo-dev

The following owner declarations are transcribed at the human owner's explicit standing instruction in this session. This records that instruction, not an independently witnessed human review by the agent.

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

Before merge

  • Concrete problem, focused outcome and related issue identified.
  • Existing advertisement profiles and validation ownership reused; no new provider or target authority.
  • Contracts, caller overrides, complete Evidence and selected catalog identity checked.
  • Required CI and actionable automated review findings completed.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-21T16:23:36.869301Z aa51e43 Manual request
ℹ️ 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.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e31d676468

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/config/mcpInputSchemaProfile.ts Resolved
@greptile-apps

greptile-apps Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The reviewed changes appear safe to merge.

Summary

The PR makes compact MCP input advertisements the default while preserving explicit full advertisements and canonical input checks.

  • MCP catalogs use compact input schemas by default, with full guidance still available.
  • Status reports identify the catalog selected by the server's profiles.
  • Cost records compare full and compact catalogs across complete MCP tasks.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Selected input profile] --> B{Explicit full?}
  B -->|Yes| C[Full input advertisement]
  B -->|No| D[Compact input advertisement]
  C --> E[Selected catalog identity]
  D --> E
  F[Selected output profile] --> E
  E --> G[MCP and CLI status]
  C --> H[Canonical input checks]
  D --> H
Loading

Reviews (6) · Last reviewed commit: "test(mcp): preserve canonical refusals i..." · Reviewed by Greptile

@gensokyo-dev
gensokyo-dev force-pushed the perf/5861-mcp-input-catalog branch from e31d676 to 99f29a1 Compare October 21, 2026 13:35
@gensokyo-dev

Copy link
Copy Markdown
Collaborator Author

@codex review

Please review the current head c8ed337, including the explicit full-presentation conformance cases and default-profile canonical refusal checks.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c8ed337568

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/serverIdentity.ts Resolved
@gensokyo-dev

Copy link
Copy Markdown
Collaborator Author

@codex review

Please review current head e25500d. The CLI profile issue is fixed by passing an explicit selected catalog at both runtime-identity callers; production CLI/MCP profile parity checks pass.

Retain explicit full and compact choices, canonical input validation and complete Evidence. Record real SDK and Codex task costs and their limitations.

BREAKING CHANGE: Omitted REA_MCP_INPUT_SCHEMA_PROFILE now selects compact advertised inputs. Set it to full to retain complete input guidance and nested advertised validation.
Use typed live metadata for readiness and selected profile parsers in the Claude verifier. Remove the ambiguous identity export and update its canonical, runtime, packaging and fixture consumers.
Preserve full advertisement assertions and canonical valid/invalid behavior in both profiles. Record serial resource-bounded checks and the incomplete early-stopped parallel attempt.
Document receipt capture and accounting, and append the log suffix to complete case directory names. Verify a real dotted-directory task and unchanged accounting for all original records.
@gensokyo-dev
gensokyo-dev force-pushed the perf/5861-mcp-input-catalog branch from e25500d to 2608ec5 Compare October 21, 2026 15:19
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

Reviewed commit: 2608ec5450

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@gensokyo-dev

Copy link
Copy Markdown
Collaborator Author

@codex review

Please review current head 3ce7945. Since the reviewed 2608 head, only two boundary tests and their validation records changed: call-direction coverage now checks canonical refusals under full/compact, and browser scenario checks full producer constraints while retaining default-profile public refusals. Five isolated suites (14 tests), static and documentation gates passed.

@gensokyo-dev
gensokyo-dev merged commit aa51e43 into main Oct 21, 2026
47 checks passed
@gensokyo-dev
gensokyo-dev deleted the perf/5861-mcp-input-catalog branch October 21, 2026 16:17
@github-actions github-actions Bot mentioned this pull request Oct 21, 2026
3 tasks done
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

Reviewed commit: aa51e43439

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

0xLLVEL added a commit to 0xLLVEL/rea that referenced this pull request Oct 21, 2026
Resolve conflicts with morluto#5975's compact input schema default:

- EvidenceMcpServer: keep the family-scoped catalog identity and use
  FULL_CATALOG_IDENTITY for the unscoped full profile.
- mcpDoctor tests: carry the default-compact case into the shared profile
  table, and keep both the compiled-digest probe and the CLI inventory check.
- Convert upstream's new positional createCatalogIdentity call sites
  (DirectAnalysisStatus, DEFAULT_CATALOG_IDENTITY, serverIdentity test) to the
  options object this branch introduced.

Committed with --no-verify: the merge resolution must preserve upstream bytes
in files the pre-commit oxlint --fix rewrite would otherwise change.
XiaoBinGan added a commit to XiaoBinGan/rea that referenced this pull request Oct 26, 2026
The Claude Code section still described the larger tools/list payload as the
default profile and told readers to add REA_MCP_INPUT_SCHEMA_PROFILE=compact to
shrink it. aa51e43 (perf(mcp)!: default to compact input schema
advertisements, morluto#5975) made compact the default; the full profile is now the
opt-in one.

Measured on 6.8.0 with 229 advertised tools and REA_MCP_OUTPUT_SCHEMA_PROFILE=off
so only input advertisements are counted: no environment variable and an
explicit compact profile produce byte-identical tools/list output (identical
SHA-256), while an explicit full profile is about 3.6x larger. So the
documented override no longer changes anything, and a registration that pins
full is now the case that needs the note.

Keep the historical 496 KB / 290 KB measurement, but attribute it to the
commit and profile pair it came from, and state that compact is the default.
XiaoBinGan added a commit to XiaoBinGan/rea that referenced this pull request Oct 26, 2026
The Claude Code section still described the larger tools/list payload as the
default profile and told readers to add REA_MCP_INPUT_SCHEMA_PROFILE=compact to
shrink it. aa51e43 (perf(mcp)!: default to compact input schema
advertisements, morluto#5975) made compact the default; the full profile is now the
opt-in one.

Measured on 6.8.0 with 229 advertised tools and REA_MCP_OUTPUT_SCHEMA_PROFILE=off
so only input advertisements are counted: no environment variable and an
explicit compact profile produce byte-identical tools/list output (identical
SHA-256), while an explicit full profile is about 3.6x larger. So the
documented override no longer changes anything, and a registration that pins
full is now the case that needs the note.

Keep the historical 496 KB / 290 KB measurement, but attribute it to the
commit and profile pair it came from, and state that compact is the default.
XiaoBinGan added a commit to XiaoBinGan/rea that referenced this pull request Oct 27, 2026
The Claude Code section still described the larger tools/list payload as the
default profile and told readers to add REA_MCP_INPUT_SCHEMA_PROFILE=compact to
shrink it. aa51e43 (perf(mcp)!: default to compact input schema
advertisements, morluto#5975) made compact the default; the full profile is now the
opt-in one.

Measured on 6.8.0 with 229 advertised tools and REA_MCP_OUTPUT_SCHEMA_PROFILE=off
so only input advertisements are counted: no environment variable and an
explicit compact profile produce byte-identical tools/list output (identical
SHA-256), while an explicit full profile is about 3.6x larger. So the
documented override no longer changes anything, and a registration that pins
full is now the case that needs the note.

Keep the historical 496 KB / 290 KB measurement, but attribute it to the
commit and profile pair it came from, and state that compact is the default.
XiaoBinGan added a commit to XiaoBinGan/rea that referenced this pull request Oct 27, 2026
The Claude Code section still described the larger tools/list payload as the
default profile and told readers to add REA_MCP_INPUT_SCHEMA_PROFILE=compact to
shrink it. aa51e43 (perf(mcp)!: default to compact input schema
advertisements, morluto#5975) made compact the default; the full profile is now the
opt-in one.

Measured on 6.8.0 with 229 advertised tools and REA_MCP_OUTPUT_SCHEMA_PROFILE=off
so only input advertisements are counted: no environment variable and an
explicit compact profile produce byte-identical tools/list output (identical
SHA-256), while an explicit full profile is about 3.6x larger. So the
documented override no longer changes anything, and a registration that pins
full is now the case that needs the note.

Keep the historical 496 KB / 290 KB measurement, but attribute it to the
commit and profile pair it came from, and state that compact is the default.
XiaoBinGan added a commit to XiaoBinGan/rea that referenced this pull request Oct 27, 2026
The Claude Code section still described the larger tools/list payload as the
default profile and told readers to add REA_MCP_INPUT_SCHEMA_PROFILE=compact to
shrink it. aa51e43 (perf(mcp)!: default to compact input schema
advertisements, morluto#5975) made compact the default; the full profile is now the
opt-in one.

Measured on 6.8.0 with 229 advertised tools and REA_MCP_OUTPUT_SCHEMA_PROFILE=off
so only input advertisements are counted: no environment variable and an
explicit compact profile produce byte-identical tools/list output (identical
SHA-256), while an explicit full profile is about 3.6x larger. So the
documented override no longer changes anything, and a registration that pins
full is now the case that needs the note.

Keep the historical 496 KB / 290 KB measurement, but attribute it to the
commit and profile pair it came from, and state that compact is the default.
morluto pushed a commit that referenced this pull request Nov 4, 2026
Compact input schemas are the default advertisement since #5975, and the
profile drops every property description. On 23 of the 31 tools with a
guided `detail` option, including inspect_artifact and inspect_macho,
`detail` is advertised as a bare complete|summary enum, so callers take the
complete default. On a universal macOS app that reply was about 699k
characters for inspect_artifact and 336k for inspect_macho, against about
4.4k and 3.2k with summary.

Keep the canonical description of a root `detail` property in the inline
compact input form. The reduced form already keeps first-level guidance, and
compact output schemas are unchanged. Advertised compact input schemas grow
from 127,616 to 133,358 bytes across 233 tools; the largest schema stays at
4,107 bytes, within the 13,312-byte budget.

The new boundary test compares `detail` guidance between the full and compact
tools/list and fails before the change.
@morluto morluto added area: mcp MCP server, transport, and tool registration performance Performance regressions, scaling limits, and bounded-resource work labels Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: mcp MCP server, transport, and tool registration performance Performance regressions, scaling limits, and bounded-resource work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants