Skip to content

fix(mirage)!: support mirage-ai 0.1.0 and require Python 3.12 - #4367

Open
Mkhoa161 wants to merge 1 commit into
deepset-ai:mainfrom
Mkhoa161:fix/mirage-ai-0.1.0
Open

Mkhoa161 wants to merge 1 commit into
deepset-ai:mainfrom
Mkhoa161:fix/mirage-ai-0.1.0

Conversation

@Mkhoa161

Copy link
Copy Markdown

Related Issues

Proposed Changes:

mirage-haystack pins mirage-ai==0.0.3; with mirage-ai 0.1.0 it fails at import. This moves the integration to Mirage 0.1.0 and the pin to mirage-ai==0.1.0.

API moves:

  • mirage.resource.registry.build_resource → mirage.vfs.registry.build_vfs; MirageMount.available_resources() returns known_vfs_names()
  • Workspace.execute(command) → Workspace.shell(command)
  • Workspace(cache_limit=...) → Workspace(cache=CacheConfig(limit=...))

Behaviour kept the same on 0.1.0:

  • resource takes only Mirage registry names. build_vfs also loads a "module:Class" reference, so other values are refused with Unknown Mirage resource before building.
  • run_async runs on the integration's background loop, as run does. Mirage 0.1.0 ties a workspace to the event loop that first drives it, so a sync close() after run_async in a running loop waited 10 s for its own loop.

Python: mirage-ai 0.1.0 requires Python 3.12, so requires-python, the classifiers, the ruff target and the CI matrix move from 3.11 to 3.12, as llama_stack does.

Tests: the Google Drive integration test passes the CI token as Mirage's access_token config, which 0.1.0 accepts, instead of patching refresh_access_token; the read-only test matches Mirage's Read-only file system; new tests cover the refused module:Class resource, close() after run_async, and cache_limit reaching Mirage.

The integration's own API is unchanged (MirageMount, MirageWorkspace, MirageShellTool).

mirage-ai 0.1.0 no longer depends on jq, which #4110 lists as Mirage's blocker for Python 3.15.

Breaking for users:

  • Python 3.11 is no longer supported.
  • Mirage 0.1.0 refuses config keys a backend does not define, and removed some (e.g. linear.workspace, postgres.default_search_limit), so a saved pipeline with one fails at warm-up with MirageConfigError.

How did you test it?

In integrations/mirage:

  • hatch run test:unit: 48 passed on Python 3.12 and 3.14
  • hatch run fmt-check and hatch run test:types on 3.12: clean
  • the CI lowest-direct step on 3.12 (haystack-ai 2.23.0, mirage-ai 0.1.0): 48 passed
  • the two Google Drive integration tests need the CI token and were not run locally

Notes for the reviewer

I work on Mirage. As a follow-up (a separate PR, after this one), we'd like to propose:

  • Seven tools instead of one shell tool: expose Mirage's agent tools (shell, read, write, edit, ls, grep, glob) as a Toolset, in the shape of the E2B integration's.
  • Mirage's profile rules in place of the text guard: pass a Mirage session profile (allow, deny and ask per command, hidden paths) instead of matching command text with allowed_commands and denied_paths. Mirage enforces it on each command as it runs, so eval "rm x", xargs rm and bash -c "rm x" are refused, and a hidden path is closed to every tool. The existing parameters can map onto a profile, and a Mirage "ask" could surface through Haystack's human-in-the-loop confirmation.

Happy to open an issue to discuss it first.

Checklist

mirage-haystack pinned mirage-ai==0.0.3 and failed at import with mirage-ai
0.1.0. Move to the 0.1.0 APIs (build_vfs, known_vfs_names, Workspace.shell,
CacheConfig) and pin mirage-ai==0.1.0, which requires Python 3.12.

- Refuse a resource that is not a Mirage registry name; build_vfs also loads
  "module:Class" references.
- Run run_async on the integration's background loop, so a sync close() after
  it does not wait on the caller's loop.
- The Google Drive integration test passes the CI token as Mirage's
  access_token config instead of patching refresh_access_token.
@Mkhoa161
Mkhoa161 requested a review from a team as a code owner November 30, 2026 23:36
@Mkhoa161
Mkhoa161 requested review from bogdankostic and removed request for a team November 30, 2026 23:36
@CLAassistant

CLAassistant commented Nov 30, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@github-actions

Copy link
Copy Markdown
Contributor

Heads-up for maintainers

This PR is from a fork and touches integrations whose integration tests require API keys.
Those tests are skipped in CI because fork PRs don't have access to repo secrets for security reasons.

Affected integrations:

  • mirage

Please run the integration tests locally (hatch run test:integration inside each folder) before approving.

@github-actions github-actions Bot added the type:documentation Improvements or additions to documentation label Nov 30, 2026
@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatedpypi/​mirage-ai@​0.0.3 ⏵ 0.1.076 -16100100 +1100100

View full report

@github-actions

Copy link
Copy Markdown
Contributor

Coverage report (mirage)

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  integrations/mirage/src/haystack_integrations/tools/mirage
  _async.py 79-81
  workspace.py
Project Total  

This report was generated by python-coverage-comment-action

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integration:mirage topic:CI type:documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Mirage - mirage-haystack fails to import with mirage-ai 0.1.0

2 participants