Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

chore: remove unused `resolveWorkspaceAbsolutePath` command

Steven Enamakel5f044106c98e
diff --git a/app/src/utils/tauriCommands/workspacePaths.test.ts b/app/src/utils/tauriCommands/workspacePaths.test.ts
index a53b77402d..e6ba34e77a 100644
--- a/app/src/utils/tauriCommands/workspacePaths.test.ts
+++ b/app/src/utils/tauriCommands/workspacePaths.test.ts
@@ -5,7 +5,6 @@ import { isTauri } from './common';
import {
openWorkspacePath,
previewWorkspaceText,
- resolveWorkspaceAbsolutePath,
revealWorkspacePath,
} from './workspacePaths';
@@ -66,36 +65,4 @@ describe('tauriCommands/workspacePaths', () => {
expect(invoke).toHaveBeenCalledWith('preview_workspace_text', { path: 'docs/readme.md' });
});
-
- test('invokes resolve_workspace_absolute_path with a workspace-relative path', async () => {
- vi.mocked(invoke).mockResolvedValue('/tmp/workspace/docs/readme.md');
-
- await expect(resolveWorkspaceAbsolutePath('docs/readme.md')).resolves.toBe(
- '/tmp/workspace/docs/readme.md'
- );
-
- expect(invoke).toHaveBeenCalledWith('resolve_workspace_absolute_path', {
- path: 'docs/readme.md',
- });
- });
-
- test('surfaces invoke rejection from resolve_workspace_absolute_path', async () => {
- vi.mocked(invoke).mockRejectedValue('workspace path does not exist nope.md');
-
- await expect(resolveWorkspaceAbsolutePath('nope.md')).rejects.toBe(
- 'workspace path does not exist nope.md'
- );
-
- expect(invoke).toHaveBeenCalledWith('resolve_workspace_absolute_path', { path: 'nope.md' });
- });
-
- test('resolveWorkspaceAbsolutePath throws before invoking when not running in Tauri', async () => {
- vi.mocked(isTauri).mockReturnValue(false);
-
- await expect(resolveWorkspaceAbsolutePath('docs/readme.md')).rejects.toThrow(
- 'Not running in Tauri'
- );
-
- expect(invoke).not.toHaveBeenCalled();
- });
});
diff --git a/app/src/utils/tauriCommands/workspacePaths.ts b/app/src/utils/tauriCommands/workspacePaths.ts
index 56640258c2..20b104a020 100644
--- a/app/src/utils/tauriCommands/workspacePaths.ts
+++ b/app/src/utils/tauriCommands/workspacePaths.ts
@@ -45,15 +45,3 @@ export async function previewWorkspaceText(path: string): Promise<WorkspaceTextP
sizeBytes: preview.size_bytes,
};
}
-
-/**
- * Resolve a workspace-relative path to its canonical absolute path on disk,
- * after the Rust side validates it stays inside the active OpenHuman
- * workspace. Useful for UI flows that need to compose an absolute path into a
- * platform-specific URL scheme (e.g. `obsidian://open?path=<abs>`) without
- * re-implementing path normalization in the renderer.
- */
-export async function resolveWorkspaceAbsolutePath(path: string): Promise<string> {
- assertTauri();
- return invoke<string>('resolve_workspace_absolute_path', { path });
-}
diff --git a/crates/openhuman-app/permissions/allow-workspace-files.toml b/crates/openhuman-app/permissions/allow-workspace-files.toml
index c4328947b2..1d1e08148e 100644
--- a/crates/openhuman-app/permissions/allow-workspace-files.toml
+++ b/crates/openhuman-app/permissions/allow-workspace-files.toml
@@ -8,7 +8,6 @@ allow = [
"open_workspace_path",
"reveal_workspace_path",
"preview_workspace_text",
- "resolve_workspace_absolute_path",
]
deny = []
diff --git a/crates/openhuman-app/src/lib.rs b/crates/openhuman-app/src/lib.rs
index f2a3db7456..db415cb4a0 100644
--- a/crates/openhuman-app/src/lib.rs
+++ b/crates/openhuman-app/src/lib.rs
@@ -3511,7 +3511,6 @@ pub fn run() {
workspace_paths::open_workspace_path,
workspace_paths::reveal_workspace_path,
workspace_paths::preview_workspace_text,
- workspace_paths::resolve_workspace_absolute_path,
mcp_commands::mcp_resolve_binary_path,
mcp_commands::mcp_open_client_config,
loopback_oauth::start_loopback_oauth_listener,
diff --git a/crates/openhuman-app/src/workspace_paths.rs b/crates/openhuman-app/src/workspace_paths.rs
index 664d71e183..0060752aeb 100644
--- a/crates/openhuman-app/src/workspace_paths.rs
+++ b/crates/openhuman-app/src/workspace_paths.rs
@@ -51,29 +51,6 @@ pub async fn preview_workspace_text(path: String) -> Result<WorkspaceTextPreview
preview_workspace_text_from_root(&workspace, &path, DEFAULT_PREVIEW_MAX_BYTES)
}
-/// Resolve a workspace-relative path to its canonical absolute path on disk,
-/// after validating it stays inside the active OpenHuman workspace.
-///
-/// This exposes the internal [`resolve_workspace_path`] helper so UI flows that
-/// need an absolute path to compose with a platform-specific URL scheme (e.g.
-/// `obsidian://open?path=<abs>`) can route through the shared workspace-link
-/// layer instead of re-implementing path normalization in the renderer.
-///
-/// Errors mirror the other workspace-path commands — empty input, parent-dir
-/// escape, NUL bytes, URI-scheme prefixes, paths outside the workspace, and
-/// missing files all surface a non-leaky message.
-#[tauri::command]
-pub async fn resolve_workspace_absolute_path(path: String) -> Result<String, String> {
- let workspace = active_workspace_root().await?;
- let target = resolve_workspace_path(&workspace, &path)?;
- let workspace_label = workspace_path_label(&workspace, &target);
- log::debug!(
- "[workspace-paths] resolve_workspace_absolute_path: {}",
- workspace_label
- );
- Ok(target.to_string_lossy().into_owned())
-}
-
async fn active_workspace_root() -> Result<PathBuf, String> {
let config = openhuman_core::config::Config::load_or_init()
.await