Skip to content

Add workspace binding to channel settings for project file access #709

Description

@edpipole

Description

Add workspace binding support to channel settings so that conversations created by IM channels (Telegram, Lark, DingTalk, WeChat) can have access to project files.

Currently, when a message arrives from an IM channel, the backend creates a conversation with an empty workspace (workspace=''), resulting in a temporary directory with no access to project files.

Proposed Changes

1. New API Endpoint

PUT /api/channel/settings/{platform}/workspace
Body: { "workspace": "/path/to/project" }

This should persist the workspace path in channel settings, similar to the existing PUT /api/channel/settings/{platform}/assistant and PUT /api/channel/settings/{platform}/default-model endpoints.

2. Update IChannelPlatformSettings Response

The GET /api/channel/settings/{platform} response should include the workspace field:

{
  "platform": "telegram",
  "assistant": { "assistant_id": "..." },
  "default_model": { "id": "...", "use_model": "..." },
  "workspace": "/path/to/project"
}

3. Use Workspace When Creating Channel Conversations

When a message arrives from an IM channel and the backend creates/reactivates a conversation:

  • If settings.workspace is non-empty, use it as the conversation's workspace (equivalent to custom_workspace: true)
  • If settings.workspace is empty/null, maintain current behavior (temporary workspace)

This gives the assistant access to project files when responding to IM messages.

Context

  • Frontend changes (types, IPC route, UI) have been implemented in the AionUi desktop client on branch feat/channel-workspace-binding
  • The IChannelSession type already has a workspace?: string field that can be used
  • The TChatConversation.extra.workspace field already exists and is used by regular conversations

Files to Update (AionCore)

  • Channel settings handler — add workspace to platform settings struct
  • Channel conversation creation — use settings.workspace when creating conversations from IM messages
  • API routes — add PUT /api/channel/settings/{platform}/workspace

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions