Skip to content

Add custom memory folder and mission source path configuration#57

Open
cometben54-arch wants to merge 1 commit intoTianyiDataScience:mainfrom
cometben54-arch:claude/add-file-selection-features-nWbb7
Open

Add custom memory folder and mission source path configuration#57
cometben54-arch wants to merge 1 commit intoTianyiDataScience:mainfrom
cometben54-arch:claude/add-file-selection-features-nWbb7

Conversation

@cometben54-arch
Copy link
Copy Markdown

Summary

This PR adds support for customizable memory folder and mission source paths in the UI preferences, allowing users to point to alternative locations for memory files and team mission statements without modifying the default configuration.

Key Changes

  • UI Preferences Extension: Added customMemoryFolder and customMissionSourcePath optional fields to the UiPreferences interface with validation (max 512 characters each)

  • Dashboard Options: Extended DashboardOptions interface to include the new custom path fields for passing to the rendering layer

  • Preferences API: Updated the preferences merge logic to handle the new fields with proper validation and null/empty string handling for resetting to defaults

  • Memory File Listing: Modified listEditableMemoryFiles() to accept an optional customFolder parameter and include files from custom memory folders in the editable files list

  • Team Snapshot Loading: Updated loadTeamSnapshot() to accept an optional customMissionSourcePath parameter for loading mission statements from custom locations

  • Agent Creation Endpoint: Added new POST /api/agents endpoint to create new agents in the openclaw.json configuration with validation for agent ID, name, model, workspace, and tools profile

  • UI Controls: Added interactive buttons in the staff mission and memory sections allowing users to:

    • Change the mission source path via a prompt dialog
    • Change the memory folder path via a prompt dialog
    • Create new agents with a multi-step prompt workflow
  • Preference Persistence: Custom paths are properly saved to and loaded from the preferences file, with fallback to defaults when not configured

Implementation Details

  • Custom paths are conditionally included in the dashboard options using spread operators to avoid undefined values
  • File path validation includes length checks and character restrictions for agent IDs
  • The agent creation endpoint properly validates the openclaw.json structure and prevents duplicate agent IDs
  • UI buttons use inline JavaScript with proper escaping and internationalization support
  • All custom path fields support resetting to defaults by passing empty strings or null values

https://claude.ai/code/session_0191MnuVyZ3SEYJh336KW9JW

…w employee creation

- Memory workbench: add button to select/input custom memory file folder
- Staff mission: add button to choose a different file as mission source
- Staff config details: add "New employee" button to create agents via openclaw.json
- Add customMemoryFolder and customMissionSourcePath to UiPreferences
- Add POST /api/agents endpoint for creating new agents

https://claude.ai/code/session_0191MnuVyZ3SEYJh336KW9JW
@TianyiDataScience
Copy link
Copy Markdown
Owner

谢谢你做这条 PR,这个方向我能理解,也确实能帮到有自定义路径需求的人。

我这次先没有直接 merge,主要是因为它把“自定义 memory / mission 路径”和“新 agent 创建入口”绑在了一起,而且和最新 mainsrc/ui/server.ts 上已经是 dirty 状态。对当前主干来说,这个面会同时碰到 UI 偏好、文件来源,以及新的写接口,风险有点大。

如果你愿意继续推进,我会很建议先 rebase,然后尽量把“路径配置”和“agent 创建”拆成两个更小的 PR。这样我们会更容易一块一块吃进去。

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.

3 participants