Skip to content

Preserve tool result metadata more selectively under size limits - #47714

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

copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/698e47dcbdd3351e9a031e45ea39053608a5a0e4

Conversation

@copyberry

@copyberry copyberry Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

Preserve tool result metadata more selectively under size limits

Why

Exceeding the aggregate metadata budget previously replaced all tool result metadata with omission markers, discarding small results unnecessarily. Oversized results also lost resource-access evidence even when that evidence alone would fit.

What changed

  • Raise the executed-tool-call metadata budget per request from 32 KiB to 128 KiB while retaining the 32 KiB per-result limit.
  • Reduce the largest result metadata first and stop once the request fits, preserving smaller results.
  • Retain openai/resource_access when full metadata exceeds capture, request, or direct-call retained-history limits. Keep resource lists intact, and discard optional result metadata before sacrificing call records, source evidence, or completion markers.

Testing

Add regression coverage for selective reduction, resource-access retention, serialized request size, and direct-call and Code Mode behavior. Update compaction and truncation tests for the larger request budget.

)

## Why

Exceeding the aggregate metadata budget previously replaced all tool result metadata with omission markers, discarding small results unnecessarily. Oversized results also lost resource-access evidence even when that evidence alone would fit.

## What changed

- Raise the executed-tool-call metadata budget per request from 32 KiB to 128 KiB while retaining the 32 KiB per-result limit.
- Reduce the largest result metadata first and stop once the request fits, preserving smaller results.
- Retain `openai/resource_access` when full metadata exceeds capture, request, or direct-call retained-history limits. Keep resource lists intact, and discard optional result metadata before sacrificing call records, source evidence, or completion markers.

## Testing

Add regression coverage for selective reduction, resource-access retention, serialized request size, and direct-call and Code Mode behavior. Update compaction and truncation tests for the larger request budget.

GitOrigin-RevId: 698e47dcbdd3351e9a031e45ea39053608a5a0e4
@copyberry
copyberry Bot force-pushed the copyberry/codex-internal-to-codex-oss/698e47dcbdd3351e9a031e45ea39053608a5a0e4 branch from de956d6 to e7165c2 Compare September 24, 2026 01:52
@copyberry
copyberry Bot merged commit e7165c2 into main Sep 24, 2026
@copyberry
copyberry Bot deleted the copyberry/codex-internal-to-codex-oss/698e47dcbdd3351e9a031e45ea39053608a5a0e4 branch September 24, 2026 01:52
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 24, 2026

This branch was successfully deployed

1 active deployment
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.

3 participants