Skip to content

feat(mirage): Add Mirage integration as Agent tool#3530

Open
bogdankostic wants to merge 6 commits into
mainfrom
mirage
Open

feat(mirage): Add Mirage integration as Agent tool#3530
bogdankostic wants to merge 6 commits into
mainfrom
mirage

Conversation

@bogdankostic

Copy link
Copy Markdown
Contributor

Related Issues

Proposed Changes:

Adds a new mirage-haystack integration that exposes Mirage — a unified virtual filesystem that mounts heterogeneous backends (object storage, databases, SaaS apps, local disk) as one filesystem. It lets an Agent operate over all of those backends with plain bash through a single tool.

  • MirageMount — a declarative, serializable description of one mounted backend (path, resource registry name, config, read_only). A single generic constructor covers all of Mirage's backends uniformly; config values may be plain values, Haystack Secrets, or an OAuth token source, and are resolved only when the live workspace is built.
  • MirageWorkspace — holds the mount tree and cache configuration, lazily builds a live mirage.Workspace on first use via Mirage's resource registry, serializes cleanly (resolving Secrets / token sources only at build time), and exposes run / run_async that normalize and truncate output for an LLM.
  • MirageShellTool — a Haystack Tool that gives an Agent one guarded bash command surface across every mount.

How did you test it?

  • Unit tests: 40 tests across tests/test_workspace.py and tests/test_shell_tool.py, covering mount/workspace construction and validation, Secret and OAuth-token-source serialization round-trips (no plaintext leakage), per-mount read-only enforcement, RAM/disk command execution, output truncation, tool shape and to_dict/from_dict, and the command guard — including the substitution/backtick/subshell bypass cases and fail-closed behavior for quoted or variable command names.
  • Manual verification against live Google Drive and OneDrive backends (mounting, listing, cross-backend file copy, and an Agent driving the shell tool end to end).

Notes for the reviewer

  • Pins mirage-ai==0.0.3: Mirage is pre-1.0 and has shipped breaking changes across 0.0.x releases.

Checklist

@github-actions github-actions Bot added topic:CI type:documentation Improvements or additions to documentation labels Jul 2, 2026
@github-actions

github-actions Bot commented Jul 2, 2026

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 40-41, 61-64, 73-78
  errors.py
  shell_tool.py 154
  workspace.py 102, 224, 233-235, 252-253, 335, 345, 348
Project Total  

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

@socket-security

socket-security Bot commented Jul 2, 2026

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
Addedpypi/​mirage-ai@​0.0.392100100100100

View full report

@bogdankostic bogdankostic marked this pull request as ready for review July 2, 2026 10:40
@bogdankostic bogdankostic requested a review from a team as a code owner July 2, 2026 10:40
@bogdankostic bogdankostic requested review from julian-risch and removed request for a team July 2, 2026 10:40

@julian-risch julian-risch left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good to me in general. I have two remarks on the more complex parts where I am not entirely sure if what I expect should be in scope. I believe it should.

Comment thread integrations/mirage/pyproject.toml Outdated
@bogdankostic bogdankostic requested a review from julian-risch July 3, 2026 12:00
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.

2 participants