Repository navigation
fix(tests): avoid avatar descriptor reuse race - #154747
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 21, 2026, 7:35 AM ET / 11:35 UTC (Revision 2). ClawSweeper reviewWhat this changesThe PR makes avatar cleanup tests observe the real file-close operation and checks cleanup after both successful inlining and an oversized read failure. Merge readiness✅ Ready for maintainer review Keep open as a useful, focused repair. No actionable defects remain, and the updated evidence resolves the prior review’s validation follow-up. Current main still contains the racy assertion. Priority: P2 Review scores
Verification
How this fits togetherOpenClaw reads local agent avatars through a workspace-bounded file descriptor and converts their contents into image data URLs. These tests verify that the avatar reader releases its descriptor on success and failure. flowchart LR
A[Workspace avatar file] --> B[Validate and open file]
B --> C[Bounded avatar read]
C --> D[Image data URL]
C --> E[Read failure]
D --> F[Close owned descriptor]
E --> F
F --> G[Test observes real close]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests +12. Total +12 across 1 file. View PR surface stats
Review metrics
Technical reviewBest possible solution: Retain the real filesystem cleanup checks for both outcomes without probing a descriptor number after ownership has ended. Do we have a high-confidence way to reproduce the issue? Yes: current main probes a closed descriptor number that another thread can reuse, and the PR reports a controlled Linux reproduction of that exact failure. This review verified the source mechanism without executing tests. Is this the best way to solve the issue? Yes: observing the call-through close operation directly protects the documented ownership contract, while the real oversized-file case adds meaningful failure-path coverage without changing production code. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 10c229159ceb. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Merged via squash.
|
Include the verified descriptor-reuse fixture repair from #154747 while preserving the reviewed session transition cancellation patch unchanged.
* commit '0883394977d1fb3af657635967f6e447bd7fff9a': (72 commits) fix(ui): await scheduled rail layout in focus test fix(cron): keep healthy active runs from delaying job lists (#154421) fix(plugins): prevent config conflicts during legacy plugin installation (#154539) perf(gateway): reduce repeated session-list work (#154551) fix(tasks): retain admitted work across list retries (#154338) perf(gateway): speed up transcript artifact downloads (#154726) chore(ui): refresh control ui locales (#154580) fix(release): keep two extended-stable months eligible (#154777) fix(tests): avoid avatar descriptor reuse race (#154747) perf(plugins): reduce callback scope overhead (#154625) fix(ui): include final request time in completed work summaries (#149240) fix(ai): avoid retrying conflicting Responses terminal statuses (#149242) fix: identify malformed Code Mode JavaScript as input errors (#149222) fix(doctor): settle imported JSONL transcript leftovers (#154413) fix(cloud): restore node bootstrap with bundled browser runtime (#154654) test(ui): await publication state notifications (#154768) fix(plugins): keep unchanged plugins running across metadata refreshes (#151281) fix: keep chat panel accessibility targets within each pane (#153478) fix: forced Gateway restarts cancel healthy subagent work (#154300) improve: reduce session delivery reader imports (#154740) ...
What Problem This Solves
Fixes intermittent avatar cleanup test failures in agent CI shards after successful avatar inlining. Observed in CI 35589427508 and CI 35589842726.
User Impact
No user-visible behavior change. Production avatar reads and descriptor ownership are unchanged.
Why This Change Was Made
A file descriptor number can be reused immediately after a successful close, so a later
fstatcannot prove that the avatar descriptor leaked. Observe the real, call-throughcloseSyncoperation and require exactly one close of the pinned descriptor. Extend the same case to a genuine read failure by growing the file past the byte limit after it has been opened.This is a maintainer-requested flaky-test repair.
Evidence
pnpm test src/agents/identity-avatar-file.test.ts --maxWorkers=1wall time: median 1.833 seconds, range 1.698–2.234 seconds.