Skip to content

feat(acp): migrate system/file Tauri commands to ACP+#8849

Open
fresh3nough wants to merge 2 commits intoaaif-goose:mainfrom
fresh3nough:issue-8692-system-acp-migration
Open

feat(acp): migrate system/file Tauri commands to ACP+#8849
fresh3nough wants to merge 2 commits intoaaif-goose:mainfrom
fresh3nough:issue-8692-system-acp-migration

Conversation

@fresh3nough
Copy link
Copy Markdown
Contributor

Migrates the remaining file/system Tauri commands listed in #8692 to ACP+ so the goose2 desktop shell stays a thin wrapper over goose serve.

Summary

  • Adds a new goose::system_ops module containing the filesystem/attachment/mention helpers that previously lived in ui/goose2/src-tauri/src/commands/system.rs.
  • Exposes those helpers over ACP+ under the _goose/system/* namespace via custom requests defined in crates/goose-sdk/src/custom_requests.rs and handlers in crates/goose/src/acp/server.rs.
  • Rewrites ui/goose2/src/shared/api/system.ts to call the generated SDK methods instead of invoke(). Existing call sites are unchanged because the public function signatures stay the same.
  • For session export, the desktop shell opens the native save dialog via @tauri-apps/plugin-dialog (a shell-side concern) and then writes through the new generic _goose/system/write_file ACP method.
  • Drops the now-unused base64, dirs, ignore, and mime_guess crates from the goose2 Tauri shell, removes the registered commands::system::* invoke handlers, and updates the Playwright Tauri mock to drop the migrated invoke cases.

Migrated commands

  • commands::system::get_home_dir_goose/system/home_dir
  • commands::system::save_exported_session_file@tauri-apps/plugin-dialog + _goose/system/write_file
  • commands::system::path_exists_goose/system/path_exists
  • commands::system::list_directory_entries_goose/system/list_directory_entries
  • commands::system::inspect_attachment_paths_goose/system/inspect_attachment_paths
  • commands::system::list_files_for_mentions_goose/system/list_files_for_mentions
  • commands::system::read_image_attachment_goose/system/read_image_attachment

Tests

  • Ported the existing Tauri command unit tests into crates/goose/src/system_ops.rs so the migrated logic is still covered (cargo test -p goose system_ops → 14 passing).
  • cargo fmt --all -- --check, cargo clippy -p goose --all-targets -- -D warnings
  • pnpm test in ui/goose2 (475 passing) and just check (biome + file-size + i18n + typecheck)

Closes #8692

@fresh3nough fresh3nough force-pushed the issue-8692-system-acp-migration branch from e01f4de to 57620c9 Compare April 25, 2026 22:36
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e01f4def4d

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines 359 to 361
return Promise.resolve("/tmp/avatars");
case "save_persona_avatar_bytes":
return Promise.resolve("avatar.png");
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Add ACP stubs for migrated system methods

These invoke stubs were removed, but the Playwright ACP mock still has no _goose/system/* handlers; unrecognized ACP calls fall through to {} in handleAcpRequest. Since ui/goose2/src/shared/api/system.ts now calls typed ACP methods (GooseSystemHomeDir, GooseSystemPathExists, etc.), the generated zod parsers expect fields like path/exists and throw in mocked runs, which breaks or degrades filesystem-dependent UI flows under the e2e fixture.

Useful? React with 👍 / 👎.

Move `get_home_dir`, `save_exported_session_file`, `path_exists`,
`list_directory_entries`, `inspect_attachment_paths`,
`list_files_for_mentions` and `read_image_attachment` from the goose2
Tauri shell into a new `goose::system_ops` module exposed over ACP+ via
the `_goose/system/*` namespace. The desktop shell now opens save dialogs
via the Tauri JS `@tauri-apps/plugin-dialog` plugin and persists the
chosen file via a generic `_goose/system/write_file` ACP method.

The Tauri shell drops its `base64`, `dirs`, `ignore`, and `mime_guess`
dependencies along with the migrated commands, keeping the shell layer
thin per the goose2 architecture rule. Existing system_ops behaviour is
exercised through ported unit tests under `crates/goose/src/system_ops.rs`.

Closes aaif-goose#8692

Signed-off-by: fresh3nough <anonwurcod@proton.me>
@fresh3nough fresh3nough force-pushed the issue-8692-system-acp-migration branch from 57620c9 to c5e13ee Compare April 25, 2026 22:47
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c5e13ee73d

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines 26 to 30
serde = { version = "1", features = ["derive"] }
serde_json = "1"
dirs = "6.0.0"
log = "0.4.29"
tokio = { version = "1.50.0", features = ["full"] }
uuid = { version = "1", features = ["v4", "serde"] }
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Re-add dirs to goose2 dependencies

The dirs crate was removed from ui/goose2/src-tauri/Cargo.toml, but this package still imports dirs::home_dir/dirs::data_dir in several compiled modules (for example commands/path_resolver.rs, commands/projects.rs, services/personas.rs, and services/acp/goose_serve.rs). Without a direct dependency, the goose2 Tauri crate will fail to build with unresolved-crate errors, so desktop checks/builds are blocked until dirs is restored (or every remaining dirs:: usage is removed).

Useful? React with 👍 / 👎.

Bojun-Vvibe added a commit to Bojun-Vvibe/oss-contributions that referenced this pull request Apr 26, 2026
The system_ops migration in c5e13ee dropped `dirs` from the goose2
Tauri shell, but several pre-existing files still rely on it for
home/data directory lookups:

  - src/commands/agent_setup.rs   (PATH building)
  - src/commands/path_resolver.rs (~ expansion)
  - src/commands/projects.rs      (projects dir)
  - src/services/acp/goose_serve.rs (default working dir)
  - src/services/personas.rs      (personas/avatars/agents dirs)

Re-add `dirs = "6.0.0"` so `cargo clippy -- -D warnings` and the
desktop build succeed again. The migrated system_ops module continues
to use the dependency from `crates/goose` only.

Signed-off-by: fresh3nough <anonwurcod@proton.me>
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.

commands to acp+ migration (goose 2.0) - System/File Operations

1 participant