Repository navigation
fix(docker): keep Telegram runtime dependencies in production images - #125580
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 18, 2026, 1:27 AM ET / 05:27 UTC. ClawSweeper reviewWhat this changesThe Docker dependency pruner now follows each package’s importer-relative resolution path and adds a grammY import smoke check after pruning. Regression provenancePossible regression — probable (reproduction; failure trace). No predecessor PR is attributed. Merge readinessThis PR remains necessary and appears to repair the Docker pruning owner boundary. No blocking patch defect was found; retain the exact-head runtime-image proof through merge review. Priority: P1 Review scores
Verification
Live VerificationCommand: Result: FAIL (partial) Assertions:
How this fits togetherOpenClaw’s Docker runtime-assets stage removes packages only needed by omitted bundled plugins before copying dependencies to the production Gateway image. That pruning must preserve every package a retained bundled channel needs when it loads. flowchart LR
A[Installed packages] --> B[Docker runtime-assets stage]
B --> C[Dependency pruner]
C --> D[Importer-relative closure]
D --> E[grammY import smoke check]
E --> F[Gateway production image]
Before merge
Agent review detailsSecurityNone. PR surfaceTests +139, Other +21. Total +160 across 4 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Copy recommended automerge instructionTechnical reviewBest possible solution: Keep one importer-relative physical-package closure in the pruner and verify the resolved production image still imports grammY after pruning. Do we have a high-confidence way to reproduce the issue? Yes—source-reproducible: current main’s root-only closure conflicts with the locked nested grammY dependency graph, and the linked report supplies a packaged-image reproduction path. I did not execute contributor code in this read-only review. Is this the best way to solve the issue? Yes—the pruner owns package retention, and importer-relative realpath identity fixes the conflation without adding a dependency override, runtime fallback, or Telegram-specific exception. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against c5c8a1e4c03f. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
…into fix/docker-preserve-runtime-deps
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
…w#125580) Resolve retained dependency closures from each physical importer so Docker pruning preserves concurrent nested package versions required at runtime. Add importer-bound regressions and a post-prune grammY import gate. Co-authored-by: AmAzing129 <[email protected]> Co-authored-by: Ayaan Zaidi <[email protected]>
What Problem This Solves
Fixes #125584.
The official
2026.8.1-beta.2Docker image could not start Telegram because production dependency pruning removedtr46, then grammY failed withCannot find module 'tr46'. The package existed after installation and in pnpm metadata, but was absent from the final amd64 and arm64 images. Stable2026.7.1-2did not reproduce the failure.Root Cause
The Docker plugin pruner represented dependency graph nodes by bare package name and always traversed root
node_modules. That conflated coexisting pnpm package instances:[email protected] -> [email protected] -> [email protected] -> [email protected]qa-lab -> @copilotkit/aimock -> vitest -> jsdom -> whatwg-url -> tr46The kept traversal selected root
node-fetch@3instead of grammY's nestednode-fetch@2, never discovered the retainedtr46, and classified it as omitted-plugin-only.Fix
Resolve each dependency relative to its actual importer. Track physical package instances by realpath. Remove only root package instances reached by the omitted closure and absent from every root, workspace, or retained-plugin closure. All seed paths retain their importer directory, covering version conflicts at both initial and transitive edges.
The Docker build imports
grammyafter pruning, making any future missing Telegram runtime dependency fail image construction. No directtr46dependency, compatibility path, or pruning bypass added.Production delta: +21 lines net (
Dockerfile+1; pruner +20). Test delta: +139 lines net. The production growth is the importer-relative graph identity and resolution boundary required to distinguish coexisting physical package instances.Evidence
Exact pushed head:
5e6681264458da71b8a12b69785c51481af43e34.node_modules/kept-transitiveandnode_modules/tr46.pnpm test src/plugins/prune-docker-plugin-dist.test.ts test/scripts/prune-docker-plugin-dist.test.ts src/dockerfile.test.ts— 44/44 passed across 3 Vitest shards on the exact pushed head.git diff --check— passed.main,node scripts/check-changed.mjs -- Dockerfile scripts/prune-docker-plugin-dist.mjs src/dockerfile.test.ts src/plugins/prune-docker-plugin-dist.test.tspassed, including formatting, full typecheck, lint, import-cycle, boundary, and dependency checks. The maintainer follow-up only removed an impossible empty-stack guard; the exact pushed head then passed the focused 44-test suite and Docker proof again.linux/arm64runtime-assetsimage build — passed, includingOpenClaw package dist import closure passed.The original reviewed head
19f4de265d7025451dbf84d3239f44d3532198ecalso passed an independently builtlinux/arm64runtime-assetsimage with the same package resolutions and runtime imports.AI-assisted: yes. The dependency resolution, tests, image contents, and runtime imports were reviewed and verified.