mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-11-16 03:09:33 +01:00
fix(agent): COD-549 report readiness failures with empty errors
This commit is contained in:
1 parent
af4b65697a
commit
d25d71b595
2 files changed
+16
-1
No files matched your search
+1
-1
@@ -573,7 +573,7 @@ export async function agentSpawn(deps: AgentDeps, options: SpawnOptions): Promis
|
|||||||
ready = !dead && Boolean(result?.matched);
|
ready = !dead && Boolean(result?.matched);
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
readinessError = getErrorMessage(error);
|
readinessError = getErrorMessage(error) || 'Readiness request failed';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -577,6 +577,21 @@ describe('agent spawn', () => {
|
|||||||
{ method: 'GET', path: `/api/v1/sessions/${OTHER}/wait-output` },
|
{ method: 'GET', path: `/api/v1/sessions/${OTHER}/wait-output` },
|
||||||
]);
|
]);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it.each([
|
||||||
|
{ error: new Error(''), kind: 'Error' },
|
||||||
|
{ error: '', kind: 'string' },
|
||||||
|
])('reports a readiness failure when the thrown $kind has no message', async ({ error }) => {
|
||||||
|
const deps = fakeDeps((options) => {
|
||||||
|
if (options.path === '/api/v1/quick-start') return ok({ sessionId: OTHER });
|
||||||
|
throw error;
|
||||||
|
}, true);
|
||||||
|
|
||||||
|
expect(await agentSpawn(deps, { caseName: 'c', mode: 'claude', ready: true, timeoutMs: 1000 })).toBe(EXIT.error);
|
||||||
|
expect(deps.out).toHaveLength(1);
|
||||||
|
expect(JSON.parse(deps.out[0])).toEqual({ sessionId: OTHER, readinessError: 'Readiness request failed' });
|
||||||
|
expect(deps.calls).toHaveLength(2);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('session id prefixes', () => {
|
describe('session id prefixes', () => {
|
||||||
|
|||||||
Reference in new issue
Block a user