Repository navigation
fix(agents): surface subagent attachment cleanup failures - #174868
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 SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 79d80510ff
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| defaultRuntime.log( | ||
| `[warn] Subagent attachment cleanup failed (${entry.runId}): ${String(error)}`, | ||
| ); |
There was a problem hiding this comment.
Emit cleanup failures at warning severity
When Gateway console capture is enabled, defaultRuntime.log delegates to console.log, which src/logging/console.ts routes as info; the textual [warn] prefix does not change that severity. Deployments using logging.level: "warn", and structured consumers filtering for warning records, therefore drop or misclassify the cleanup failure this change is intended to surface. Emit it through a subsystem logger's warn method instead.
AGENTS.md reference: AGENTS.md:L81-L81
Useful? React with 👍 / 👎.
|
Codex review: needs changes before merge. What this changesThis PR logs attachment cleanup errors with the subagent run ID while preserving the existing false return value. Example: Attachment cleanup for run-1 rejects attachmentId="invalid".
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Needs changes before merge - 1 item remains Keep this PR open: owner-level failure reporting is useful, but the added warning is emitted at info severity and disappears from warning-level logs. Priority: P2 Before merge
Findings
Tests
Agent review detailsHow this fits togetherSubagent lifecycle callers pass run identity to the registry cleanup helper, which removes generated attachment directories and reports unsuccessful cleanup. flowchart TD
A[Subagent lifecycle] --> B[Registry cleanup helper]
B --> C[Attachment cleanup owner]
C --> D[Host attachment filesystem]
C --> E[Cleanup error]
E --> F[Runtime console output]
Technical reviewBest possible solution: Emit cleanup failures through a subsystem logger's warn method and verify the record survives warning-level filtering. Do we have a high-confidence way to reproduce the issue? Source tracing establishes that a cleanup exception reaches console.log and is captured as info, so logging.level="warn" excludes it; no target code was executed. Is this the best way to solve the issue? Recording failures in the existing cleanup owner is appropriate, but using the existing subsystem warning API is necessary to fulfill the stated operator-visible behavior. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 8a2935fbfe45. Provenance checked
TestingProof path: none. SecurityNone. EvidenceAcceptance criteria:
What I checked:
Likely related people:
PR surfaceSource +3, Tests +16. Total +19 across 2 files. Added test files: 0. View PR surface stats
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 16, 2026, 8:24 PM ET / October 17, 2026, 00:24 UTC. |
|
Exact-head landing evidence for 79d8051. The attachment-cleanup owner now warns when cleanup fails instead of silently returning false. Existing deletion authority and retry/boolean behavior are unchanged. Production delta is +3 lines; the new owner regression adds16 lines. Independent P0–P2 review completed scoped-clean with final source verification, confidence0.98. Focused type-aware lint, formatting/whitespace and suppression audit3/3 passed. Local owner-test setup reached no cases under shared host load; exact-head hosted CI38985033005 completed SUCCESS and covers the regression. Final enumeration includes all203 exact-head check runs: all completed successfully or skipped, zero failed/canceled/missing jobs. Current openclaw/ci-gate, dependency-review and security-sensitive-review statuses are SUCCESS. The PR remains OPEN, ready, at the exact reviewed head; GitHub's mergeability observation is UNKNOWN/null rather than CONFLICTING. The exact-head REST merge will refuse an actual conflict. No inherited-failure exception is claimed. Native infrastructure history: two review-init attempts failed OPENCLAW_STATE_LEASE_LOST after heartbeat startup deadlines (60001ms and60004ms). Both confirmed child/process-group cleanup and released their operation locks without merge intent. The second failure specifically reported the managed-worktree allocation capacity lease lost. Both operations have joined with exit1; no uncertain merge request exists. The campaign's explicit rule10 authorizes the guarded squash merge of this reviewed exact green head after this evidence is finalized and posted. This bypasses broken native startup infrastructure, not CI or review. No CI job is rerun and no source push is made for green. |
…4868) (cherry picked from commit 7034ca4) Co-authored-by: RomneyDa <[email protected]>
Adapt 28 audited units to the release-native ownership model. Preserve AgentsAPI/cron policy and actor-owned projection recovery. Source provenance and original contributor credit: #176852 342fea1 — yinx65588-boop <[email protected]> #180853 50f795a — Peter Steinberger <[email protected]> #184041 e356196 — Peter Steinberger <[email protected]> #184069 7739767 — Peter Steinberger <[email protected]> #182666 9ff9d88 — Stefan Stüben <[email protected]> #183884 112667f — Peter Steinberger <[email protected]> #184021 05010ed — Peter Steinberger <[email protected]> #183390 15a5706 — Masato Hoshino <[email protected]> #183282 24d7dd3 — pstarkgit <[email protected]> #164843 127f3c2 — PollyBot13 <[email protected]> #172959 30f88d3 — main object unavailable; stable source inspected #172959 eb2255b — johan-eilertsen <[email protected]> #120943 1a76be1 — Peter Steinberger <[email protected]> #178271 b3c8f8a — Wang Rui <[email protected]> #178271 7bd6895 — RJ <[email protected]> #177518 679980c — Masato Hoshino <[email protected]> #182454 a538efe — Peter Steinberger <[email protected]> #180042 bef193c — sunlit-deng <[email protected]> #179347 2405bf4 — Peter Steinberger <[email protected]> #179060 ccedbdc — Peter Steinberger <[email protected]> #118011 9596527 — Peter Steinberger <[email protected]> #182219 fade14f — Sukhdeep <[email protected]> #181871 b1b5f00 — Peter Steinberger <[email protected]> #178888 5125e3c — RoboClaw <[email protected]> #180075 c9c2d16 — Wang Rui <[email protected]> #181081 f223f77 — Jason O'Neal <[email protected]> #180236 d11c239 — Dallin Romney <[email protected]> #173921 af50fbd — Peter Steinberger <[email protected]> #174868 7034ca4 — Peter Steinberger <[email protected]> #172724 492c932 — Dallin Romney <[email protected]> Proof: targeted owner/sibling tests, supported fresh two-pass review clean. Known qualification gaps recorded in the release backport evidence. Co-authored-by: RomneyDa <[email protected]>
What Problem This Solves
Subagent attachment cleanup failures can disappear when a caller ignores the helper's
falseresult.User Impact
Operators receive a warning identifying the run and cleanup error. Failed cleanup still leaves attachments retained, and the existing boolean result/retry behavior is unchanged.
Why This Change Was Made
Record the failure in the cleanup owner instead of relying on every caller to inspect its result. The regression exercises a real generated-identity rejection before filesystem traversal. Existing generated-root isolation, legacy-path refusal, deletion and current-authority checks remain unchanged. No configuration, persisted schema, protocol, dependency, public SDK or protected Phase E memory change.
Best-effort tradeoffs accepted
No guard is removed. Cleanup remains best effort and still returns
falseon failure; it now records that intentional non-outcome. The warning does not introduce another cleanup attempt or weaken deletion authority.Evidence
Production: +3 net lines, one owner; tests: +16 lines. This is the campaign's small real-bug-fix exception, not a claimed cleanup reduction.
Formatting, diff-whitespace checks and two-file type-aware lint pass. The suppression audit passes all three tests (202.51 seconds Vitest; 280.20 seconds including the wrapper). The production diff adds no import or dependency edge.
The isolated owner-test attempt reached no test cases: it spent 171.5 seconds waiting for a cache miss, then over seven minutes preparing compiled workers under shared host load. Its owned compiler was interrupted and joined; the wrapper exited 2 with a compiled-subprocess exit-130 setup failure. This is a recorded tooling/load failure, not passing behavior proof or an assertion failure. No timeout, retry, skip or suppression was added. Runtime/test commands use isolated HOME/OpenClaw/XDG state and maxWorkers1, serially. Exact-head PR CI is the broad gate, including the unchanged owner suite and new warning regression. Independent P0–P2 review completed scoped-clean after final source verification.