Repository navigation
fix(media): stop image setup after cancellation - #140149
Conversation
Carry the combined request signal into image runtime admission and check it after every awaited model or credential preparation stage. Pending setup keeps responsibility for releasing its lease, while late results cannot start more auth work or publish runtime credentials after cancellation. Found while extracting and validating the useful changes from #130706.
|
🦞👀 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 6, 2026, 10:04 AM ET / 14:04 UTC. ClawSweeper reviewWhat this changesStops canceled or timed-out image descriptions from continuing authentication or publishing runtime credentials when pending setup finishes, with regression coverage across five setup stages. Merge readiness✅ Ready for maintainer review Keep open: current main still permits late image setup to continue after cancellation. This focused repair has no identified blocking defect, and the maintainer-authored, protected PR is not eligible for cleanup closure. Priority: P2 Review scores
Verification
How this fits togetherImage understanding turns image attachments and prompts into descriptions using configured model providers. Its setup layer acquires a runtime lease, resolves the model and credentials, and hands the prepared request to inference. flowchart TD
A[Images and prompt] --> B[Acquire runtime lease]
B --> C[Resolve model and credentials]
C --> D{Request still active?}
D -->|Yes| E[Publish runtime credentials]
E --> F[Provider inference]
D -->|No| G[Reject and release lease]
F --> H[Description and cleanup]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +8, Tests +7. Total +15 across 5 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep cancellation checks at the image setup owner’s asynchronous boundaries while preserving existing credential protection, provider selection, and lease cleanup. Do we have a high-confidence way to reproduce the issue? Yes, from source: hold an asynchronous image setup stage, cancel or time out the request, then let that stage finish; current main can continue authentication and publish a runtime key. This review did not execute that scenario. Is this the best way to solve the issue? Yes. Reusing the combined request signal and existing admission API repairs the owning boundary without adding another cancellation mechanism or changing successful-request configuration. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 62a5920cd420. 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.
|
Carry the combined request signal into image runtime admission and check it after every awaited model or credential preparation stage. Pending setup keeps responsibility for releasing its lease, while late results cannot start more auth work or publish runtime credentials after cancellation. Found while extracting and validating the useful changes from openclaw#130706.
Related: #130706
What Problem This Solves
Fixes an issue where a canceled or timed-out image description could continue authentication when pending setup work completed. Late setup could also publish a runtime credential after the caller had already received its cancellation error.
Why This Change Was Made
Carry the existing combined caller/timeout signal through image runtime admission and check it after each asynchronous setup stage, before starting the next stage or publishing a runtime credential. The existing owner still releases the prepared runtime when pending work settles.
User Impact
Cancellation prevents further image setup and inference. In-flight operations finish their cleanup without starting a new authentication stage.
Evidence
pnpm buildpass.7e0589437ae84eae5e2c84196c7afcbf6a91b367. The committed patch hash and 29,248 source/tooling/package hashes match; all 11,131 runtime files stayed unchanged during proof. Original build stamps are retained.Production: +8 lines for the existing cancellation boundary. Tests: +7 lines, consolidating two narrow cases into ten. This focused extraction participates in the overall production reduction from #130706.