You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"the choice is only available before a conversation starts: once a turn has run, the session's history was produced under that preset's tools and the host refuses to swap"
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
大家好,我是 DSH 插件开发者,在使用 uiWorkspace 服务时遇到一个限制,想提个功能建议。
问题
使用 uiWorkspace.openWorkspace(workspaceId) 切换工作区时,新创建的会话总是使用默认的 agent preset,没有办法指定新会话应该用哪个模式(标准 / PTC / 创造等)。
从 dsh-client-ui-agent-preset 的源码注释可以确认:
也就是说 preset 必须在会话创建时指定,但目前两个相关 API 都不支持:
```typescript
sessions.create({ workspaceId, cwd, sessionId }) // 没有 preset 参数
uiWorkspace.openWorkspace(workspaceId, beforeOpen?) // 没有 preset 参数
```
建议
在以下任意一个 API 中添加 agentPreset 参数:
方案 A:sessions.create()
```typescript
sessions.create({ workspaceId, agentPreset?: string })
```
方案 B:uiWorkspace.openWorkspace()
```typescript
uiWorkspace.openWorkspace(workspaceId, { agentPreset?: string, beforeOpen?: (sessionId) => void })
```
使用场景
插件希望在打开某个工作区时自动进入特定模式。比如插件提供"在工作区中打开项目目录"的功能,希望切换到项目源码目录时自动进入创造模式,让 agent 具备合适的工具和提示词来修改代码。
目前唯一的变通办法是通过 settings 临时修改全局默认 preset,切换完再改回来——但这会影响所有新会话,而且如果工作区已有空白会话会被直接复用,根本不生效。
环境
All reactions