Skip to content

Add diagnostic reasons to MCP attribution errors - #47899

Merged
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/389b9446fae119f793978f3e7e4a926677e84d8c
Sep 24, 2026
Merged

copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/389b9446fae119f793978f3e7e4a926677e84d8c

Conversation

@copyberry

@copyberry copyberry Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

Add diagnostic reasons to MCP attribution errors

Why

The attribution_error status does not explain why MCP attribution is incomplete. Preserve a diagnostic reason so callers can distinguish history and recorder errors from request serialization failures.

What changed

  • Add optional error_reason diagnostics to McpAttribution, retaining the first recorder error through checkpoints, compaction, resume, and fork.
  • Identify missing or invalid checkpoints, conflicting sources, invalid sources, and poisoned recorder state. Use restored_error_unknown for older error checkpoints without a reason.
  • Distinguish payload_too_large from serialization_failed in request metadata fallbacks.
  • Tolerate missing, unknown, or malformed diagnostic reasons when reading history, without letting diagnostics determine attribution status.

Testing

Add coverage for reason preservation, recorder poisoning, backward-compatible checkpoint decoding, resume and cold-fork restoration, and request metadata serialization, including oversized payloads.

## Why

The `attribution_error` status does not explain why MCP attribution is incomplete. Preserve a diagnostic reason so callers can distinguish history and recorder errors from request serialization failures.

## What changed

- Add optional `error_reason` diagnostics to `McpAttribution`, retaining the first recorder error through checkpoints, compaction, resume, and fork.
- Identify missing or invalid checkpoints, conflicting sources, invalid sources, and poisoned recorder state. Use `restored_error_unknown` for older error checkpoints without a reason.
- Distinguish `payload_too_large` from `serialization_failed` in request metadata fallbacks.
- Tolerate missing, unknown, or malformed diagnostic reasons when reading history, without letting diagnostics determine attribution status.

## Testing

Add coverage for reason preservation, recorder poisoning, backward-compatible checkpoint decoding, resume and cold-fork restoration, and request metadata serialization, including oversized payloads.

GitOrigin-RevId: 389b9446fae119f793978f3e7e4a926677e84d8c
@copyberry
copyberry Bot force-pushed the copyberry/codex-internal-to-codex-oss/389b9446fae119f793978f3e7e4a926677e84d8c branch from 9c35d44 to 62197a6 Compare September 24, 2026 18:06
@copyberry
copyberry Bot merged commit 62197a6 into main Sep 24, 2026
1 check failed
@copyberry
copyberry Bot deleted the copyberry/codex-internal-to-codex-oss/389b9446fae119f793978f3e7e4a926677e84d8c branch September 24, 2026 18:06
@github-actions

Copy link
Copy Markdown
Contributor


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

@github-actions github-actions Bot locked and limited conversation to collaborators Sep 24, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant