Skip to content

fix(tier3): preserve native Codex MCP server identity - #731

Merged
rng1995 merged 21 commits into
NVIDIA:mainfrom
Afloat16:fix/preserve-codex-mcp-identity
Nov 23, 2026
Merged

rng1995 merged 21 commits into
NVIDIA:mainfrom
Afloat16:fix/preserve-codex-mcp-identity

Conversation

@Afloat16

@Afloat16 Afloat16 commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Native Codex JSONL mcp_tool_call items record the MCP server separately from the tool. Reconstruction currently keeps only the tool name. This loses evidence identity: a generic lookup or task call is not recognized as MCP work, and filesystem-root calls cannot use the existing server-aware efficiency policy.

Preserve the recorded identity as mcp__server__tool. Keep names already qualified for the same server unchanged, let an explicit server remain authoritative when the tool contains a different prefix, and retain existing behavior when no usable server is recorded. Arguments and observations are unchanged. Update the report and live-evaluation documentation to describe this native-log path precisely.

The native item shape is defined in the Codex TypeScript SDK.

Integration refresh — 2026-11-19

Head feef31260e0f81a5969dd2f65ceec553d6b0d6be merges main ac9fc0ef4999ee5eb86eae27ec3a83c880891c92 and resolves the Unreleased changelog conflict by retaining both entries. The existing MCP identity patch is preserved exactly: its changes in checks.py merge with the upstream updates, and all other PR code, test and documentation blobs are unchanged. All non-PR files match that main revision.

On this merge candidate, the native Codex MCP identity and log-conversion modules pass 64 tests with locked Python 3.13.11 dependencies, and full source/test Ruff passes. Earlier validation below applies to the original change; this refresh does not claim a full-suite rerun.

Verification

The initial six identity/scoring regressions fail on unchanged base 8fe9723. Tests cover generic MCP tools, filesystem-root and scoped paths, non-filesystem servers, absent server metadata, same-server qualified names, and conflicting prefixes. The latter verifies that a tool name cannot override the recorded filesystem server.

python -m pytest tests/tier3/test_codex_mcp_identity.py tests/tier3/test_log_converters.py tests/tier3/test_tool_productivity.py tests/tier3/test_root_search_efficiency.py -q — 517 passed.

  • I am familiar with the Contributing Guidelines
  • Added or updated focused tests
  • Updated documentation for user-visible changes (Unreleased changelog)
  • Ran make lint equivalent: python -m ruff check src tests
  • Full make test did not complete successfully in this environment (see below)
  • Ran make build equivalent: python -m build (wheel and sdist)
  • Did not add credentials, private datasets, or proprietary benchmark content

The unchanged base 8fe9723, tested with python -m pytest -x -q, stops after 456 passed and 19 deselected at tests/ci/test_gateway_benchmark_workflows.py::test_gitlab_enriched_tier1_applies_the_keyless_job_baselines[extra0-expected0]. The sandbox has no /tmp, while that workflow fixture explicitly invokes mktemp -d /tmp/skillevaluator-enriched-tier1.XXXXXX. The same test fails for the same reason on the retry branch. No full-suite pass is claimed.

Release Impact

  • No user-visible release note needed
  • Updated CHANGELOG.md

Upstream integration

This branch includes upstream 64b237f0 and its documentation reorganization. The Codex MCP scoring explanation now lives in tier3-grading.mdx; the task-focused Tier 3 entry page matches upstream, and the Reports explanation retains the updated links. All seven original production and regression-test file blobs are unchanged.

The post-merge selection passed 494 tests, including the MCP regressions, CI configuration and packaging checks. One additional reporting test (test_validate_tier3_writes_the_same_report_pair) fails locally at the same assertion on unchanged upstream 64b237f0; a clean pass for that broader selection is not claimed. Full-repository Ruff and isolated wheel/sdist builds pass. The pinned Fern 5.121.0 documentation check returns zero errors with one warning: authenticated missing-redirect checks are skipped without a Fern login. Independent review verified the final tree and documentation migration.

Signed-off-by: Afloat <ShuffleMonkey@163.com>
Signed-off-by: Afloat <ShuffleMonkey@163.com>
Signed-off-by: Afloat <ShuffleMonkey@163.com>
Signed-off-by: Afloat <ShuffleMonkey@163.com>

@rng1995 rng1995 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks, @Afloat16, for preserving native Codex MCP identity through reconstruction and scoring. The earlier server-boundary issue is addressed, but I independently reproduced the remaining label-truncation issue: at 257 characters, the display label is truncated before metadata validation, so a server beginning project__filesystem can be incorrectly credited to the separately declared project server while evidence is marked complete. The 256-character control retains the correct server. Please validate the full recorded identity before applying display bounds.

Validation: 1,636 focused tests passed across MCP identity, log reconstruction, plugin signals, native Codex normalization, productivity/root-search policy and shared ATIF adapters. The boundary replay above still reproduces the outstanding issue; this review adds no duplicate inline thread.

rng1995 and others added 3 commits November 17, 2026 09:58
Address the outstanding review with focused regression coverage and
synchronize current main, keeping the release note under Unreleased.

Signed-off-by: Afloat <ShuffleMonkey@163.com>
Retain the latest release notes and merged fixes alongside this change.

Signed-off-by: Afloat <ShuffleMonkey@163.com>

@chrisknvidia chrisknvidia left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

One scope point on the docs, and two behaviour changes worth a changelog line.

The new tier3-grading.mdx / reports.mdx text reads as if Codex MCP calls are now recognised in general. As far as I can trace it, the recorded identity only exists when the trajectory is rebuilt from codex.txt (missing or empty trajectory.json) or through tier3 import-traces; the verifier loads Harbor's trajectory.json first, and Harbor's Codex trajectory still carries the bare tool name, so the normal graded path is unchanged by this PR. Please scope those sentences to the rebuilt-log case and keep the statement that Codex MCP calls in the graded Harbor trajectory are not yet recognised.

In the rebuilt path there are two changes beyond the title that the description does not mention: MCP tools whose bare name is a planning name (task, update_plan, spawn_agent, wait) move from "not counted" to productive, and an MCP tool literally named skill no longer counts as a Skill-tool activation (previously a false positive). tier3 import-traces candidates for Codex exports also now show mcp__server__tool labels. All defensible, but they should be stated.

Not blocking: with a recorded server like project__listing and tool inspect on /, the call is now productive where the old split made it wasted (listing matched the search word). That matches the stated policy; just flagging the direction change.

@rng1995 rng1995 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks @Afloat16 for this contribution! I reviewed 541663c065. I reproduced the problem on main, confirmed this change fixes it, checked that the new tests fail on main, and ran the new and related tests on this head (all pass). I left 1 inline comment (1 P3); please take a look.

Reject recorded MCP components longer than 1,024 characters or containing
control characters before plugin alias matching. Keep full identity
validation ahead of display truncation for supported names.

A native-log replay with a 9,000-character repeated plugin prefix reproduces
RecursionError before the fix; that and five malformed-name regressions now
pass. Validation: 1,642 related tests, 51 trace-import tests, full src/tests
Ruff, pinned Fern check, and wheel/sdist build.

Scope documentation to rebuilt Codex logs and imported candidates, preserve
the existing Harbor-trajectory limitation, and document planning-name and
Skill-tool classification effects. Merge main and retain Unreleased notes.

Signed-off-by: Afloat <ShuffleMonkey@163.com>
@Afloat16

Copy link
Copy Markdown
Contributor Author

Addressed the documentation scope feedback in ec91d2e. reports.mdx and tier3-grading.mdx now limit the identity behavior to rebuilt codex.txt trajectories and tier3 import-traces, and retain the limitation for normal graded Harbor Codex trajectories. The docs and Unreleased notes also state the planning-name MCP productivity change, removal of false Skill activations for an MCP tool named skill, and qualified labels in imported Codex candidates. The pinned Fern check passed with no errors.

@rng1995
rng1995 enabled auto-merge (squash) November 18, 2026 05:14
Signed-off-by: Afloat <ShuffleMonkey@163.com>
auto-merge was automatically disabled November 18, 2026 06:06

Head branch was pushed to by a user without write access

@rng1995 rng1995 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks @Afloat16 for this contribution and for addressing the earlier review! I re-checked e7b163bcb6: all 1 earlier comment is resolved in the code, the tests pass, and I found nothing new. Approving.

@chrisknvidia chrisknvidia left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Confirmed on this head: the docs now scope the preserved server identity to trajectories rebuilt from codex.txt or through import-traces, keep the statement that graded Harbor trajectories are unchanged, and the grading page and changelog state the scoring changes for planning-named MCP tools and for a tool named skill. The new 1,024-character and control-character bound on the recorded identity is covered by tests. Thanks, this is ready from my side.

Preserve the Codex MCP identity change alongside upstream updates.

Signed-off-by: Afloat <ShuffleMonkey@163.com>
Afloat16 and others added 7 commits November 19, 2026 17:18
Preserve both the PR entry and current upstream release notes.

Signed-off-by: Afloat <ShuffleMonkey@163.com>
Signed-off-by: Afloat <ShuffleMonkey@163.com>
Synchronize with NVIDIA/SkillEvaluator main f867b7f.
Retain this PR's entry under Unreleased and preserve published release history.

Signed-off-by: Afloat <ShuffleMonkey@163.com>
Resolve the CHANGELOG.md conflict by keeping main's Unreleased content
unchanged and placing the native Codex MCP identity bullet under
Unreleased > Fixed, ahead of main's trajectory-recovery bullet.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: Narendran Raghavan <nraghavan@nvidia.com>
…built Codex MCP calls

In rebuilt Codex logs every MCP tool counts as MCP work, so each name in the
neutral planning and bookkeeping set flips from neutral to productive, not just
task, update_plan, spawn_agent and wait. Reword the changelog entry and the
reports page to say so.

Add regression tests for the behaviour those notes describe:
- every neutral bare name is productive when recorded as an MCP tool, and
  update_plan, spawn_agent and wait join the existing task case
- an MCP tool named skill is an MCP activation, not a Skill-tool activation
- tier3 import-traces candidates for Codex exports use mcp__server__tool labels

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: Narendran Raghavan <nraghavan@nvidia.com>
Resolve the CHANGELOG.md conflict by keeping main's entries and this change's entry under Unreleased.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: Narendran Raghavan <nraghavan@nvidia.com>
Resolve the CHANGELOG.md conflict by keeping main's entries and this change's entry under Unreleased.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: Narendran Raghavan <nraghavan@nvidia.com>

@rng1995 rng1995 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks @Afloat16 for this contribution! I re-checked 46d4833b4: I merged current main into the branch (the only conflict was CHANGELOG.md, resolved by keeping main's entries and this entry under Unreleased), confirmed that every earlier review comment is addressed in the code, and ran this PR's tests and ruff, which pass. I found nothing new. Approving. I also pushed one follow-up commit: the changelog and reports page now say that every neutral planning/bookkeeping name (not just four of them) counts as MCP work in rebuilt Codex logs, with regression tests for that, for an MCP tool named skill, and for the import-traces candidate labels.

Signed-off-by: Afloat <ShuffleMonkey@163.com>
@rng1995
rng1995 merged commit abcec4d into NVIDIA:main Nov 23, 2026
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.

3 participants