← Back to PRs

#19807: fix: apply #19779 Docker/TS strict-build fixes

by dalefrieswthat open 2026-02-18 05:52 View on GitHub →
channel: discord channel: whatsapp-web size: XS
## Summary - **Problem:** Docker build fails at `RUN pnpm build` with TS errors (TS2322, TS2345/TS1345) under strict TS (e.g. TS 5.9). - **Why it matters:** Blocks Docker image build for contributors and local deployment. - **What changed:** Three strict-TS fixes: (1) `src/web/media.ts` — narrow `maxBytesOrOptions` to `number | undefined` before passing to internal loader; (2) `src/auto-reply/reply/block-reply-pipeline.ts` — wrap `onBlockReply(...)` in `Promise.resolve()` for `withTimeout`; (3) `src/discord/monitor/native-command.ts` — use `updated === null` instead of `!updated`. - **What did NOT change:** No tsconfig relaxation, no other files, no behavior change. - **Not addressed (intentionally):** The PARSE_ERROR in `pi-tools.before-tool-call.ts` (already fixed on `main`); TS7011/TS2339/`.catch()` return types (don't block the current build). If those resurface under a different toolchain, they can be addressed in a follow-up. ## Change Type (select all) - [x] Bug fix - [ ] Feature - [ ] Refactor - [ ] Docs - [ ] Security hardening - [ ] Chore/infra ## Scope (select all touched areas) - [ ] Gateway / orchestration - [ ] Skills / tool execution - [ ] Auth / tokens - [ ] Memory / storage - [x] Integrations - [ ] API / contracts - [ ] UI / DX - [x] CI/CD / infra ## Linked Issue/PR - Closes #19779 - Related # ## User-visible / Behavior Changes None. ## Security Impact (required) - New permissions/capabilities? No - Secrets/tokens handling changed? No - New/changed network calls? No - Command/tool execution surface changed? No - Data access scope changed? No - If any Yes, explain risk + mitigation: N/A ## Repro + Verification ### Environment - OS: macOS; Docker (node:22-bookworm) - Runtime/container: Node 22 - Model/provider: N/A - Integration/channel: N/A - Relevant config: N/A ### Steps 1. Apply the three file changes. 2. `pnpm build` 3. `docker build -t openclaw:build-test .` ### Expected Build and Docker build succeed. ### Actual Both succeed. ## Evidence - [x] Failing test/log before + passing after (issue #19779 vs post-fix build) ## Human Verification (required) - Verified: `pnpm build`, relevant tests, full Docker build. - Edge cases: media callers unchanged; block-reply handles void/Promise; Discord only treats `null` as failure. - Not verified: Windows Docker; long-running production. ## Compatibility / Migration - Backward compatible? Yes - Config/env changes? No - Migration needed? No - If yes, exact upgrade steps: N/A ## Failure Recovery (if this breaks) - Revert the one commit (3 files). No config to restore. - Watch for: TS or runtime errors in web media, block-reply timeout path, or Discord command-arg update. ## Risks and Mitigations - Stricter `updated === null`: could differ if caller ever returned `undefined` on failure. Mitigation: `safeDiscordInteractionCall` returns only `T | null`; no behavior change.

Most Similar PRs