feat: 按机器人选择 Agent Preset

在九个渠道的设置页卡片上选择 Host 已有预设;未选则跟随默认,只影响之后新建的会话。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
iamyaojie 2026-08-21 19:19:45 +08:00
parent c3b3a29f27
commit 3161816cc4
51 changed files with 2227 additions and 740 deletions

View file

@ -73,6 +73,28 @@ test('HarnessClient lets the Host resolve an omitted agent preset and forwards a
assert.deepEqual(await createPayload({ agentPreset: null }), { workspaceId: 'workspace-one' });
});
test('HarnessClient forwards a per-session agent preset override', async () => {
const client = new HarnessClient({
baseUrl: 'http://127.0.0.1:3080',
workspace: '/tmp/default-workspace',
agentPreset: 'router-standard',
});
let payload;
client.ensureRunning = async () => true;
client.workspaceId = async () => 'workspace-one';
client.rpc = async (method, value) => {
assert.equal(method, 'session.create');
payload = value;
return { sessionId: 'session-one' };
};
assert.equal(await client.createSession({ agentPreset: 'marketing-jeep' }), 'session-one');
assert.deepEqual(payload, {
workspaceId: 'workspace-one',
agentPreset: 'marketing-jeep',
});
});
test('HarnessClient lists only absolute workspace paths', async () => {
const client = new HarnessClient({
baseUrl: 'http://127.0.0.1:3080',