#19807: fix: apply #19779 Docker/TS strict-build fixes
channel: discord
channel: whatsapp-web
size: XS
Cluster:
Error Handling and Memory Management
## 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
#18756: fix the memory manager class hierarchy declared at the wrong level
by leoh · 2026-02-17
79.4%
#22475: fix(logging): correct levelToMinLevel mapping to match tslog numbering
by ronaldslc · 2026-02-21
73.1%
#21054: fix(cli): fix memory search hang — close undici pool + destroy QMD ...
by BinHPdev · 2026-02-19
73.0%
#20751: fix: zfs dockerfile pnpm hardlink
by cipher416 · 2026-02-19
71.6%
#23337: fix: move @discordjs/opus to optionalDependencies [AI-assisted 🤖]
by davidmckenzie · 2026-02-22
71.0%
#2609: bugfix: Docker build fails on main: .dockerignore excludes required...
by yanquankun · 2026-01-27
70.9%
#22050: Speed up docker cold start time by 6.3x.
by mm-zacharydavison · 2026-02-20
70.6%
#22491: Use multi-stage docker build to reduce image size from 4.72GB -> 2....
by mm-zacharydavison · 2026-02-21
70.5%
#20415: fix(extensions): use dist/ import paths for bundled extensions
by 88plug · 2026-02-18
70.3%
#3240: Fix Docker build failures on Windows/WSL environments
by Attili-sys · 2026-01-28
69.5%