Repository navigation
fix(agents): keep accepted image jobs alive through provider cleanup - #142991
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 9, 2026, 5:37 AM ET / 09:37 UTC. ClawSweeper reviewWhat this changesRetains image-provider resources through preparation, reference loading, accepted generation, saving, and rollback, while rejecting new jobs after provider retirement. Merge readiness✅ Ready for maintainer review This remains a useful follow-up to the merged image-runtime ownership fix, which explicitly excluded prepared tools and detached jobs. No blocking correctness defect was found. Priority: P2 Review scores
Verification
How this fits togetherThe image-generation tool turns agent requests into foreground or background provider jobs. Prepared plugin resources must remain available until those jobs finish producing and saving their images, after which completion flows into the existing task-delivery system. flowchart TD
A[Agent image request] --> B[Capture provider resources]
B --> C[Load references and validate]
C --> D{Source still current?}
D -->|No| E[Release and report retryable error]
D -->|Yes| F[Accept image job]
F --> G[Generate and save or roll back]
G --> H[Release resources and report completion]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +467, Tests +499, Docs +10, Other -1. Total +975 across 19 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Technical reviewBest possible solution: Keep provider resource ownership with the actual image job through final cleanup, while preserving the separate admission boundary and existing raw-host lifetime. Do we have a high-confidence way to reproduce the issue? Yes, from source: release an owned inspection after its image tool returns started while the job remains queued or saving; current main carries provider callbacks without the corresponding resource claim. This review did not execute that scenario. Is this the best way to solve the issue? Yes. The patch repairs the producer-to-job ownership handoff, reuses existing acquisition and persistence boundaries, and preserves the established independence of accepted jobs from caller cancellation. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 96006252820e. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
…penclaw#142991) * fix(agents): retain prepared image resources through job completion * test(agents): assert prepared loader inputs independently of callbacks
Related: #140674
What Problem This Solves
Fixes an issue where an accepted
image_generatejob could lose its plugin resources after returningstarted, while generation, image persistence, or rollback was still running. Preparing tools and checking remote image references could also outlive the original provider registration.Why This Change Was Made
Carry the original inspection's resource ownership through prepared facts, preflight, and the actual accepted job. A retired source cannot admit a new task, while an already accepted task retains its captured providers until work and cleanup finish. Shared capability acquisition now exposes the same existing ownership operation for this longer lifetime.
Existing execution and image-geometry helpers move into an execution module to keep the tool readable; their behavior is unchanged. The oversized-file exception is removed. Raw prepared registries retain their host-owned lifetime; this does not enable general prepared-cache disposal.
User Impact
Background image generation keeps working after its originating preparation is released. A source retired during preflight produces a retryable setup failure before task admission.
startedremains an immediate acceptance result, and completed media remains available after provider cleanup.Evidence