Skip to content

Commit e28e678

Browse files
committed
fix(commands): preserve empty gateway status summaries
1 parent d2de6e4 commit e28e678

2 files changed

Lines changed: 21 additions & 0 deletions

File tree

‎src/commands/agent-via-gateway.test.ts‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,24 @@ describe("agentCliCommand", () => {
165165
});
166166
});
167167

168+
it("logs non-ok gateway summaries when payloads are empty", async () => {
169+
await withTempStore(async () => {
170+
callGateway.mockResolvedValue({
171+
runId: "idem-1",
172+
status: "timeout",
173+
summary: "aborted",
174+
result: {
175+
payloads: [],
176+
meta: { aborted: true },
177+
},
178+
});
179+
180+
await agentCliCommand({ message: "hi", to: "+1555" }, runtime);
181+
182+
expect(runtime.log).toHaveBeenCalledWith("aborted");
183+
});
184+
});
185+
168186
it("passes model overrides through gateway requests", async () => {
169187
await withTempStore(async () => {
170188
mockGatewaySuccessReply();

‎src/commands/agent-via-gateway.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,9 @@ async function agentViaGatewayCommand(opts: AgentCliOpts, runtime: RuntimeEnv) {
201201
const payloads = result?.payloads ?? [];
202202

203203
if (payloads.length === 0) {
204+
if (response?.status !== "ok") {
205+
runtime.log(response?.summary ? response.summary : "No reply from agent.");
206+
}
204207
return response;
205208
}
206209

0 commit comments

Comments
 (0)