Repository navigation
fix(webchat): retain failed-turn diagnostics for debugging - #155378
freeqaz-openai wants to merge 4 commits into
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: blocked before merge. What this changesThe branch retains longer redacted failed-turn details, adds run-correlated error logging, and gives WebChat failure notices expandable details and copy actions. Review scores
Merge readiness⛔ Blocked before merge - 5 items remain The central diagnostic-retention gap remains on current main, and this protected PR contains useful work. No definite introduced bug was found, but integration and required validation remain incomplete. Priority: P2 Before merge
FindingsNone. Agent review detailsHow this fits togetherGateway failure settlement writes diagnostic receipts into session history and records errors in rotating logs. WebChat displays those receipts and exposes run IDs for operator log lookup. flowchart TD
A[Failed agent turn] --> B[Gateway failure settlement]
B --> C[Redacted session receipt]
B --> D[Redacted rotating logs]
C --> E[History display projection]
E --> F[WebChat error details]
F --> G[Copy diagnostic or run ID]
Technical reviewBest possible solution: Extend the existing failure-receipt and logging owners while preserving current-main settlement safeguards, bounded history responses, and redacted copy output. Do we have a high-confidence way to reproduce the issue? Yes, by source: current main truncates saved failure details at 512 characters, so a longer diagnostic loses its tail before WebChat can display it. No runtime reproduction was executed. Is this the best way to solve the issue? Yes, the existing receipt, display-projection, and logging owners are appropriate boundaries; integration and executed validation are still needed to establish the final result. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 27ba9720f2c5. Merge-risk optionsMaintainer options:
SecurityNone. EvidenceWhat I checked:
PR surfaceSource +221, Tests +347, Docs +18. Total +586 across 36 files. View PR surface stats
Review metrics
LabelsLabel changes: No label changes. Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
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 HistoryReview history (9 earlier review cycles; latest 8 shown)
Reviewed October 6, 2026, 10:50 PM ET / October 7, 2026, 02:50 UTC (Revision 10). |
What Problem This Solves
A turn can fail before replying and save only the first 512 characters of its error, cutting off the cause. Expanding the UI cannot recover that discarded text. Sandbox startup failures also resolve through the agent runner's error-reply path, so logging only rejected
chat.sendcalls misses their original exceptions.User Impact
Failed turns retain up to 10,000 characters of redacted, multiline detail across history refreshes. The notice starts compact; Details expands it, Copy error copies the retained text, and Copy run ID provides the reference for operator log lookup.
Identical failures from different runs remain separate so each log reference stays accessible. Duplicate receipts from the same run retain their accessible ×N count. Card and context-menu copy actions use the same redacted display text.
Why This Change Was Made
One logging helper captures original errors at chat setup/dispatch catches and at terminal agent failure settlement. It preserves available native stacks and nested causes in the existing rotating logs, with a 100,000-character cap after redaction. Disabled logging skips the capture; logging failure cannot change turn settlement. Retry attempts and cancellation behavior are unchanged.
The existing Run ID correlates the notice with these records; it is separate from an OpenTelemetry trace ID. Logs follow existing access and retention settings, so retrieval is best effort. The 160-character session summary, history privacy filters, and explicit history request limits remain in place.
This improves failure diagnosis. It does not repair the underlying container/network failure or recover text discarded by an older version.
Evidence
git diff --check: passed.executeAgentTurnsandbox failure path: a resolved failure reply, startup and cleanup causes, more than 10k of retained log detail, Run ID correlation, and redaction read back from the file logger. Serializer edge cases live in focused logging tests instead of being repeated across the settlement matrix.session-transcript-message.test.ts:98); source readback resolved it without changes. Reviews did not execute tests or render the UI.Executable validation remains blocked. A fresh
pnpm install --frozen-lockfilestill receives HTTP 403 for@openclaw/[email protected]from the configured dependency firewall. Focused tests and the changed-check planner stop at missing-dependency bootstrap. The tests above are authored coverage, not passing results. Typecheck, build, i18n verification, measured test timings, and inspected before/after UI screenshots remain outstanding. Main CI is skipped while this PR is a draft. The PR remains a draft until that evidence is available.