mirror of
https://github.com/hansjone/dsh-im-ops.git
synced 2026-10-09 00:33:20 +08:00
Merge pull request #75 from evilh2019/fix/compact-command-images
Fix IM /compact requests by sending the required empty images list. Co-authored-by: Evilh2019 <261342086+evilh2019@users.noreply.github.com>
This commit is contained in:
commit
b9e53bfd69
3 changed files with 10 additions and 3 deletions
File diff suppressed because one or more lines are too long
|
|
@ -15,7 +15,11 @@ export function createHarnessCommandExecutor(ctx, provided) {
|
|||
return (sessionId, line, options = {}) => gateway.invoke({
|
||||
namespace: 'commands',
|
||||
method: 'execute',
|
||||
args: { agentId: sessionId, line },
|
||||
// The Harness commands execute descriptor declares agentId, line, and
|
||||
// images as required JSON wire fields; omitting images makes the Typert
|
||||
// gateway reject the call with arguments-invalid, so IM /compact always
|
||||
// carried an empty image list.
|
||||
args: { agentId: sessionId, line, images: [] },
|
||||
signal: options.signal,
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -145,7 +145,10 @@ test('Host command executor invokes the commands Typert endpoint with the Sessio
|
|||
assert.deepEqual(requests, [{
|
||||
namespace: 'commands',
|
||||
method: 'execute',
|
||||
args: { agentId: 'session-one', line: '/compact' },
|
||||
// images must ride the wire as an empty array: the Harness commands
|
||||
// execute descriptor declares it a required JSON field, and omitting it
|
||||
// makes the Typert gateway reject the call with arguments-invalid.
|
||||
args: { agentId: 'session-one', line: '/compact', images: [] },
|
||||
signal,
|
||||
}]);
|
||||
assert.equal(createHarnessCommandExecutor({}), undefined);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue