mirror of
https://github.com/hansjone/dsh-im-ops.git
synced 2026-10-16 11:40:45 +08:00
fix: honor Harness default agent preset for IM sessions
This commit is contained in:
parent
26558e5e71
commit
8a64f2bc8c
15 changed files with 109 additions and 34 deletions
|
|
@ -45,6 +45,34 @@ test('all legacy channel clients now use the shared Harness RPC transport', asyn
|
|||
}
|
||||
});
|
||||
|
||||
test('HarnessClient lets the Host resolve an omitted agent preset and forwards an explicit override', async () => {
|
||||
const createPayload = async (options = {}) => {
|
||||
const client = new HarnessClient({
|
||||
baseUrl: 'http://127.0.0.1:3080',
|
||||
workspace: '/tmp/default-workspace',
|
||||
...options,
|
||||
});
|
||||
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(), 'session-one');
|
||||
return payload;
|
||||
};
|
||||
|
||||
assert.deepEqual(await createPayload(), { workspaceId: 'workspace-one' });
|
||||
assert.deepEqual(await createPayload({ agentPreset: 'router-standard' }), {
|
||||
workspaceId: 'workspace-one',
|
||||
agentPreset: 'router-standard',
|
||||
});
|
||||
assert.deepEqual(await createPayload({ agentPreset: null }), { workspaceId: 'workspace-one' });
|
||||
});
|
||||
|
||||
test('HarnessClient lists only absolute workspace paths', async () => {
|
||||
const client = new HarnessClient({
|
||||
baseUrl: 'http://127.0.0.1:3080',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue