openclaw - 💡(How to fix) Fix feat(paths): Add paths.exists RPC method [1 comments, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#54947Fetched 2026-04-08 01:34:13
View on GitHub
Comments
1
Participants
1
Timeline
3
Reactions
0
Participants
Timeline (top)
closed ×1commented ×1locked ×1

Add a paths.exists server method so the frontend can check whether a workspace directory exists on disk.

Root Cause

Add a paths.exists server method so the frontend can check whether a workspace directory exists on disk.

Code Example

if (type === 'exists') {
  const targetPath = typeof params.path === 'string' ? params.path.trim() : '';
  if (!targetPath) {
    respond(false, { code: 'INVALID_PATH', message: 'path is required' });
    return;
  }
  try {
    await fs.access(targetPath);
    respond(true, { exists: true });
  } catch {
    respond(true, { exists: false });
  }
  return;
}
RAW_BUFFERClick to expand / collapse

Summary

Add a paths.exists server method so the frontend can check whether a workspace directory exists on disk.

Implementation

In gateway/src/gateway/server-methods/paths.js, add a handler for type === 'exists':

if (type === 'exists') {
  const targetPath = typeof params.path === 'string' ? params.path.trim() : '';
  if (!targetPath) {
    respond(false, { code: 'INVALID_PATH', message: 'path is required' });
    return;
  }
  try {
    await fs.access(targetPath);
    respond(true, { exists: true });
  } catch {
    respond(true, { exists: false });
  }
  return;
}

Register as 'paths.exists' in pathsHandlers.

Notes

  • Non-destructive, read-only
  • No auth concerns — only exposes existence, not contents
  • Companion to reeve-frontend#37

Effort

~1 hour.

Context

Part of workspace location management improvements. Spec: reeve-manager/memory/specs/reeve-desktop-workspace-ui.md

extent analysis

Fix Plan

To implement the paths.exists server method, follow these steps:

  • In gateway/src/gateway/server-methods/paths.js, add a handler for type === 'exists':
if (type === 'exists') {
  const targetPath = typeof params.path === 'string' ? params.path.trim() : '';
  if (!targetPath) {
    respond(false, { code: 'INVALID_PATH', message: 'path is required' });
    return;
  }
  try {
    await fs.access(targetPath);
    respond(true, { exists: true });
  } catch {
    respond(true, { exists: false });
  }
  return;
}
  • Register the new method in pathsHandlers as 'paths.exists'.

Verification

To verify the fix, you can use a tool like curl or a REST client to send a request to the paths.exists endpoint with a valid and an invalid path. For example:

curl -X POST \
  http://localhost:port/paths.exists \
  -H 'Content-Type: application/json' \
  -d '{"path": "/valid/path"}'

This should return { exists: true } if the path exists and { exists: false } if it doesn't.

Extra Tips

  • Make sure to handle any potential errors that may occur when accessing the file system.
  • Consider adding additional logging or monitoring to track the usage of this endpoint.
  • Review the reeve-manager/memory/specs/reeve-desktop-workspace-ui.md spec to ensure this implementation meets the requirements.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING