fix: resolve inherited strict typing violations

This commit is contained in:
Adam Weidman
2026-03-20 11:59:02 -04:00
parent 1b6c609165
commit db35ecd705
2 changed files with 3 additions and 3 deletions
@@ -32,9 +32,7 @@ describe('AgentSession', () => {
await session.abort();
expect(
session.events.some(
(e) =>
e.type === 'agent_end' &&
(e as AgentEvent<'agent_end'>).reason === 'aborted',
(e) => e.type === 'agent_end' && e.reason === 'aborted',
),
).toBe(true);
});
+2
View File
@@ -86,6 +86,7 @@ export class MockAgentProtocol implements AgentProtocol {
) {
const now = new Date().toISOString();
for (const eventData of events) {
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
const event: AgentEvent = {
...eventData,
id: eventData.id ?? `e-${this._nextEventId++}`,
@@ -126,6 +127,7 @@ export class MockAgentProtocol implements AgentProtocol {
// Helper to normalize and prepare for emission
const normalize = (eventData: MockAgentEvent): AgentEvent =>
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
({
...eventData,
id: eventData.id ?? `e-${this._nextEventId++}`,