Repository navigation
fix: preserve failure causes after repeated warnings - #187779
roboclaw-bot wants to merge 1 commit into
Conversation
Worked on by: - @TheAngryPit Co-authored-by: TheAngryPit <[email protected]> OpenClaw-Publication: 64c3bead-82bc-41c1-a9d3-67222724163c
|
🦞👀 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. What this changesThis PR preserves the beginning and terminal cause of long failure notices within the existing 512-character limit. Example: Twenty allocator warnings precede “Cloud workspace reconciliation exceeds the 25000 entry limit.”
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Needs changes before merge - 1 item remains Keep open: this PR fixes a current diagnostic-loss bug, but two subagent regression cases still expect the replaced truncation behavior and fail CI. Priority: P2 Before merge
Findings
Tests
Agent review detailsHow this fits togetherGateway lifecycle and subagent settlement pass failure diagnostics to the shared session-error writer, which redacts and bounds text before appending a saved conversation notice. flowchart TD
A[Gateway lifecycle failure] --> C[Shared session error writer]
B[Subagent failure settlement] --> C
C --> D[Redact diagnostic]
D --> E[Bound head and tail]
E --> F[Saved transcript notice]
F --> G[Conversation history]
Technical reviewBest possible solution: Keep the shared bounded formatter and update the subagent receipt regression to verify the intended output independently. Do we have a high-confidence way to reproduce the issue? Current main truncates sanitized notices to their first 512 UTF-16 units, necessarily dropping a terminal cause after a longer warning prefix; the body reports matching red/green persistence tests, but this review executed no target code. Is this the best way to solve the issue? The patch uses the smallest existing owner for the defect: one shared UTF-16-safe truncation policy preserves terminal causes while keeping redaction, limits, and specialized failure guidance intact. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 76985e4c31c4. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceAcceptance criteria:
What I checked:
PR surfaceSource +4, Tests +12, Other +2. Total +18 across 4 files. Added test files: 0. View PR surface stats
LabelsLabel changes: No label 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 29, 2026, 12:28 PM ET / 16:28 UTC. |
|
Closing as superseded. Superseded by #187883. Bounded, redacted head/tail diagnostics retain terminal causes. Current visible notices deliberately use concise failure copy instead of raw warning/error text, so the older visible-message contract should not be restored. This closes the PR without deleting its branch. |
Related: #155378. This is a small existing-limit fix, not a replacement for @freeqaz-openai's broader diagnostics draft.
What Problem This Solves
Fixes failed-request notices losing their terminal error reason when repeated launcher warnings fill the beginning of the diagnostic.
User Impact
Users retain both initial context and the terminal diagnosis in the saved failure notice. The existing 512-character diagnostic limit and 160-character session-row limit remain unchanged, and redaction still happens before truncation.
This does not repair the host's jemalloc profiling setup or establish why every affected request failed. There are no configuration, schema, permission, retry, or failure-settlement changes.
Why This Change Was Made
Session rows already retain the beginning and end of long errors, while saved failure notices keep only the beginning. Reuse that UTF-16-safe truncation policy for both surfaces instead of introducing another formatter, increasing retention, or suppressing warnings. Short errors and specialized storage-failure guidance remain unchanged.
Evidence
pnpm test src/gateway/session-lifecycle-run-failure.test.ts src/sessions/session-run-error.test.ts --maxWorkers=1passed 43 tests across the Gateway lifecycle/persistence and session-error owner suites. This exercises the real lifecycle writer and persisted failure report, not a precomputed summary.92d61ac49882c9c8c815cf5d24dbe145a47f4238at its default P0 scope. Review is incomplete: the reviewer command was terminated after repeated jemalloc warnings exhausted its bounded output capture (exit 143, output-limit flag set). There is no clean review verdict. Independent review and broad CI remain outstanding; the requester has asked to open the PR for review.Incident report and operator follow-up
On 2026-10-29, repeated Team webchat errors showed only:
The reported payload was exactly 512 characters and matched a prefix-only cut through the repeated warnings. An independent tiny exec command returned exit code zero with both expected stdout/stderr markers while its captured output also contained 17 fresh profile-open warnings. Warnings therefore do not, by themselves, prove that jemalloc caused the request failure.
An inspected sandbox Node process had neither jemalloc environment settings nor a jemalloc mapping, although warnings appeared before its output. The emitting executable in the host-side launch/bridge chain still needs to be identified. The profile directory was absent inside the sandbox; this does not establish its existence or permissions on the host or in a service-private filesystem namespace.
The operator should inspect the actual emitting process's profiling configuration and hooks. Disable unintended profiling, or provision a private service-writable profile directory in the correct namespace with bounded retention if profiling is intentional. Keep jemalloc itself if it is deliberately used as the allocator. Do not create a world-writable profile directory or treat a sandbox-only directory as a host fix.
The same warning flood reproduced an actual helper failure during independent AutoReview: the helper exceeded its bounded output capture and was terminated. This establishes one failure mechanism in this investigation, not the retrospective cause of every reported request failure.
Correlate one actual failed request with the complete Gateway/helper error, process identity, exit status or signal, and effective profiling configuration. This separates profiling-caused failures from unrelated failures hidden behind profiler output.
Work sessions
Worked on by