Repository navigation
feat(office): bundle DSH's Python runtime and Office skills - #1692
Conversation
Ship the same Python payload DSH's own desktop app bundles and mount DSH's Word, PowerPoint and Excel skills on it, replacing PawWork's v1-era office-docx/pptx/xlsx skills. Why: PawWork's Office skills fetched python-docx and friends through `uv run` on first use, from PyPI and GitHub. From mainland China and behind company proxies that is slow or fails outright, mid-task, where neither the user nor the model can tell why. DSH now maintains Office skills of its own that author with a bundled interpreter and check the result visually with the LibreOffice engine PawWork already ships (DSH 0.1.7's libreoffice-kit, ~147MB), so following upstream both removes the network dependency and hands the skills' upkeep to DSH. - scripts/prepare-primary-runtime.ts assembles resources/runtime/ primary-runtime from primary-runtime.lock.json, a verbatim copy of deepseek-harness scripts/primary-runtime/lock.json at 477b4f4205: python-build-standalone CPython 3.12.14 plus 13 pinned wheels (numpy, pandas, python-docx, python-pptx, openpyxl, Pillow, lxml, XlsxWriter and dependencies), every archive sha256-verified, unpacked the way upstream's prepare.ts does, in the runtime.json + dependencies/python layout dsh-tool-workspace-dependencies reads. Python-only: PawWork already runs Node through its own executable. On a native target it imports every library and runs `pip check`. CI and the release workflow run it next to prepare-uv. - The product bundle mounts dsh-tool-workspace-dependencies (source: the packaged payload, via PAWWORK_PRIMARY_RUNTIME; root: dsh-runtimes/ dsh-primary-runtime under the DSH home, where it is copied on first use as upstream does, since the app bundle is signed and read-only) and dsh-skill-office with node set to the app executable, which the agent shell runs as Node; inside Electron the plugin will not guess one. - skills/office-docx, office-pptx and office-xlsx are removed; DSH's skills register the same names. office-pdf stays: DSH has no PDF skill. - uv stays for `uvx` MCP servers and the PDF skill. Cost: +189MB unpacked on macOS arm64 (about 60MB compressed download). Verified on a raw Electron build: CI smoke with CDP passes; with a real model (opencode-go-deepseek/deepseek-v4.1-flash) the agent called load_workspace_dependencies, wrote quarterly.docx with the bundled python-docx, converted it with the bundled LibreOffice Kit through the app executable as Node, rendered page 1 to PNG and checked it (12 steps, 110 s); the rendered page shows the title, heading and 3-column table. The payload also validates against the tool's own resolvePrimaryRuntime.
There was a problem hiding this comment.
Suggested priority: P2 (includes user-path files (packages/desktop-electron/resources/dsh/bundle/cordis.patch.yml, packages/desktop-electron/src/main/dsh-product-home.test.ts, packages/desktop-electron/src/main/dsh-product-home.ts, packages/desktop-electron/src/main/index.ts)).
P1/P0 are reserved for maintainer confirmation. Please relabel manually if this is a release blocker, security issue, data-loss risk, or updater/runtime failure.
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: Astro-Han/pawwork/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (63)
💤 Files with no reviewable changes (45)
Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review. 📝 WalkthroughWalkthroughDesktop builds now prepare and package a locked Python runtime alongside uv, then pass its path to DSH plugins. The repository removes the previous vendored Word, PowerPoint, and Excel skill files and updates documentation about the Office and PDF skill runtimes. ChangesOffice runtime and skills
Estimated code review effort: 4 (Complex) | ~60 minutes Sequence Diagram(s)sequenceDiagram
participant launchDsh
participant resolveProductResources
participant buildDshEnvironment
participant WorkspaceDependencies
launchDsh->>resolveProductResources: Resolve skills and primary runtime paths
resolveProductResources->>launchDsh: Return product resources
launchDsh->>buildDshEnvironment: Pass product resources
buildDshEnvironment->>WorkspaceDependencies: Set PAWWORK_PRIMARY_RUNTIME
Merge Risk: ⚪ Minimal · up to The supported macOS and Windows packaging paths are not affected by the Linux concern, and the replacement Office skills are registered. No identified issue prevents merging. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 7.69% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 13 functions across 8 files. (10 skipped: 10 unsupported.)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
PR Summary by QodoBundle DSH Python Runtime and Offline Office Skills
AI Description
Diagram
High-Level Assessment
Files changed (17)
|
Code Review by Qodo
1.
|
…on Windows Git Bash's GNU tar parses a C:\ archive path as host:file and fails with 'Cannot connect to C: resolve failed'.
…dows Git Bash puts GNU tar first on PATH. It reads a C:\ archive as host:file and escapes a D:\ -C target into a path that does not exist, so a relative archive name alone does not help. Windows ships bsdtar as System32\tar.exe, which takes drive-letter paths and gzip.
…me prep A cache entry left truncated by an interrupted build failed the checksum on every later run; it is now re-downloaded instead. The cache hit no longer rewrites the file. pnpm dev:desktop does not download uv or the Python payload, so CONTRIBUTING now names the two prepare commands for developers who need the Office and PDF skills, and its skills row reflects that Word, PowerPoint and Excel come from DSH.
Summary
Bundle the same Python payload DSH's own desktop app ships and switch PawWork's Word, PowerPoint and Excel skills to DSH's
dsh-skill-office, so Office tasks work offline instead ofuv run-installing libraries from PyPI/GitHub mid-task (slow or failing from mainland China and behind company proxies).scripts/prepare-primary-runtime.tsbuildsresources/runtime/primary-runtimefromprimary-runtime.lock.json, a verbatim copy of upstream'sscripts/primary-runtime/lock.json(CPython 3.12.14 from python-build-standalone + 13 pinned, sha256-verified wheels), in the layoutdsh-tool-workspace-dependenciesreads. Runs in CI and the release workflow next toprepare-uv.dsh-tool-workspace-dependencies(copied to<DSH home>/dsh-runtimes/dsh-primary-runtimeon first use, as upstream does) anddsh-skill-office(LibreOffice Kit run through the app executable as Node).skills/office-docx,office-pptx,office-xlsx(same names as DSH's); keepsoffice-pdf. uv stays foruvxand the PDF skill.Verification
pnpm run typecheck,pnpm testpass; new tests pin the lock's per-target coverage and that the payload paths equal what the upstream tool resolves.load_workspace_dependencies, wrote a .docx with the bundled python-docx, converted it with the bundled LibreOffice Kit and rendered page 1 for a visual check (12 steps, 110 s). Rendered output checked by eye.dev-channel macOS arm64 build of this branch (no publish target) is running to confirm the Python binaries survive Apple notarization; results will be posted here.Summary by CodeRabbit
uv.