Repository navigation
fix(agents): report offline trash failures after agent delete - #158052
Conversation
When local cleanup cannot move a path to Trash, the agent row is already gone but the text output only said the agent was deleted. Print the same manual-removal warning the Gateway path already prints. Signed-off-by: Sebastien Tardif <[email protected]>
|
🦞👀 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 changes before merge. Reviewed September 25, 2026, 6:03 AM ET / 10:03 UTC. ClawSweeper reviewWhat this changesThe PR makes offline Merge readiness⛔ Needs changes before merge - 2 items remain Current main still omits the offline text warning, and the supplied macOS command trace shows the warning after this patch. The code review found no functional defect. The changed test still needs its measured cost recorded under repository policy. Priority: P2 Review scores
Verification
How this fits togetherThe agents delete command removes an agent from the roster, then asks the Gateway or a local fallback to clean up its files. Cleanup results reach the operator as text or JSON output. flowchart LR
A[Delete command] --> B{Gateway available?}
B -->|Yes| C[Gateway cleanup]
B -->|No| D[Local cleanup]
C --> E[Cleanup results]
D --> E
E --> F{Output format}
F -->|Text| G[Deletion and warnings]
F -->|JSON| H[Path outcomes]
Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource +8, Tests +25. Total +33 across 2 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep the shared warning on both text paths while preserving JSON output and retryable cleanup; record the focused test cost in the PR body. Do we have a high-confidence way to reproduce the issue? Yes, with high confidence from source: current main records local Trash failures but omits their detailed warning in text output. The reviewer did not execute the command; the PR supplies a real macOS failure trace. Is this the best way to solve the issue? Yes. Reusing the Gateway path's warning formatter repairs the missing text output without changing cleanup, exit status, or JSON behavior. Full review comments:
Overall correctness: patch is correct AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against cbcd4df569eb. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
* commit '54b5f23b006ae917c8bb7903f5ee7dad6108ec25': (194 commits) feat(ui): listen to managed desktop audio in the panel (#157724) fix(ci): resume partially published preparation receipts (#158174) feat(release): one approval per release via an attested parent approval receipt (#157911) feat(desktop): advertise current managed desktop audio (#157723) fix(ui): retain delayed progress scroll gestures (#158153) refactor(ui): share sidebar mutation error feedback (#158173) test: await database verifier process lifecycle events (#158171) perf(update): avoid repeated retained-copy parent creation feat(desktop): bind audio streaming to screen authorization (#157722) refactor(gateway): split companion prompts and metadata fixtures (#158050) feat(desktop): isolate managed Linux application audio (#157720) fix(test): prepare catalog fixture modules before startup (#158157) fix: keep model pickers usable during provider sign-in (#158132) refactor(test): remove unused prompt scenario metadata (#158151) fix(ci): unblock Control UI targeted Crabbox gates (#158149) refactor(agents): deslop subagents, sessions, worktrees, commands and auth (#158020) fix: bound stalled browser stream startup (#156323) fix(onnx): prevent worker fixture hangs after release (#158146) fix(models): preserve scoped provider discovery outcomes (#158139) fix(agents): report offline trash failures after agent delete (#158052) ...
* commit '54b5f23b006ae917c8bb7903f5ee7dad6108ec25': (175 commits) feat(ui): listen to managed desktop audio in the panel (#157724) fix(ci): resume partially published preparation receipts (#158174) feat(release): one approval per release via an attested parent approval receipt (#157911) feat(desktop): advertise current managed desktop audio (#157723) fix(ui): retain delayed progress scroll gestures (#158153) refactor(ui): share sidebar mutation error feedback (#158173) test: await database verifier process lifecycle events (#158171) perf(update): avoid repeated retained-copy parent creation feat(desktop): bind audio streaming to screen authorization (#157722) refactor(gateway): split companion prompts and metadata fixtures (#158050) feat(desktop): isolate managed Linux application audio (#157720) fix(test): prepare catalog fixture modules before startup (#158157) fix: keep model pickers usable during provider sign-in (#158132) refactor(test): remove unused prompt scenario metadata (#158151) fix(ci): unblock Control UI targeted Crabbox gates (#158149) refactor(agents): deslop subagents, sessions, worktrees, commands and auth (#158020) fix: bound stalled browser stream startup (#156323) fix(onnx): prevent worker fixture hangs after release (#158146) fix(models): preserve scoped provider discovery outcomes (#158139) fix(agents): report offline trash failures after agent delete (#158052) ...
* fix(qa-lab): retain tab focus and scroll during polling * chore(qa-lab): merge main for tab navigation validation * fix(qa-lab): keep focused tabs visible after layout changes * fix(qa-lab): reconcile navigation retention with current app * chore: refresh main for QA Lab navigation validation * commit '54b5f23b006ae917c8bb7903f5ee7dad6108ec25': (194 commits) feat(ui): listen to managed desktop audio in the panel (#157724) fix(ci): resume partially published preparation receipts (#158174) feat(release): one approval per release via an attested parent approval receipt (#157911) feat(desktop): advertise current managed desktop audio (#157723) fix(ui): retain delayed progress scroll gestures (#158153) refactor(ui): share sidebar mutation error feedback (#158173) test: await database verifier process lifecycle events (#158171) perf(update): avoid repeated retained-copy parent creation feat(desktop): bind audio streaming to screen authorization (#157722) refactor(gateway): split companion prompts and metadata fixtures (#158050) feat(desktop): isolate managed Linux application audio (#157720) fix(test): prepare catalog fixture modules before startup (#158157) fix: keep model pickers usable during provider sign-in (#158132) refactor(test): remove unused prompt scenario metadata (#158151) fix(ci): unblock Control UI targeted Crabbox gates (#158149) refactor(agents): deslop subagents, sessions, worktrees, commands and auth (#158020) fix: bound stalled browser stream startup (#156323) fix(onnx): prevent worker fixture hangs after release (#158146) fix(models): preserve scoped provider discovery outcomes (#158139) fix(agents): report offline trash failures after agent delete (#158052) ... Co-authored-by: Vincent Koc <[email protected]>
…aw#158052) Report each failed offline Trash move with its path and reason, reusing the existing Gateway warning. Preserve JSON output, successful roster-deletion exit behavior, and retryable cleanup state. Add the offline text-path regression. Signed-off-by: Sebastien Tardif <[email protected]> Co-authored-by: Sebastien Tardif <[email protected]> Co-authored-by: Tak Hoffman <[email protected]> Co-authored-by: Takhoffman <[email protected]>
) * fix(qa-lab): retain tab focus and scroll during polling * chore(qa-lab): merge main for tab navigation validation * fix(qa-lab): keep focused tabs visible after layout changes * fix(qa-lab): reconcile navigation retention with current app * chore: refresh main for QA Lab navigation validation * commit '0001f441f53712e44b2ca6edf2a6752b8abd6d1d': (194 commits) feat(ui): listen to managed desktop audio in the panel (openclaw#157724) fix(ci): resume partially published preparation receipts (openclaw#158174) feat(release): one approval per release via an attested parent approval receipt (openclaw#157911) feat(desktop): advertise current managed desktop audio (openclaw#157723) fix(ui): retain delayed progress scroll gestures (openclaw#158153) refactor(ui): share sidebar mutation error feedback (openclaw#158173) test: await database verifier process lifecycle events (openclaw#158171) perf(update): avoid repeated retained-copy parent creation feat(desktop): bind audio streaming to screen authorization (openclaw#157722) refactor(gateway): split companion prompts and metadata fixtures (openclaw#158050) feat(desktop): isolate managed Linux application audio (openclaw#157720) fix(test): prepare catalog fixture modules before startup (openclaw#158157) fix: keep model pickers usable during provider sign-in (openclaw#158132) refactor(test): remove unused prompt scenario metadata (openclaw#158151) fix(ci): unblock Control UI targeted Crabbox gates (openclaw#158149) refactor(agents): deslop subagents, sessions, worktrees, commands and auth (openclaw#158020) fix: bound stalled browser stream startup (openclaw#156323) fix(onnx): prevent worker fixture hangs after release (openclaw#158146) fix(models): preserve scoped provider discovery outcomes (openclaw#158139) fix(agents): report offline trash failures after agent delete (openclaw#158052) ... Co-authored-by: Vincent Koc <[email protected]>
* fix(ui): release failed avatar response bodies * test(ui): cover avatar response cancellation in Chromium * test(ui): assert retained image after avatar failure * test(ui): preserve window global type in avatar proof * test(ui): avoid shadowed avatar proof bindings * chore: refresh main for avatar lifecycle validation * commit '54b5f23b006ae917c8bb7903f5ee7dad6108ec25': (175 commits) feat(ui): listen to managed desktop audio in the panel (#157724) fix(ci): resume partially published preparation receipts (#158174) feat(release): one approval per release via an attested parent approval receipt (#157911) feat(desktop): advertise current managed desktop audio (#157723) fix(ui): retain delayed progress scroll gestures (#158153) refactor(ui): share sidebar mutation error feedback (#158173) test: await database verifier process lifecycle events (#158171) perf(update): avoid repeated retained-copy parent creation feat(desktop): bind audio streaming to screen authorization (#157722) refactor(gateway): split companion prompts and metadata fixtures (#158050) feat(desktop): isolate managed Linux application audio (#157720) fix(test): prepare catalog fixture modules before startup (#158157) fix: keep model pickers usable during provider sign-in (#158132) refactor(test): remove unused prompt scenario metadata (#158151) fix(ci): unblock Control UI targeted Crabbox gates (#158149) refactor(agents): deslop subagents, sessions, worktrees, commands and auth (#158020) fix: bound stalled browser stream startup (#156323) fix(onnx): prevent worker fixture hangs after release (#158146) fix(models): preserve scoped provider discovery outcomes (#158139) fix(agents): report offline trash failures after agent delete (#158052) ... * test(ui): wait for settled avatar fallback * test(ui): wait for control UI before avatar handoff * fix(ui): preserve avatar cleanup across retry lifecycle updates Integrate current main while preserving retry exhaustion, auth restoration, and deferred response cleanup. Keep the real-stream test on real timers and drain loader cleanup before restoring shared test state. * fix(ui): integrate avatar response cleanup with current main * test(ui): align avatar cleanup proof with current harness * test(ui): qualify avatar cleanup harness types and formatting Co-authored-by: Vincent Koc <[email protected]>
* fix(ui): release failed avatar response bodies * test(ui): cover avatar response cancellation in Chromium * test(ui): assert retained image after avatar failure * test(ui): preserve window global type in avatar proof * test(ui): avoid shadowed avatar proof bindings * chore: refresh main for avatar lifecycle validation * commit '0001f441f53712e44b2ca6edf2a6752b8abd6d1d': (175 commits) feat(ui): listen to managed desktop audio in the panel (openclaw#157724) fix(ci): resume partially published preparation receipts (openclaw#158174) feat(release): one approval per release via an attested parent approval receipt (openclaw#157911) feat(desktop): advertise current managed desktop audio (openclaw#157723) fix(ui): retain delayed progress scroll gestures (openclaw#158153) refactor(ui): share sidebar mutation error feedback (openclaw#158173) test: await database verifier process lifecycle events (openclaw#158171) perf(update): avoid repeated retained-copy parent creation feat(desktop): bind audio streaming to screen authorization (openclaw#157722) refactor(gateway): split companion prompts and metadata fixtures (openclaw#158050) feat(desktop): isolate managed Linux application audio (openclaw#157720) fix(test): prepare catalog fixture modules before startup (openclaw#158157) fix: keep model pickers usable during provider sign-in (openclaw#158132) refactor(test): remove unused prompt scenario metadata (openclaw#158151) fix(ci): unblock Control UI targeted Crabbox gates (openclaw#158149) refactor(agents): deslop subagents, sessions, worktrees, commands and auth (openclaw#158020) fix: bound stalled browser stream startup (openclaw#156323) fix(onnx): prevent worker fixture hangs after release (openclaw#158146) fix(models): preserve scoped provider discovery outcomes (openclaw#158139) fix(agents): report offline trash failures after agent delete (openclaw#158052) ... * test(ui): wait for settled avatar fallback * test(ui): wait for control UI before avatar handoff * fix(ui): preserve avatar cleanup across retry lifecycle updates Integrate current main while preserving retry exhaustion, auth restoration, and deferred response cleanup. Keep the real-stream test on real timers and drain loader cleanup before restoring shared test state. * fix(ui): integrate avatar response cleanup with current main * test(ui): align avatar cleanup proof with current harness * test(ui): qualify avatar cleanup harness types and formatting Co-authored-by: Vincent Koc <[email protected]>
What Problem This Solves
openclaw agents deleteremoves the agent from the roster, then moves its workspace to Trash. When Trash fails on the offline path, cleanup stays incomplete so a later delete can retry, and--jsonincludesfailed. The text path still printed onlyDeleted agent. The operator had no path and no reason, so the leftover directory looked like a successful delete.The Gateway path already prints
Warning: path could not be moved to Trash. This change uses that same warning when the local fallback does the move. The process still exits 0 after the agent row is removed. A reachable Gateway already does that, so an unreachable Gateway should not be the only case that fails the command.User Impact
Operators using offline agent deletion now see which paths require manual cleanup and why. JSON output, exit status, and retryable cleanup state are unchanged.
Why This Change Was Made
Reuse the existing Gateway warning formatter on the offline text path so both deletion routes report failed Trash operations consistently.
Evidence
Isolated config under
/tmp/oc-f079-proof. Gateway auth mode was token with no token, so the command used the local fallback and did not contact a running Gateway. The ops workspace was marked user-immutable (chflags uchg), which makes the Trash rename returnEPERM.The workspace directory was still present after the command. The deletion journal left cleanup incomplete.
Real behavior proof
Behavior addressed: Offline
agents deletenow prints the Trash failure path and reason afterDeleted agent, using the same warning the Gateway path already prints. The command still exits 0 because the agent row is already removed.Real environment tested: macOS, Node from the worktree at
/tmp/oc-f079-agents-delete, branchfix/agents-delete-trash-warning, commandpnpm openclaw agents delete ops --forceagainst an isolated state directory.Exact steps or command run after this patch: Mark the ops workspace user-immutable, point
OPENCLAW_STATE_DIRandOPENCLAW_CONFIG_PATHat/tmp/oc-f079-proof, then runpnpm openclaw agents delete ops --force.Evidence after fix: terminal output copied below.
Observed result after fix: The text path names the workspace that stayed behind and the
EPERMreason. The directory was still on disk afterward.What was not tested: A reachable Gateway returning
failedpaths. That path already printed this warning before this change.Summary
The local text path now calls the same helper as the Gateway text path. JSON output is unchanged and still includes
failed. Cleanup stays incomplete when Trash fails, so a later delete can finish the move.Maintainer validation
Validated unchanged head 8434a69:
This supplies the measured test-cost evidence requested by the completed ClawSweeper review.