Skip to content

Commit 4ff6295

Browse files
author
linyuan.yang
committed
remote-agent 支持 workPath
1 parent 592531e commit 4ff6295

5 files changed

Lines changed: 9 additions & 3 deletions

File tree

‎packages/channel.base/src/ChannelPlugin.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ export interface ChannelSessionInfo {
5555
export interface ChannelMessageArgs {
5656
/** Channel-agnostic session identifier (same value stored in DB channelSession.sessionId). */
5757
sessionId: string;
58+
/** Optional workspace override for this message only. */
59+
workPath?: string;
5860
/** Channel-specific extra info (e.g. user metadata) passed to the AI agent. */
5961
extraInfo?: string;
6062
[key: string]: any;

‎packages/channel.remote-agent/README.md‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,9 @@ transports must be available at the same time.
3939

4040
Every chat carries the required `userId`, `userInfo`, `sessionId`,
4141
`sessionInfo`, `systemPrompt`, `tools`, and scorpio.ai-compatible `content`,
42-
plus optional `attachments`
43-
(`name` with `dataUrl` or text `content`). Images become multimodal input;
42+
plus optional `workPath` and `attachments`. A non-empty `workPath` overrides
43+
the workspace for that chat without changing the session profile or channel.
44+
Attachments use `name` with `dataUrl` or text `content`. Images become multimodal input;
4445
other attachments are written to a temporary file and injected as a file link.
4546
Empty `systemPrompt` and an empty `tools` list are valid explicit values. sbot
4647
owns model selection, history, memory and agent execution; the external client

‎packages/channel.remote-agent/src/RemoteAgentService.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ export abstract class RemoteAgentService implements IChannelService {
6262
sessionId: identity.sessionId,
6363
connection,
6464
extraInfo: connection.extraInfo,
65+
...(typeof message.workPath === "string" && message.workPath.trim() && { workPath: message.workPath }),
6566
}, content);
6667
}
6768

‎packages/channel.remote-agent/src/protocol.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ export interface AgentSessionIdentity {
5858

5959
export interface AgentChatMessage extends AgentSessionIdentity {
6060
type: AgentClientMessageType.Chat;
61+
/** Optional workspace path used by this chat only. */
62+
workPath?: string;
6163
/** Standard scorpio.ai multimodal input. */
6264
content: MessageContent;
6365
/** Additional image or file attachments, equivalent to the web channel's attachments. */

‎packages/sbot/src/Processing/createProcessAIHandler.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export function createProcessAIHandler(): ProcessAIHandler {
3030
const saverId = resolved.saver;
3131
const notes = resolved.notes;
3232
const wikis = resolved.wikis;
33-
const workPath = resolved.workPath;
33+
const workPath = args.workPath || resolved.workPath;
3434
const autoApproveAllTools = resolved.autoApproveAllTools ?? false;
3535
const streamVerbose = resolved.streamVerbose ?? (channelId === WEB_CHANNEL_ID);
3636
const approvalTimeout = resolved.approvalTimeout ?? 0;

0 commit comments

Comments
 (0)