openclaw - ✅(Solved) Fix [Feature]: Add user home directory and desktop to default media local roots [1 pull requests, 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#48833Fetched 2026-04-08 00:52:01
View on GitHub
Comments
1
Participants
1
Timeline
2
Reactions
0
Participants
Timeline (top)
commented ×1labeled ×1

Add user home directory (~) and Desktop folder to default media local roots so users can send files from Desktop directly without copying to workspace.

Root Cause

Add user home directory (~) and Desktop folder to default media local roots so users can send files from Desktop directly without copying to workspace.

Fix Action

Fixed

PR fix notes

PR #48893: feat(media): allow home and Desktop in default local roots

Description (problem / solution / changelog)

Summary

  • include the user home directory and Desktop in the default media local roots
  • keep the existing OpenClaw state and temp roots unchanged
  • add unit coverage for the new default roots

Testing

  • git diff --check
  • pnpm exec vitest run src/media/local-roots.test.ts

Fixes #48833

Changed files

  • src/media/local-roots.test.ts (added, +24/-0)
  • src/media/local-roots.ts (modified, +7/-2)
RAW_BUFFERClick to expand / collapse

Summary

Add user home directory (~) and Desktop folder to default media local roots so users can send files from Desktop directly without copying to workspace.

Problem to solve

Currently, Telegram and other channels cannot send files from user home directory or Desktop. Only ~/.openclaw/workspace is allowed by default. Users want to send files from Desktop directly without copying to workspace first.

Proposed solution

Modify buildMediaLocalRoots() function in auth-profiles-*.js to add:

  • os.homedir()
  • path.join(os.homedir(), "Desktop")

This will allow sending files from user home directory and Desktop without needing to copy to workspace first.

Alternatives considered

No response

Impact

Affected: All users who want to send files from Desktop Severity: Medium Frequency: Daily use case Consequence: Need to manually copy files to workspace before sending

Evidence/examples

No response

Additional information

No response

extent analysis

Fix Plan

To add the user home directory and Desktop folder to the default media local roots, follow these steps:

  • Modify the buildMediaLocalRoots() function in auth-profiles-*.js to include the user's home directory and Desktop folder.
  • Use the os and path modules to get the home directory and join it with the "Desktop" path.

Example code:

const os = require('os');
const path = require('path');

function buildMediaLocalRoots() {
  const homeDir = os.homedir();
  const desktopDir = path.join(homeDir, 'Desktop');
  const workspaceDir = path.join(homeDir, '.openclaw', 'workspace');

  // Add the home directory, Desktop folder, and workspace to the media local roots
  return [homeDir, desktopDir, workspaceDir];
}

Verification

To verify that the fix worked:

  • Restart the application or service that uses the buildMediaLocalRoots() function.
  • Try sending a file from the Desktop folder using Telegram or another channel.
  • Check that the file is sent successfully without needing to be copied to the workspace first.

Extra Tips

  • Make sure to test the fix on different operating systems to ensure that the os.homedir() and path.join() functions work as expected.
  • Consider adding error handling to the buildMediaLocalRoots() function to handle cases where the home directory or Desktop folder cannot be accessed.

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

openclaw - ✅(Solved) Fix [Feature]: Add user home directory and desktop to default media local roots [1 pull requests, 1 comments, 1 participants]