Skip to content

[PR] fix: scope restored-image shedding exemptions to their tool result - #7034

Closed
Afloat16 wants to merge 2 commits into
ranxianglei:masterfrom
Afloat16:2026-11-17_image-tool-result-scope
Closed

Afloat16 wants to merge 2 commits into
ranxianglei:masterfrom
Afloat16:2026-11-17_image-tool-result-scope

Conversation

@Afloat16

Copy link
Copy Markdown
Contributor

Problem

The Anthropic image collector returns early for a whole message when any tool_result belongs to read_original_image. Ordinary sibling tool results and top-level images are then ignored by both byte shedding and image-count convergence, even though their images are eligible for archiving.

Change

Apply the existing original-image exemption only while visiting the matching tool_result. Continue collecting other results and top-level images from that same message. Keep the original bytes, per-image receipt checks, protected-tail behavior and existing budget policy.

Verification

  • Base: 301e1a5459a77d5578206927c8062a58381af642.
  • Six focused controls: 4 base failures, 2 passes.
  • Two real TCP HTTP tests exercise proxy and plugin /v1/messages forwarding. Both fail on the base and pass with the patch: a 60,000-byte ordinary image is archived to fit the existing 50,000-byte budget, while its 3,000-byte restored-original sibling remains intact.
  • Related byte/count/media/downscale regressions: 53 passed, plus the 2 real HTTP tests (55 total).
  • Full npm run typecheck, npm run build, and git diff --check: passed.
  • Real Codex preflight: CLI 0.167.0-alpha.4 and built artifact found; configured upstream 127.0.0.1:8199 unreachable. The required real Codex four-phase acceptance is not claimed and remains a pre-merge gate.

No kernel/config/schema changes. The shared collector is used by the proxy relay and loop resend paths; actual proxy and plugin forwarding are covered. This is distinct from #4102's PTC receipt matching and #6184/#6185's media/downscale fixes.

Fixes #7033

@ranxianglei ranxianglei changed the title fix: scope restored-image shedding exemptions to their tool result [PR] fix: scope restored-image shedding exemptions to their tool result Nov 17, 2026
Merge upstream master 6a641f3, including the architecture module-map and schedule-independent ranxianglei#2929 probe fixes.

Preserve the existing PR head and exact contribution patch. Validation of this refreshed head runs in upstream CI; no local test rerun is claimed.
@ranxianglei

Copy link
Copy Markdown
Owner

This fix is included verbatim (original commits and authorship preserved) in the merged batch PR #7074 — the changes are already on master. Closing to avoid a duplicate merge. 该修复已随批量 PR #7074 原样合入 master,为避免重复合并,关闭此 PR。

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.

Anthropic original-image exemption skips unrelated sibling tool results

2 participants