Skip to content

perf(eval): measure MCP catalog usage through the real Codex harness - #9035

Merged
gensokyo-dev merged 6 commits into
mainfrom
perf/mcp-catalog-eval
Nov 5, 2026
Merged

gensokyo-dev merged 6 commits into
mainfrom
perf/mcp-catalog-eval

Conversation

@gensokyo-dev

@gensokyo-dev gensokyo-dev commented Nov 5, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Add npm run eval:mcp-catalog to measure actual Codex usage with no-server/all-tools/selected-tools controls, retained per-response usage and guarded process-family resources.

The old runner could inherit repository instructions through its output directory, and its legacy code-mode switches did not control the current host. Execution now uses an external disposable profile, explicit host settings, required MCP startup, the driver artifact lock, a pinned matrix runtime, runtime drift checks and actionable failure reporting. The default uses the working host; disabled-host errors remain invalid even when the model returns the marker.

Procedure and pinned measurements: nine valid loading samples had a +3-token paired median within framing variation. Nine disabled-host controls correctly failed. A real semver package question passed the same three source-field oracle in both arms: 271,084 / 160,438 cumulative input tokens, including discovery and continuations. This is a single-task pilot, not a general performance advantage.

Scope and contracts

  • Development-only evaluation; production CLI/MCP contracts, catalog defaults and Evidence semantics are unchanged. No new provider capability requires a scope decision.
  • Reuses the retained agent runner, token-count parser and systemd resource observer. Runs Codex/REA, reads static artifacts and creates/removes private profiles; contacts the configured model backend.
  • Full raw traces stay local; committed receipts retain usage, source/runtime hashes, resource counters, failures and oracle outcomes. No qualified eager/native or other-client comparison and no billing reconciliation.

The matrix binds its catalog receipt and every valid pair to one shared runtime fingerprint, with freshness checks that stop further model calls after a rebuild. Observation collection retains usage, cleanup and resource facts independently before grading; stage-specific errors preserve partial results.

Validation performed

  • npm run check:fast — passed.
  • npm run docs:check — passed, including 9 README consistency checks.
  • node scripts/run-typescript.mjs -p tsconfig.build.json followed by python3 scripts/run-python-tests.py --analysis-efficiency — 102 passed.
  • Real Codex CLI 0.165.0 / requested gpt-6.1-sol: loading controls, three-cell supported-default smoke and two completed package tasks; cleanup and runtime identity verified, no OOM/resource stop.
  • Reassessed all 18 retained real control traces with the final collector: identical verdicts/token comparisons; failed samples retain usage, cleanup and resources. Boundary regressions cover changed builds between trials and catalog/manifest mismatch.
  • Production mcp doctor --json — healthy; 234 tools, 6 prompts, matching identity, successful binary_session.
  • Focused formatting and git diff --check — passed.

CodeQL scope assessment

Default setup's local-input queries flag four caller-selected filesystem paths and the command argument vector in the development harness (check annotations). Sources are local operator argv/CODEX_HOME, not target contents or remote requests. The sinks are private profile creation, read-only fingerprinting, and explicitly selected Codex invocation via an argv list without a shell. This CLI runs with the operator's existing permissions and exposes no privileged/service entrypoint. These are intended inputs, rather than an injection or path-escape defect to fix by restricting caller choices. The repository's documented production CodeQL scope excludes test support, but advanced setup is inactive; no scanning configuration or alert state was changed.

Author readiness

Human owner: @gensokyo-dev (author is exempt from the declaration under CONTRIBUTING.md).

  • 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.

@chatgpt-codex-connector

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 ⚠️ Failed 2026-11-05T17:18:30.342824Z
We couldn’t complete this review. Comment @codex review to try again.
7dbc80f PR opened
ℹ️ 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

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@greptile-apps

greptile-apps Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The reviewed changes appear safe to merge; both previous findings are fixed and no new blocking issue was found.

Summary

Adds a real Codex catalog evaluation lane with no-server, all-tools, and selected-tools controls.

  • Codex trials compare catalog setups and report observed usage.
  • Codex trials use isolated profiles and check the runtime they measure.

Reviews (2) · Last reviewed commit: "fix(eval): pin matrix identity and retai..." · Reviewed by Greptile

profile = Path(tempfile.mkdtemp(prefix='profile-', dir=args.output))
# Output artifacts may live inside a checkout. Execution must not: Codex
# discovers ancestor AGENTS.md and skills independently of its user config.
profile_parent = (args.profile_parent or source_auth_home.parent / '.cache' / 'rea-agent-trials').resolve()
profile_parent = (args.profile_parent or source_auth_home.parent / '.cache' / 'rea-agent-trials').resolve()
if any(profile_parent.is_relative_to(root.resolve()) for root in [repository, driver_repository]):
raise ValueError('--profile-parent must be outside the runtime and driver checkouts')
profile_parent.mkdir(parents=True, exist_ok=True, mode=0o700)
if any(profile_parent.is_relative_to(root.resolve()) for root in [repository, driver_repository]):
raise ValueError('--profile-parent must be outside the runtime and driver checkouts')
profile_parent.mkdir(parents=True, exist_ok=True, mode=0o700)
profile = Path(tempfile.mkdtemp(prefix='profile-', dir=profile_parent))
command.extend(['--enabled-tools', str(output / 'selected-tools.json')])
print(json.dumps({'starting': cell}), flush=True)
with directory.with_suffix('.log').open('w') as log:
outcome = subprocess.run(command, stdout=log, stderr=subprocess.STDOUT, check=False)

def file_digest(path):
digest = hashlib.sha256()
with path.open('rb') as data:
@gensokyo-dev
gensokyo-dev merged commit 8084916 into main Nov 5, 2026
51 of 53 checks passed
@gensokyo-dev
gensokyo-dev deleted the perf/mcp-catalog-eval branch November 5, 2026 18:25
@morluto morluto added area: mcp MCP server, transport, and tool registration performance Performance regressions, scaling limits, and bounded-resource work labels Nov 22, 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.

4 participants