Repository navigation
refactor(errors): deslop error classification and reporting - #164244
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. Reviewed October 3, 2026, 6:26 AM ET / 10:26 UTC (Revision 2). ClawSweeper reviewWhat this changesThe branch consolidates error classification tables, formatting helpers, and script argument-error classes while preserving existing responses and retry behavior. Merge readiness⛔ Blocked before merge - 1 item remains Keep open as useful cleanup with no supported blocking finding. The earlier upgrade-proof concern does not apply: the introduced changes preserve stored payloads and error identities. Priority: P3 Review scores
Verification
How this fits togetherOpenClaw’s error helpers translate failures from providers, channels, scripts, and database workers into typed errors, retry decisions, HTTP responses, and user-facing messages. flowchart TD
A[Provider and channel failures] --> C[Error classification]
B[Database worker failures] --> D[Error identity transport]
D --> C
C --> E[Retry decisions]
C --> F[HTTP and chat messages]
G[Script argument failures] --> H[CLI error output]
Before merge
Agent review detailsSecurityNone. PR surfaceSource -144, Other -9. Total -153 across 24 files. View PR surface stats
Review metricsNone. Stored data modelPersistent data-model change detected: Technical reviewBest possible solution: Retain the existing error contracts while consolidating their duplicate representations through the current owners. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR proposes behavior-preserving cleanup rather than a reported runtime defect; this read-only review did not execute tests. Is this the best way to solve the issue? Yes: reusing existing coercers and consolidating identical classification branches is a bounded simplification, and source inspection supports preservation of the relevant contracts. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against cc1a29734ab3. LabelsLabel changes: No label changes. Label 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)
|
What Problem This Solves
Several error paths maintain redundant identities, lookup tables and formatting adapters for the same contract.
User Impact
No user-visible change. Messages, error codes, HTTP statuses, CLI exit codes, retry classification and serialized error shapes are preserved. No public plugin SDK changes or dependency changes.
Why This Change Was Made
Measured reduction: 144 production lines plus 9 tooling lines (153 total), with no tests removed or weakened. This is a single BELOW-1000 batch. Larger candidates have distinct classification, redaction, authority, lifecycle or wire contracts; the coverage record below explains retained owners. No bugs or flaky tests were changed. Five benchmark files owned by another active scripts cleanup PR are excluded from this batch.
Evidence
cd39f2c62db61e9eb8c91479ac9ed6fa51d71fbc; squash-merged as5fedfaf0a20177f29ee80c40774bfafa1e06201a. The landed tree matches the reviewed branch merged onto its actual main parent.node scripts/run-vitest.mjs src/plugins/contracts: 48 files, 1,132 tests passed again on the final head (902.35 seconds).node --import ./scripts/tsx.mjs scripts/check-madge-import-cycles.ts: 0 cycles.node --import ./scripts/tsx.mjs scripts/check-import-cycles.ts: 0 runtime value cycles.Remote proof was attempted first through the repository wrapper. Blacksmith hydration failed (run), the replacement remained queued, and direct AWS allocation was unavailable. After exceeding the remote wait budget, the authorized local fallback ran serially at
nice -n 15; test selection used one worker. No remote run is reported as passing proof.Error-pattern coverage: complete production-file reads over 200 lines, largest first
This is a repo-wide pattern lane with no exclusive directory subtree. The inventory covers error-named production owners and the formatting/classification/catch candidates discovered by call-site searches. It does not claim every unrelated monorepo file was read. Open cleanup PR files were excluded. Every listed file was read completely.
scripts/bench-gateway-concurrency.tspackages/gateway-client/src/client.tsscripts/dev/realtime-talk-live-smoke.tsshortErrorformatting and separate message-only argument failures.scripts/bench-gateway-restart.tsscripts/bench-gateway-startup.tsscripts/dev/discord-acp-plain-language-smoke.tsscripts/watch-node.mtserrorMessagedeliberately accepts plain object messages and returns empty string for other values; canonical stringification is not equivalent.src/agents/failover-error.tssrc/agents/tool-loop-detection.tspackages/gateway-client/src/protocol-client.tspackages/gateway-protocol/src/connect-error-details.tsscripts/lib/gateway-bench-runtime.tsextensions/browser/src/gateway/browser-request.tssrc/agents/bash-tools.exec-approval-followup.tsunknown errorfor cyclic serialization; canonical coercers do not have this shape. Catch wrappers own visible session-resume context and fallback authority.packages/ai/src/transports/transport-stream-shared.tssrc/agents/provider-http-errors.tspackages/memory-host-sdk/src/host/internal.tsscripts/github/guard-shared.mjssrc/infra/package-lifecycle.tssrc/gateway/server-methods/chat-send-dispatch-errors.tsscripts/dev/tui-pty-test-watch.tssrc/state/openclaw-state-worker-error.tsscripts/bench-web-fetch.tsextensions/raft/src/gateway.tssrc/gateway/server-methods/users.tsui/src/components/login-gate-feedback.tsui/src/pages/custodian/transcript.tscustodianErrorMessageinjects the translated fallback at multiple call sites; other catches carry refresh/owner outcomes.src/gateway/server-methods/themes.tssrc/infra/update-failure-report-artifact.tsscripts/gh-read.tspackages/mermaid-renderer/src/renderer.tspackages/retry/src/index.tssrc/gateway/server-methods/worktrees.tsextensions/telegram/src/network-errors.tssrc/infra/http-body.tsextensions/discord/src/monitor/provider.deploy-errors.tssrc/state/openclaw-state-worker-error-identity.tsextensions/memory-wiki/src/gateway.tssrc/gateway/ws-log.tspackages/normalization-core/src/error-coercion.tssrc/gateway/http-utils.tssrc/daemon/launchd-system.tssrc/agents/embedded-agent-helpers/error-text.tssrc/shared/assistant-error-format.tsui/src/pages/model-providers/config-mutation.tsextensions/voice-call/src/cli-gateway-call.tssrc/daemon/systemd-system.tsextensions/discord/src/monitor/thread-bindings.discord-api.tsextensions/buzz/src/gateway.tspackages/gateway-client/src/pending-request.tssrc/gateway/http-common.tsapps/shared/OpenClawKit/Sources/OpenClawKit/GatewayErrors.swiftsrc/agents/bash-tools.exec-script-preflight.tsextensions/msteams/src/errors.tssrc/auto-reply/reply/agent-runner-error-handler.tspackages/agent-core/src/harness/compaction/branch-summarization.tssrc/gateway/server-in-process-dispatch.tspackages/markdown-core/src/frontmatter.tssrc/agents/embedded-agent-runner/run/tool-error-warning.tssrc/cli/failure-output.tsextensions/codex/src/app-server/usage-limit-error.tssrc/gateway/server-methods/web-search.tspackages/gateway-protocol/src/gateway-error-details.tssrc/config/io.clobber-snapshot.tssrc/agents/tool-result-error.tssrc/provider-runtime/operation-retry.tsextensions/browser/src/browser/errors.tsextensions/workboard/src/gateway-helpers.tsextensions/discord/src/internal/rest-errors.tssrc/gateway/server-methods/sessions-groups.tsscripts/bench-model.tssrc/infra/diagnostic-error-metadata.tsextensions/diagnostics-otel/src/service-exporter.tssrc/agents/command/lifecycle.tssrc/agents/embedded-agent-error-observation.ts