Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
c4f2850
fix(tier3): preserve native Codex MCP server identity
Afloat16 Nov 17, 2026
aace134
Merge branch 'main' into fix/preserve-codex-mcp-identity
chrisknvidia Nov 17, 2026
f4e613d
Preserve structured Codex MCP identity through scoring
Afloat16 Nov 17, 2026
88ef7f7
Merge main and retain both release notes
Afloat16 Nov 17, 2026
0840873
Merge upstream main after documentation reorganization
Afloat16 Nov 17, 2026
a3f7797
Merge branch 'main' into fix/preserve-codex-mcp-identity
rng1995 Nov 17, 2026
be53ef1
fix(tier3): validate complete MCP identities before display limits
Afloat16 Nov 17, 2026
541663c
Merge main and preserve pending changelog entry
Afloat16 Nov 17, 2026
ec91d2e
fix(tier3): bound recorded MCP names and clarify reconstruction scope
Afloat16 Nov 18, 2026
6f8fcc3
Merge branch 'main' into fix/preserve-codex-mcp-identity
rng1995 Nov 18, 2026
e7b163b
Merge upstream main and preserve unreleased notes
Afloat16 Nov 18, 2026
feef312
Merge main and retain independent Unreleased changelog entries
Afloat16 Nov 19, 2026
e3c4320
chore: merge upstream main and resolve changelog conflict
Afloat16 Nov 19, 2026
4a078c6
chore: integrate latest SkillSpector diagnostics from main
Afloat16 Nov 19, 2026
3e192dd
chore: merge main and preserve the PR release note
Afloat16 Nov 20, 2026
5f0a971
Merge main into fix/preserve-codex-mcp-identity
rng1995 Nov 20, 2026
f3bc6d6
docs(tier3): cover every neutral name and add regression tests for re…
rng1995 Nov 20, 2026
0492749
Merge main into afloat/pr-731
rng1995 Nov 21, 2026
46d4833
Merge main into afloat/pr-731
rng1995 Nov 21, 2026
054eeb3
fix(trace-import): retain MCP tools in bounded candidate labels
Afloat16 Nov 21, 2026
44e6f07
Merge branch 'main' into fix/preserve-codex-mcp-identity
rng1995 Nov 23, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ All notable changes to SkillEvaluator are documented in this file.

### Fixed

- Codex JSONL reconstruction preserves recorded MCP server and tool names as
`mcp__server__tool`, allowing tool efficiency to recognize MCP work and apply
the existing filesystem-root search policy. Their separately recorded identity
also keeps server names containing `__` intact for scoring and plugin reports.
Full identities are checked before display-label truncation.

- Reject duplicate price-file keys and boolean rates before budget accounting, and report unrepresentable integer rates as configuration errors.

## 1.0.0 - 2026-11-17
Expand Down
8 changes: 5 additions & 3 deletions docs/reports.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -959,9 +959,11 @@ tool names, these calls are productive: reading, searching, listing, writing,
editing or patching files (`Write`, `Edit`, `MultiEdit`, `apply_patch`, `LS`,
OpenCode `list`, Codex `list_dir` and `grep_files`, and similar), running
commands and activating a skill. MCP tools named `mcp__server__tool`, as Claude
Code records them, are productive too. Codex records an MCP call under the bare
tool name and OpenCode as `server_tool`, so these calls are classified by their
name like any other tool, and most such names count as wasted. A Codex name
Code records them, are productive too. When reconstructing native Codex JSONL,
the recorded `server` and `tool` fields produce the same MCP name and remain
separate, so `__` inside a server name does not change its identity. Codex records
without server identity and OpenCode names such as `server_tool` are classified
by their name like any other tool, and most such names count as wasted. A Codex name
with a namespace, such as `functions.apply_patch`, is classified by the part
after the last dot. Help, version and install commands are wasted, whether
written as text or recorded as an argument list, as is any tool outside these
Expand Down
6 changes: 4 additions & 2 deletions docs/tier3-grading.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ none of them.
scored tool calls that did productive work. For Claude Code, Codex and OpenCode
tool names, reading, searching, listing, writing, editing or patching files,
running commands and activating a skill are productive, and so are MCP tools
named `mcp__server__tool` (Claude Code). Codex and OpenCode MCP calls are not
recognized as MCP calls yet, so most of them count as wasted. Help, version and
named `mcp__server__tool` (Claude Code and reconstructed native Codex JSONL with
recorded server identity, including names containing `__`). Codex records without
server identity and OpenCode MCP calls are classified by their tool name, so most
count as wasted. Help, version and
install commands and searches rooted at `/` are wasted. Planning and
bookkeeping calls, such as `TodoWrite`, `update_plan`, task lists,
background-shell polling and sub-agent calls, are not counted, and a trial with
Expand Down
4 changes: 4 additions & 0 deletions src/skillevaluator/tier3/eval_core/atif_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
atif_content_text,
normalized_tool_call_error_flag,
normalized_tool_call_is_error,
recorded_mcp_identity,
)
from skillevaluator.tier3.eval_core.codex_tool_call_normalizer import (
iter_normalized_tool_calls as iter_tool_calls,
Expand All @@ -41,6 +42,7 @@
atif_content_text,
normalized_tool_call_error_flag,
normalized_tool_call_is_error,
recorded_mcp_identity,
)
from codex_tool_call_normalizer import (
iter_normalized_tool_calls as iter_tool_calls,
Expand Down Expand Up @@ -1424,6 +1426,8 @@ def extract_tool_calls_as_dicts(traj: dict[str, Any]) -> list[dict[str, Any]]:
"action_input": tc.get("arguments") or {},
"observation": _tool_call_observation(step, tc),
}
if identity := recorded_mcp_identity(call["action"], tc.get("extra")):
call["extra"] = {"mcp_server": identity[0], "mcp_tool": identity[1]}
# Keep Harbor's explicit success flag too: Claude Code results that
# exited 0 carry no exit status line.
if (is_error := normalized_tool_call_error_flag(step, tc)) is not None:
Expand Down
16 changes: 13 additions & 3 deletions src/skillevaluator/tier3/eval_core/checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
AMBIGUOUS_OUTER_EXEC_OBSERVATION,
UNOBSERVED_INNER_CALL,
UNSUPPORTED_NATIVE_CODEX_EXEC,
recorded_mcp_identity,
)
from skillevaluator.tier3.eval_core.secret_redaction import redact_secrets_in_log_line
else: # Standalone verifier: all dependencies are staged siblings.
Expand All @@ -43,6 +44,7 @@
AMBIGUOUS_OUTER_EXEC_OBSERVATION,
UNOBSERVED_INNER_CALL,
UNSUPPORTED_NATIVE_CODEX_EXEC,
recorded_mcp_identity,
)
from secret_redaction import redact_secrets_in_log_line

Expand Down Expand Up @@ -8300,7 +8302,9 @@ def _session_input_is_text(value: Any) -> bool:
return isinstance(value, str) and any(char.isprintable() and not char.isspace() for char in value)


def _mcp_call_targets_root(name: str, args: dict[str, Any]) -> bool:
def _mcp_call_targets_root(
name: str, args: dict[str, Any], identity: tuple[str, str] | None = None
) -> bool:
"""Whether an MCP call searches or lists the whole filesystem.

Only filesystem tools count: a tool of a server whose name contains
Expand All @@ -8310,7 +8314,10 @@ def _mcp_call_targets_root(name: str, args: dict[str, Any]) -> bool:
"""
if not name.startswith("mcp__"):
return False
server, _, tool = name[len("mcp__") :].partition("__")
if identity is None:
server, _, tool = name[len("mcp__") :].partition("__")
else:
server, tool = (part.casefold() for part in identity)
if "filesystem" not in server and not any(word in tool for word in _MCP_FILESYSTEM_SEARCH_WORDS):
return False
return any(
Expand All @@ -8335,7 +8342,10 @@ def _tool_call_productivity(tc: dict[str, Any], expected_skill: Any, expected_sc
search_action = "exec_command"
cmd = _tool_efficiency_text(target)
# A search rooted at "/" is waste even when it names the expected skill or script.
if _tool_searches_root(search_action, args, cmd, argv=_is_argv(target)) or _mcp_call_targets_root(name, args):
mcp_identity = recorded_mcp_identity(tc["action"], tc.get("extra"))
if _tool_searches_root(search_action, args, cmd, argv=_is_argv(target)) or _mcp_call_targets_root(
name, args, mcp_identity
):
return "wasted"
if ("read" in name and expected_skill and expected_skill in cmd) or (
runs_command and expected_script and expected_script in cmd
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

"""Dependency-free normalization for native Codex ``tools.exec`` wrappers."""
"""Dependency-free normalization for native Codex tool calls."""

from __future__ import annotations

Expand All @@ -21,6 +21,20 @@
_MAX_TOOL_CALLS = 128


def recorded_mcp_identity(function_name: str, extra: Any) -> tuple[str, str] | None:
"""Return a recorded MCP server/tool pair consistent with its display name.

The display name alone is ambiguous when either component contains ``__``.
Ignore incomplete or inconsistent metadata on other ATIF calls.
"""
if not isinstance(extra, dict):
return None
server, tool = extra.get("mcp_server"), extra.get("mcp_tool")
if not isinstance(server, str) or not server or not isinstance(tool, str) or not tool:
return None
return (server, tool) if function_name == f"mcp__{server}__{tool}" else None


def atif_content_text(content: object) -> str:
"""Return the text of an ATIF message or observation content value.

Expand Down
8 changes: 8 additions & 0 deletions src/skillevaluator/tier3/eval_core/log_converters.py
Original file line number Diff line number Diff line change
Expand Up @@ -906,6 +906,12 @@ def synthetic_trajectory_from_codex_json(text: str) -> dict[str, Any] | None:

if item_type == "mcp_tool_call":
tool = str(item.get("tool") or "mcp_tool")
server = item.get("server")
mcp_extra = {}
if isinstance(server, str) and server:
bare_tool = tool.removeprefix(f"mcp__{server}__")
mcp_extra = {"mcp_server": server, "mcp_tool": bare_tool}
tool = f"mcp__{server}__{bare_tool}"
Comment thread
chrisknvidia marked this conversation as resolved.
Resolved
arguments = item.get("arguments")
if not isinstance(arguments, dict):
arguments = {}
Expand All @@ -924,6 +930,8 @@ def synthetic_trajectory_from_codex_json(text: str) -> dict[str, Any] | None:
],
"observation": {"results": []},
}
if mcp_extra:
step["tool_calls"][0]["extra"] = mcp_extra
observation = _codex_mcp_observation(item)
if observation:
step["observation"]["results"].append(
Expand Down
18 changes: 12 additions & 6 deletions src/skillevaluator/tier3/eval_core/plugin_signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@
from skillevaluator.tier3.eval_core.codex_tool_call_normalizer import (
MAPPED_OUTER_EXEC_OBSERVATION,
normalize_tool_call,
recorded_mcp_identity,
)
from skillevaluator.tier3.plugin_native import OPENCODE_BUILTIN_AGENTS
from skillevaluator.tier3.runtime_arms import ARM_LOOSE_PARTS, ARM_SUM_OF_PARTS, ARM_WITH, ARM_WITHOUT
Expand Down Expand Up @@ -1741,7 +1742,7 @@ def _tool_name(tool_call: Mapping[str, Any]) -> str:
for key in ("function_name", "name", "tool_name"):
value = tool_call.get(key)
if isinstance(value, str) and value.strip():
return value.strip()[:_MAX_LABEL_CHARS]
return value.strip()
return ""


Expand Down Expand Up @@ -2808,9 +2809,11 @@ def _persistable_name(name: str, members: Sequence[str]) -> bool:
return any(member.casefold() == folded for member in members)


def _mcp_ident(fn: str, mcp_names: _McpNames, *, agent: str) -> _Ident | None:
def _mcp_ident(
fn: str, mcp_names: _McpNames, *, agent: str, recorded: tuple[str, str] | None = None
) -> _Ident | None:
"""The MCP identity of a call named ``fn``, labeled ``mcp__<server>__<tool>`` (see :meth:`_McpNames.identity`)."""
identity = mcp_names.identity(fn, agent=agent)
identity = (mcp_names.match(recorded[0]) or recorded[0], recorded[1]) if recorded else mcp_names.identity(fn, agent=agent)
Comment thread
Afloat16 marked this conversation as resolved.
Resolved
if identity is None:
return None
server, tool = identity
Expand Down Expand Up @@ -2934,7 +2937,7 @@ def _expanded_tool_calls(raw: Mapping[str, Any], outer_id: str, mcp_call_servers
server = mcp_call_servers.get(outer_id) if outer_id else None
if server and name and not name.casefold().startswith(_MCP_PREFIX):
# The harness log names the server this bare MCP tool name came from (Codex).
name = f"mcp__{server}__{name}"[:_MAX_LABEL_CHARS]
name = f"mcp__{server}__{name}"
prepared = {**raw, "function_name": name, "arguments": _arguments(raw)}
try:
return normalize_tool_call(prepared)
Expand Down Expand Up @@ -2968,10 +2971,13 @@ def _identify_call(
lsp_extensions: Mapping[str, str] | None = None,
) -> _Call:
"""A normalized tool call with its identities and outcome (its subagent fields are filled in later)."""
fn = str(tool_call.get("function_name") or "")[:_MAX_LABEL_CHARS]
full_name = str(tool_call.get("function_name") or "")
# Validate the complete identity before limiting display labels.
recorded = recorded_mcp_identity(full_name, tool_call.get("extra"))
fn = full_name[:_MAX_LABEL_CHARS]
args = tool_call.get("arguments")
args = args if isinstance(args, dict) else {}
mcp = _mcp_ident(fn, mcp_names, agent=agent)
mcp = _mcp_ident(fn, mcp_names, agent=agent, recorded=recorded)
fn_base = _base_tool_name(mcp.tool if mcp is not None and mcp.tool else fn)
manifest = _manifest_reads(fn_base, args, declared.get(COMPONENT_SKILL) or (), is_mcp=mcp is not None)
named = {
Expand Down
Loading
Loading