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:
xiemanR 2026-08-27 21:14:57 +08:00 • committed by GitHub
commit b9e53bfd69
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 10 additions and 3 deletions

File diff suppressed because one or more lines are too long

View file

@ -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,
});
}

View file

@ -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);