Skip to content

fix(gateway): log swallowed background-task finalization errors#92033

Merged
vincentkoc merged 1 commit into
openclaw:mainfrom
hansraj316:fix/gateway-task-finalize-log
Jun 10, 2026
Merged

fix(gateway): log swallowed background-task finalization errors#92033
vincentkoc merged 1 commit into
openclaw:mainfrom
hansraj316:fix/gateway-task-finalize-log

Conversation

@hansraj316

Copy link
Copy Markdown
Contributor

Summary

Background-task finalization swallowed all errors, including non-transient ones. Log the swallowed error via formatForLog at warn so failures are observable, while staying non-blocking.

  • Files: src/gateway/server-methods/agent.ts
  • No CHANGELOG.md edit (release-only per AGENTS.md).

Why core (not ClawHub)

Core correctness fix touching src/gateway/server-methods/agent.ts — per AGENTS.md these stay in core (security/core hardening, bundled regressions, missing core APIs), not optional skill bundles routed to ClawHub.

Verification

  • node scripts/run-vitest.mjs run src/gateway/server-methods/agent.test.ts => 302 passed
  • pnpm tsgo:core (tsconfig.core.json) => clean
  • oxfmt --check + oxlint on touched files => clean

Real behavior proof

  • Behavior addressed: Non-transient background-task finalization failures are now logged (redacted via formatForLog) instead of silently dropped; the run still completes.
  • Real environment tested: macOS (Darwin 25.3.0); OpenClaw at base 2accfee; Node 22; Vitest via scripts/run-vitest.mjs.
  • Exact steps or command run after this patch: node scripts/run-vitest.mjs run src/gateway/server-methods/agent.test.ts
  • Evidence after fix: 302 tests pass, incl. a new case: a thrown finalize error is logged at warn without blocking the run.
  • Observed result after fix: Both finalize/start catch sites covered; logging is non-blocking; uses the already-imported formatForLog (redaction applied once).
  • What was not tested: Full Crabbox/live gateway E2E; Linux CI.. Independently reviewed by a separate agent before commit; not yet run through Crabbox/$autoreview.

🤖 Generated with Claude Code

Background-task finalization swallowed all errors. Log via formatForLog at
warn so non-transient failures are observable, staying non-blocking.
@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime size: S triage: mock-only-proof Candidate: PR proof only shows tests, mocks, snapshots, lint, typecheck, or CI. labels Jun 10, 2026
@vincentkoc vincentkoc self-assigned this Jun 10, 2026
@vincentkoc

Copy link
Copy Markdown
Member

Maintainer verification complete.

  • Rebased onto current origin/main.
  • Focused proof: node scripts/run-vitest.mjs src/gateway/server-methods/agent.test.ts — 304 tests passed.
  • Fresh autoreview: clean, no accepted/actionable findings.
  • Errors use the existing redacting/length-bounding formatter and do not suppress the successful terminal response.

@vincentkoc
vincentkoc merged commit b9e1099 into openclaw:main Jun 10, 2026
178 of 183 checks passed
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jun 11, 2026
…claw#92033)

Background-task finalization swallowed all errors. Log via formatForLog at
warn so non-transient failures are observable, staying non-blocking.
badgerbees pushed a commit to badgerbees/openclaw that referenced this pull request Jul 8, 2026
…claw#92033)

Background-task finalization swallowed all errors. Log via formatForLog at
warn so non-transient failures are observable, staying non-blocking.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gateway Gateway runtime size: S triage: mock-only-proof Candidate: PR proof only shows tests, mocks, snapshots, lint, typecheck, or CI.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants