Skip to content

fix(provider) add full dependencies to Docker image#1508

Open
ekzhu wants to merge 6 commits intoagentscope-ai:mainfrom
ekzhu:claude/fix-missing-ollama-dependency-kCNkv
Open

fix(provider) add full dependencies to Docker image#1508
ekzhu wants to merge 6 commits intoagentscope-ai:mainfrom
ekzhu:claude/fix-missing-ollama-dependency-kCNkv

Conversation

@ekzhu
Copy link
Collaborator

@ekzhu ekzhu commented Mar 15, 2026

Description

The Docker image is missing many dependencies. Added "full" extra so it install all dependencies.

Additionally, 7 third-party packages used by core code and built-in skills were never declared as dependencies in pyproject.toml:

  • python-frontmatter — imported at module level in skills_manager.py and skills_hub.py (causes crash on import without it)
  • defusedxml — used across 21 files in docx/xlsx/pptx skill scripts for secure XML parsing
  • lxml — used in 6 validator files across docx/xlsx/pptx skills
  • pypdf — used in PDF skill scripts (form filling, field extraction)
  • pdf2image — used for PDF-to-image conversion
  • pdfplumber — used for PDF form structure extraction
  • openpyxl — used in Excel recalc skill script

Related Issue: N/A

Security Considerations: N/A

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation
  • Refactoring

Component(s) Affected

  • Core / Backend (app, agents, config, providers, utils, local_models)
  • Console (frontend web UI)
  • Channels (DingTalk, Feishu, QQ, Discord, iMessage, etc.)
  • Skills
  • CLI
  • Documentation (website)
  • Tests
  • CI/CD
  • Scripts / Deploy

Checklist

  • I ran pre-commit run --all-files locally and it passes
  • If pre-commit auto-fixed files, I committed those changes and reran checks
  • I ran tests locally (pytest or as relevant) and they pass
  • Documentation updated (if needed)
  • Ready for review

Testing

  1. Build the Docker image and verify import ollama succeeds inside the container
  2. Do a fresh pip install . from pyproject.toml and verify python -c "import frontmatter" succeeds
  3. Run built-in PDF, DOCX, XLSX, and PPTX skills in the Docker image to confirm document-processing dependencies resolve
  4. Run pytest to check for regressions

Local Verification Evidence

pre-commit run --all-files
# paste summary result

pytest
# paste summary result

claude and others added 2 commits March 15, 2026 00:35
The Dockerfile was installing only base dependencies (`pip install .`),
missing the ollama Python SDK which is an optional extra. Changed to
`pip install '.[ollama]'` so the Docker image includes ollama support
out of the box.

Also added several third-party packages to base dependencies that were
imported unconditionally but never declared: python-frontmatter (used in
skills_manager.py and skills_hub.py), and document-processing libraries
used by built-in skills (defusedxml, lxml, pypdf, pdf2image, pdfplumber,
openpyxl).

https://claude.ai/code/session_01GFwf7ZkAsLFNxqSATvL13w
Copilot AI review requested due to automatic review settings March 15, 2026 02:38
@ekzhu ekzhu requested a deployment to maintainer-approved March 15, 2026 02:38 — with GitHub Actions Waiting
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses critical dependency issues, ensuring the proper functioning of the application both within Docker containers and in local installations. It specifically resolves the omission of the ollama Python SDK in the Docker image and integrates several essential third-party libraries into pyproject.toml that are required by core code and various document-processing skills.

Highlights

  • Docker Image Dependencies: Updated the Dockerfile to install the ollama Python SDK by changing pip install . to pip install '.[ollama]', ensuring the optional dependency is included in the container.
  • Core and Skill Dependencies: Added seven previously undeclared third-party packages (python-frontmatter, defusedxml, lxml, pypdf, pdf2image, pdfplumber, openpyxl) to pyproject.toml to resolve runtime issues and support various built-in skills (e.g., PDF, DOCX, XLSX).

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • deploy/Dockerfile
    • Modified the pip install command to include the ollama extra dependency.
  • pyproject.toml
    • Added python-frontmatter to the main dependencies list.
    • Added defusedxml to the main dependencies list.
    • Added lxml to the main dependencies list.
    • Added pypdf to the main dependencies list.
    • Added pdf2image to the main dependencies list.
    • Added pdfplumber to the main dependencies list.
    • Added openpyxl to the main dependencies list.
Activity
  • The author has performed local pre-commit checks and pytest runs, confirming no regressions.
  • The pull request is marked as ready for review.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Generative AI Prohibited Use Policy, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request correctly addresses missing dependencies for ollama and various built-in skills. The Dockerfile is updated to install optional ollama dependencies, and pyproject.toml is updated with several packages required for document processing skills. The changes are logical and well-explained. I have one minor suggestion to improve code maintainability by sorting the newly added dependencies.

@ekzhu ekzhu temporarily deployed to maintainer-approved March 15, 2026 02:42 — with GitHub Actions Inactive
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates packaging and container build so runtime dependencies required by built-in skills and the Ollama provider are present by default, avoiding import/runtime failures in common deployments (notably Docker).

Changes:

  • Add several previously-undeclared third-party libraries to pyproject.toml runtime dependencies (frontmatter, XML/PDF/Excel-related).
  • Update Docker image build to install the project with the ollama extra (pip install '.[ollama]') so the Ollama Python SDK is included.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
pyproject.toml Declares additional runtime dependencies used by core modules and built-in skill scripts.
deploy/Dockerfile Installs the package with the ollama extra so import ollama works inside the container.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings March 15, 2026 08:10
@ekzhu ekzhu temporarily deployed to maintainer-approved March 15, 2026 08:10 — with GitHub Actions Inactive
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes missing runtime dependencies by declaring several third-party libraries in the base pyproject.toml dependencies (used by core skills/skills hub and built-in document/PDF skills) and ensuring the Docker image includes the ollama Python SDK by installing the ollama extra.

Changes:

  • Add missing document/PDF/skills-hub Python dependencies to pyproject.toml (e.g., python-frontmatter, defusedxml, lxml, pypdf, etc.).
  • Update Docker image to install copaw with the ollama extra (pip install '.[ollama]').
  • Add system packages in Docker needed by document/PDF tooling (poppler-utils, libreoffice).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
pyproject.toml Declares previously-undeclared third-party dependencies used by core skills hub/manager and built-in document/PDF skills.
deploy/Dockerfile Installs copaw with the ollama extra and adds OS packages needed for PDF/image and Office conversions.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ekzhu ekzhu changed the title (Fix) add missing ollama and other dependencies fix(provider) add missing ollama and other dependencies Mar 15, 2026
@ekzhu ekzhu requested a deployment to maintainer-approved March 16, 2026 03:11 — with GitHub Actions Waiting
@ekzhu ekzhu changed the title fix(provider) add missing ollama and other dependencies fix(provider) add full dependencies to Docker image Mar 16, 2026
Copilot AI review requested due to automatic review settings March 16, 2026 09:06
@ekzhu ekzhu requested a deployment to maintainer-approved March 16, 2026 09:06 — with GitHub Actions Waiting
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates packaging and the Docker runtime image to ensure document-processing skills and provider integrations have required Python and OS-level dependencies available at install/build time.

Changes:

  • Declare several previously-undeclared third-party Python dependencies in pyproject.toml (XML/Office/PDF + frontmatter/YAML).
  • Install additional OS packages in the Docker image to support PDF/image conversion and Office conversions.
  • Switch Docker build to install the project with the full extra (pip install '.[full]').

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
pyproject.toml Adds missing runtime dependencies and confirms full extra definition.
deploy/Dockerfile Installs Poppler + LibreOffice and switches pip install to .[full] for a more feature-complete image.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +44 to +45
poppler-utils \
libreoffice \
# Inject console dist from build stage (repo does not commit dist).
COPY --from=console-builder /app/console/dist/ ./src/copaw/console/
RUN pip install --no-cache-dir .
RUN pip install --no-cache-dir '.[full]'
"pdfplumber>=0.10.0",
"pypdf>=4.0.0",
"python-frontmatter>=1.1.0",
"PyYAML>=6.0.0",
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants