iOfficeAI / iOfficeAI/AionCore
Add workspace binding to channel settings for project file access
- Dominant language
- Rust
- Stars
- 105
- Forks
- 169
- Avg merge
- 5h 58m
- Merged PRs (30d)
- 84
Description
## 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:
```json
{
"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`
Contributor guide
No contributing guide indexed for this repository
Research direction
Read the channel settings handler and API routes alongside the existing assistant and default-model endpoints, then trace channel conversation creation for IM messages. Implement workspace persistence and inclusion in platform settings, using the configured workspace while preserving temporary-workspace behavior when it is empty; verify the endpoint and conversation flows described in the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 68/100