fix(agent): persist image-shrink recovery - #62005
Conversation
|
Thanks for tracing the recovery state through canonical session persistence. The premise is confirmed on current main: Anthropic cache preparation deep-copies the API request ( Problems
Suggested changes
Automated hermes-sweeper review. |
|
Addressed in 31ae7be on current main ( |
a82bfca to
c4982dd
Compare
c4982dd to
31ae7be
Compare
|
Resolved the current-main conflict in e76f996 while preserving both invariants: image-shrink remains copy-on-write for API-local messages, and a confirmed provider rejection still mirrors the exact successful repair into canonical history before persistence and retry. Local verification:
GitHub now reports the PR mergeable; replacement CI is running. |
…t-20260730 # Conflicts: # tests/run_agent/test_image_shrink_recovery.py
|
Resolved the new current-main conflict in The conflict was in Local verification:
GitHub reports the updated head mergeable; replacement CI is running. |
|
Replacement CI completed with the conflict resolution itself clean: 7/8 Python slices passed, both Docker builds passed, Desktop E2E passed, and all lint/security/lockfile checks passed. Slice 8 failed only in
I did not import an unrelated Vercel fixture repair into this image-shrink PR. The conflict remains resolved and GitHub reports the head mergeable. |
|
Upstream landed the unrelated Vercel CI fixture correction in Verification:
GitHub reports the refreshed head mergeable. |
Summary
Current-main proof
On current main,
try_shrink_image_parts_in_messages()mutates only the provider-facingapi_messagescopy. The new regression failed before the fix because the helper could not expose any replacement for canonical history; the original oversized payload therefore remained inmessagesfor the next turn.After the fix, the helper returns the exact old-to-new payload mapping, detached canonical OpenAI and Anthropic messages are rewritten, and the repaired session is persisted before the retry. The retry-loop regression records the first rejected request, repaired canonical persistence, and repaired retry in order while asserting the image encoder runs exactly once.
Duplicate / sibling-path audit
Reviewed open image-shrink PRs #37412, #42509, #49124, #52444, and #53884. They cover 413 routing, classification, downscale acceptance, or wrapped-error parsing. None persists a successful repair into canonical session history.
Sibling shapes audited: OpenAI
image_urldict/string parts and Anthropic native base64image.sourceblocks.Verification
tests/run_agent/test_image_shrink_recovery.py: 25 passedtests/run_agent/test_run_agent.py: 416 passedgit diff --checkpassedNo live Hermes state or provider credentials were used.
Fixes #61994