fix(commands): send empty images list to the commands Typert endpoint

The Harness commands execute descriptor declares agentId, line, and images
as required JSON wire fields (strict codec, no acceptsUndefined). The Host
command executor only sent agentId and line, so the Typert gateway rejected
every IM /compact call with arguments-invalid before the command could run.

Send images: [] so /compact works from every IM channel.
This commit is contained in:
OpenClaw Agent 2026-08-27 19:40:50 +08:00
parent d251bc280d
commit 03565e5a69
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);