Agent: huge-image load + figure/region caps + stale-active fix #171

Merged
bvandeusen merged 2 commits from dev into main 2026-06-30 22:47:49 -04:00
Owner

From the operator's run logs (pathological image 81602: gpu 38311ms + recurring 413):

  • Load huge images: Image.MAX_IMAGE_PIXELS = None (trusted local library) so 90–95MP images load instead of hard-erroring at PIL's 2× decompression-bomb limit.
  • Cap figures per frame (MAX_FIGURES, default 8) like components/panels already are — uncapped, a busy/huge image → hundreds of per-figure CCIP calls + crops → 38s job + oversized submit.
  • Global per-job region backstop (MAX_REGIONS, default 128): keep the highest-scoring, log the drop, so a submit body can't exceed curator's limit (413).
  • Stale "active" meter: stop() resets _active to 0 and _bump clamps at 0, so the meter reads 0 the instant you stop and can't go negative from a lagging decrement.

All agent-only. Full CI green on dev.

🤖 Generated with Claude Code

From the operator's run logs (pathological image 81602: `gpu 38311ms` + recurring 413): - **Load huge images:** `Image.MAX_IMAGE_PIXELS = None` (trusted local library) so 90–95MP images load instead of hard-erroring at PIL's 2× decompression-bomb limit. - **Cap figures per frame** (`MAX_FIGURES`, default 8) like components/panels already are — uncapped, a busy/huge image → hundreds of per-figure CCIP calls + crops → 38s job + oversized submit. - **Global per-job region backstop** (`MAX_REGIONS`, default 128): keep the highest-scoring, log the drop, so a submit body can't exceed curator's limit (413). - **Stale "active" meter:** `stop()` resets `_active` to 0 and `_bump` clamps at 0, so the meter reads 0 the instant you stop and can't go negative from a lagging decrement. All agent-only. Full CI green on dev. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
bvandeusen added 2 commits 2026-06-30 22:47:44 -04:00
fix(agent): load huge images — disable PIL decompression-bomb guard
CI / lint (push) Successful in 2s
CI / frontend-build (push) Successful in 17s
CI / backend-lint-and-test (push) Successful in 28s
CI / integration (push) Successful in 3m22s
7e74fa767c
Trusted local library, not an upload surface, so a legitimately large image
(90–95M px, operator-flagged) must load. PIL only WARNS at the 89M-px default but
RAISES DecompressionBombError at ~179M px, which would fail those jobs. Set
Image.MAX_IMAGE_PIXELS = None. (The agent works off individual extracted files —
curator's archive_extractor unpacks zip/cbz/rar/7z at import — so this is about
big single images, not archives.)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ttrj5P7upUTueSfoJcxEqa
fix(agent): cap figures + global region cap + reset active on stop
CI / lint (push) Successful in 3s
CI / frontend-build (push) Successful in 20s
CI / backend-lint-and-test (push) Successful in 25s
CI / integration (push) Successful in 3m25s
c587ac667c
Three safety/robustness fixes from the operator's run logs:

- Cap figures per frame (MAX_FIGURES, default 8) like components/panels already
  are. Uncapped, a huge/busy image yielded hundreds of figure boxes → hundreds
  of per-figure CCIP calls + crops → a 38s job AND a submit too big to accept
  (image 81602 looped on 413). This is the acute fix.
- Global per-JOB backstop (MAX_REGIONS, default 128): if total regions still
  exceed the cap (long video), keep the highest-scoring and log the drop, so a
  submit body can never blow past curator's limit.
- Stale "active" meter: stop() now resets _active to 0 (no slots remain, so the
  meter must read 0 at once), and _bump clamps at 0 so a slot finishing after the
  reset can't drive it negative.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ttrj5P7upUTueSfoJcxEqa
bvandeusen merged commit fbb76e6f36 into main 2026-06-30 22:47:49 -04:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: bvandeusen/FabledCurator#171