Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
86abf04
docs: add execution playbook for issue #1569b ESLint warning resolution
acoliver Mar 29, 2026
6e4afcf
fix(lint): auto-fix eslint warnings (Phase 0)
acoliver Mar 29, 2026
17171e4
fix(lint): fix consistent-type-imports via ts-morph codemod (Phase 0b)
acoliver Mar 29, 2026
e2b5dd6
fix(lint): fix strict-boolean-expressions via ts-morph codemod (Phase…
acoliver Mar 29, 2026
51bc0f7
fix(lint): disable false-positive/redundant sonarjs rules (Phase 4.0)
acoliver Mar 29, 2026
6af3eaa
fix(lint): auto-fix safe eslint warnings (Phase 0)
acoliver Mar 29, 2026
ec942ab
fix(lint): apply safe ESLint suggestion fixes (Phase S1)
acoliver Mar 29, 2026
39b02e8
docs: update revised plan with lessons learned and current status
acoliver Mar 29, 2026
f1e8bf5
fix(lint): apply verified risky suggestion fixes (Phase S2)
acoliver Mar 29, 2026
8e64643
fix(lint): reorder shorthand properties in object literals (Phase M1)
acoliver Mar 30, 2026
2a5cdf2
fix(lint): convert value imports to type imports where appropriate (P…
acoliver Mar 30, 2026
33d486a
fix(lint): convert toEqual to toStrictEqual in test files (Phase M3 p…
acoliver Mar 30, 2026
8c35a15
fix(lint): apply additional safe suggestion fixes (Phase M3/M4 batch)
acoliver Mar 30, 2026
09c2c72
fix(lint): resolve vitest conditional test warnings in providers (Pha…
acoliver Mar 30, 2026
8c1a092
fix(lint): resolve vitest conditional test warnings in core (Phase M3)
acoliver Apr 1, 2026
3e41030
Merge remote-tracking branch 'origin/main' into issue1569b
acoliver Apr 1, 2026
348f592
fix: restore value imports for hook output classes after merge
acoliver Apr 1, 2026
3bcbe1f
fix(lint): re-apply auto-fixable lint rules after main merge
acoliver Apr 1, 2026
591b853
fix(lint): resolve @typescript-eslint warnings in openai provider uti…
acoliver Apr 1, 2026
524cae1
fix(lint): resolve @typescript-eslint warnings in openai provider (ba…
acoliver Apr 1, 2026
a2f005d
fix(lint): resolve @typescript-eslint warnings in openai provider (ba…
acoliver Apr 1, 2026
ab4aa67
fix(lint): resolve @typescript-eslint warnings in OpenAIProvider + pa…
acoliver Apr 1, 2026
0806a7c
fix(lint): resolve @typescript-eslint warnings in OpenAI stream/non-s…
acoliver Apr 1, 2026
1799669
fix(lint): resolve @typescript-eslint warnings in anthropic provider
acoliver Apr 1, 2026
b12399c
fix(lint): resolve @typescript-eslint warnings in gemini provider
acoliver Apr 1, 2026
f2ec2b8
fix(lint): resolve @typescript-eslint warnings in chutes + fake provi…
acoliver Apr 1, 2026
290d850
fix(lint): resolve @typescript-eslint warnings in core tools
acoliver Apr 1, 2026
afff846
fix(lint): resolve @typescript-eslint warnings in remaining core tools
acoliver Apr 1, 2026
c0aed5e
fix(lint): resolve @typescript-eslint warnings in core/ directory
acoliver Apr 1, 2026
aaf6f76
fix(lint): resolve @typescript-eslint warnings in core/ (batch 2)
acoliver Apr 1, 2026
52c83d0
fix(lint): resolve @typescript-eslint warnings in utils + recording
acoliver Apr 1, 2026
a338be4
fix(lint): resolve @typescript-eslint warnings in services + hooks
acoliver Apr 1, 2026
fe9f5d3
fix(lint): resolve @typescript-eslint warnings in runtime/auth/schedu…
acoliver Apr 1, 2026
cc760bc
fix(lint): resolve @typescript-eslint warnings in misc core directories
acoliver Apr 1, 2026
f6bb592
fix(lint): resolve @typescript-eslint warnings in cli ui/hooks
acoliver Apr 2, 2026
7b77763
fix(lint): resolve @typescript-eslint warnings in cli ui components +…
acoliver Apr 2, 2026
7089666
fix(lint): resolve @typescript-eslint warnings in cli runtime
acoliver Apr 2, 2026
a5a4435
fix(lint): resolve @typescript-eslint warnings in cli config + auth
acoliver Apr 2, 2026
4ee91d6
fix(lint): resolve @typescript-eslint warnings in nonInteractiveCli.ts
acoliver Apr 2, 2026
a9d0877
fix(lint): resolve @typescript-eslint warnings in a2a-server
acoliver Apr 2, 2026
22310c1
fix(lint): resolve @typescript-eslint warnings in openai-responses + …
acoliver Apr 2, 2026
fee59b6
fix(lint): resolve @typescript-eslint warnings in provider logging/ut…
acoliver Apr 2, 2026
0541482
fix(lint): resolve @typescript-eslint warnings in cli services + utils
acoliver Apr 2, 2026
23d011c
fix(lint): resolve @typescript-eslint warnings in zed-integration
acoliver Apr 2, 2026
74ab6b2
fix(lint): resolve @typescript-eslint warnings in vscode-ide-companion
acoliver Apr 2, 2026
4c23be2
fix(lint): resolve 21 @typescript-eslint warnings in gemini.tsx
acoliver Apr 2, 2026
ef15916
fix(lint): resolve 23 @typescript-eslint warnings in providerManagerI…
acoliver Apr 2, 2026
d05b2f1
fix(lint): run eslint --fix on remaining auto-fixable warnings
acoliver Apr 2, 2026
a788cba
fix(lint): resolve 95 @typescript-eslint warnings in LoggingProviderW…
acoliver Apr 2, 2026
1184b8d
fix(lint): resolve 65 @typescript-eslint warnings in OpenAIResponsesP…
acoliver Apr 2, 2026
72e9524
fix(lint): resolve 85 @typescript-eslint warnings in cli settings.ts
acoliver Apr 2, 2026
655eb75
fix(lint): resolve @typescript-eslint warnings in sandbox.ts + mcpCom…
acoliver Apr 2, 2026
6923685
fix(lint): resolve @typescript-eslint warnings in diagnosticsCommand.ts
acoliver Apr 2, 2026
f808323
fix(lint): resolve @typescript-eslint warnings in cli commands + utils
acoliver Apr 2, 2026
074dc81
fix(lint): resolve @typescript-eslint warnings in StreamProcessor, To…
acoliver Apr 2, 2026
f2513ff
fix(lint): resolve @typescript-eslint warnings in mcp-client.ts + pro…
acoliver Apr 2, 2026
bdc3d18
fix(lint): resolve @typescript-eslint warnings in MessageConverter, t…
acoliver Apr 2, 2026
00f3296
fix(lint): resolve @typescript-eslint warnings in config.ts, lspInteg…
acoliver Apr 2, 2026
8cf47e4
fix(lint): resolve @typescript-eslint warnings in lspIntegration.ts +…
acoliver Apr 2, 2026
6cdb85e
fix(lint): revert broken lint fixes + fix LoggingProviderWrapper chun…
acoliver Apr 2, 2026
23a70a8
fix(lint): resolve @typescript-eslint warnings in profileSnapshot, st…
acoliver Apr 2, 2026
2fc9d87
fix(lint): resolve @typescript-eslint warnings in schema/index.ts + u…
acoliver Apr 2, 2026
6dd7609
fix(lint): resolve 26 @typescript-eslint warnings in useSlashCompleti…
acoliver Apr 2, 2026
b22599c
fix(lint): resolve @typescript-eslint warnings in aboutCommand.ts + C…
acoliver Apr 2, 2026
c3c27cf
fix(lint): resolve 52 @typescript-eslint warnings in SettingsDialog.tsx
acoliver Apr 2, 2026
12b15a6
fix(lint): resolve @typescript-eslint warnings in useWelcomeOnboardin…
acoliver Apr 2, 2026
8afb07e
fix(lint): address CodeRabbit review findings
acoliver Apr 2, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
13 changes: 13 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,18 @@ export default tseslint.config(
// Expensive heuristic — NLP analysis on comments with no value for this codebase
'sonarjs/no-commented-code': 'off',

// False-positive or redundant sonarjs rules — see project-plans/issue1569b/README.md
'sonarjs/declarations-in-global-scope': 'off', // ESM false positives
'sonarjs/no-unused-vars': 'off', // Redundant with @typescript-eslint/no-unused-vars
'sonarjs/max-lines-per-function': 'off', // Redundant with base max-lines-per-function at 80
'sonarjs/process-argv': 'off', // CLI tool legitimately uses process.argv
'sonarjs/standard-input': 'off', // CLI tool legitimately uses stdin
'sonarjs/publicly-writable-directories': 'off', // Test /tmp usage is intentional
'sonarjs/pseudo-random': 'off', // Non-cryptographic context (IDs, shuffles)
'sonarjs/no-reference-error': 'off', // TypeScript ambient/global false positives
'sonarjs/no-undefined-assignment': 'off', // TypeScript undefined convention
'sonarjs/arrow-function-convention': 'off', // Conflicts with Prettier arrowParens: "always" default

// ESLint comments (recommended rules downgraded to warn)
...Object.fromEntries(
Object.entries(eslintComments.configs.recommended.rules ?? {}).map(
Expand Down Expand Up @@ -454,6 +466,7 @@ export default tseslint.config(

// Relax complexity rules for test files
'max-lines-per-function': 'off',
'sonarjs/no-duplicate-string': 'off', // Tests repeat strings legitimately
},
},
// Issue #1576: Enforce strict line-limit errors on AppContainer module files.
Expand Down
47 changes: 20 additions & 27 deletions packages/a2a-server/src/agent/executor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,10 @@ export class CoderAgentExecutor implements AgentExecutor {
sdkTask: SDKTask,
eventBus?: ExecutionEventBus,
): Promise<TaskWrapper> {
const metadata = sdkTask.metadata || {};
const metadata = sdkTask.metadata ?? {};
const persistedState = getPersistedState(metadata);

if (!persistedState) {
if (persistedState == null) {
throw new Error(
`Cannot reconstruct task ${sdkTask.id}: missing persisted state in metadata.`,
);
Expand All @@ -123,7 +123,7 @@ export class CoderAgentExecutor implements AgentExecutor {
runtimeTask.taskState = persistedState._taskState;
const contentGeneratorConfig =
runtimeTask.config.getContentGeneratorConfig();
if (contentGeneratorConfig) {
if (contentGeneratorConfig != null) {
await runtimeTask.geminiClient.initialize(contentGeneratorConfig);
}

Expand All @@ -139,7 +139,7 @@ export class CoderAgentExecutor implements AgentExecutor {
agentSettingsInput?: AgentSettings,
eventBus?: ExecutionEventBus,
): Promise<TaskWrapper> {
const agentSettings = agentSettingsInput || ({} as AgentSettings);
const agentSettings = agentSettingsInput ?? ({} as AgentSettings);
const config = await this.getConfig(agentSettings, taskId);
const runtimeTask = await Task.create(
taskId,
Expand All @@ -150,7 +150,7 @@ export class CoderAgentExecutor implements AgentExecutor {
);
const contentGeneratorConfig2 =
runtimeTask.config.getContentGeneratorConfig();
if (contentGeneratorConfig2) {
if (contentGeneratorConfig2 != null) {
await runtimeTask.geminiClient.initialize(contentGeneratorConfig2);
}

Expand All @@ -177,13 +177,12 @@ export class CoderAgentExecutor implements AgentExecutor {
);
const wrapper = this.tasks.get(taskId);

if (!wrapper) {
if (wrapper == null) {
logger.warn(
`[CoderAgentExecutor] Task ${taskId} not found for cancellation.`,
);
eventBus.publish({
kind: 'status-update',
taskId,
contextId: uuidv4(),
status: {
state: 'failed',
Expand All @@ -196,6 +195,7 @@ export class CoderAgentExecutor implements AgentExecutor {
},
},
final: true,
taskId,
});
return;
}
Expand All @@ -208,7 +208,6 @@ export class CoderAgentExecutor implements AgentExecutor {
);
eventBus.publish({
kind: 'status-update',
taskId,
contextId: task.contextId,
status: {
state: task.taskState,
Expand All @@ -226,6 +225,7 @@ export class CoderAgentExecutor implements AgentExecutor {
},
},
final: true,
taskId,
});
return;
}
Expand Down Expand Up @@ -260,7 +260,6 @@ export class CoderAgentExecutor implements AgentExecutor {
);
eventBus.publish({
kind: 'status-update',
taskId,
contextId: task.contextId,
status: {
state: 'failed',
Expand All @@ -278,6 +277,7 @@ export class CoderAgentExecutor implements AgentExecutor {
},
},
final: true,
taskId,
});
}
};
Expand All @@ -289,11 +289,11 @@ export class CoderAgentExecutor implements AgentExecutor {
const userMessage = requestContext.userMessage;
const sdkTask = requestContext.task;

const taskId = sdkTask?.id || userMessage.taskId || uuidv4();
const taskId = sdkTask?.id ?? userMessage.taskId ?? uuidv4();
const contextId =
userMessage.contextId ||
sdkTask?.contextId ||
sdkTask?.metadata?.['_contextId'] ||
userMessage.contextId ??
sdkTask?.contextId ??
(sdkTask?.metadata?.['_contextId'] as string | undefined) ??
uuidv4();

logger.info(
Expand All @@ -307,7 +307,7 @@ export class CoderAgentExecutor implements AgentExecutor {
);

const store = requestStorage.getStore();
if (!store) {
if (store == null) {
logger.error(
'[CoderAgentExecutor] Could not get request from async local storage. Cancellation on socket close will not be handled for this request.',
);
Expand All @@ -316,7 +316,7 @@ export class CoderAgentExecutor implements AgentExecutor {
const abortController = new AbortController();
const abortSignal = abortController.signal;

if (store) {
if (store != null) {
// Grab the raw socket from the request object
const socket = store.req.socket;
const onClientEnd = () => {
Expand Down Expand Up @@ -344,10 +344,10 @@ export class CoderAgentExecutor implements AgentExecutor {

let wrapper: TaskWrapper | undefined = this.tasks.get(taskId);

if (wrapper) {
if (wrapper != null) {
wrapper.task.eventBus = eventBus;
logger.info(`[CoderAgentExecutor] Task ${taskId} found in memory cache.`);
} else if (sdkTask) {
} else if (sdkTask != null) {
logger.info(
`[CoderAgentExecutor] Task ${taskId} found in TaskStore. Reconstructing...`,
);
Expand All @@ -363,7 +363,6 @@ export class CoderAgentExecutor implements AgentExecutor {
};
eventBus.publish({
kind: 'status-update',
taskId,
contextId: sdkTask.contextId,
status: {
state: 'failed',
Expand All @@ -377,12 +376,13 @@ export class CoderAgentExecutor implements AgentExecutor {
},
],
messageId: uuidv4(),
taskId,
contextId: sdkTask.contextId,
taskId,
} as Message,
},
final: true,
metadata: { coderAgent: stateChange },
taskId,
});
return;
}
Expand All @@ -393,7 +393,7 @@ export class CoderAgentExecutor implements AgentExecutor {
] as AgentSettings;
wrapper = await this.createTask(
taskId,
contextId as string,
contextId,
agentSettings,
eventBus,
);
Expand All @@ -415,13 +415,6 @@ export class CoderAgentExecutor implements AgentExecutor {
}
}

if (!wrapper) {
logger.error(
`[CoderAgentExecutor] Task ${taskId} is unexpectedly undefined after load/create.`,
);
return;
}

const currentTask = wrapper.task;

if (['canceled', 'failed', 'completed'].includes(currentTask.taskState)) {
Expand Down
6 changes: 3 additions & 3 deletions packages/a2a-server/src/agent/task.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ describe('Task', () => {

await task.scheduleToolCalls(requests, abortController.signal);

expect(requests).toEqual(originalRequests);
expect(requests).toStrictEqual(originalRequests);
});

describe('acceptAgentMessage', () => {
Expand Down Expand Up @@ -145,7 +145,7 @@ describe('Task', () => {

// Access private field for testing
// eslint-disable-next-line @typescript-eslint/no-explicit-any
expect((task as any).modelInfo).toEqual({
expect((task as any).modelInfo).toStrictEqual({
model: 'gemini-2.0-flash-exp',
});
});
Expand Down Expand Up @@ -286,7 +286,7 @@ describe('Task', () => {

// Should have the latest modelInfo
// eslint-disable-next-line @typescript-eslint/no-explicit-any
expect((task as any).modelInfo).toEqual({
expect((task as any).modelInfo).toStrictEqual({
model: 'gemini-2.0-flash-exp',
});
});
Expand Down
32 changes: 19 additions & 13 deletions packages/a2a-server/src/agent/task.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

import {
CoreToolScheduler,
type CoreToolScheduler,
GeminiClient,
GeminiEventType,
ToolConfirmationOutcome,
Expand Down Expand Up @@ -37,7 +37,7 @@ import type {
ModelInfo,
} from '@vybestack/llxprt-code-core';
import type { RequestContext } from '@a2a-js/sdk/server';
import { type ExecutionEventBus } from '@a2a-js/sdk/server';
import type { ExecutionEventBus } from '@a2a-js/sdk/server';
import type {
TaskStatusUpdateEvent,
TaskArtifactUpdateEvent,
Expand Down Expand Up @@ -185,7 +185,10 @@ export class Task {
this.toolCompletionNotifier = { resolve, reject };
});
// If there are no pending calls when reset, resolve immediately.
if (this.pendingToolCalls.size === 0 && this.toolCompletionNotifier) {
if (
this.pendingToolCalls.size === 0 &&
this.toolCompletionNotifier != null
) {
this.toolCompletionNotifier.resolve();
}
}
Expand All @@ -207,7 +210,10 @@ export class Task {
logger.info(
`[Task] Resolved tool call: ${toolCallId}. Pending: ${this.pendingToolCalls.size}`,
);
if (this.pendingToolCalls.size === 0 && this.toolCompletionNotifier) {
if (
this.pendingToolCalls.size === 0 &&
this.toolCompletionNotifier != null
) {
this.toolCompletionNotifier.resolve();
}
}
Expand All @@ -229,7 +235,7 @@ export class Task {
`[Task] Cancelling all ${this.pendingToolCalls.size} pending tool calls. Reason: ${reason}`,
);
}
if (this.toolCompletionNotifier) {
if (this.toolCompletionNotifier != null) {
this.toolCompletionNotifier.reject(new Error(reason));
}
this.pendingToolCalls.clear();
Expand All @@ -243,11 +249,11 @@ export class Task {
): Message {
return {
kind: 'message',
role,
parts: [{ kind: 'text', text }],
messageId: uuidv4(),
taskId: this.id,
contextId: this.contextId,
role,
};
}

Expand Down Expand Up @@ -286,8 +292,8 @@ export class Task {
contextId: this.contextId,
status: {
state: stateToReport,
message, // Shorthand property
timestamp: timestamp || new Date().toISOString(),
message,
},
final,
metadata,
Expand All @@ -308,7 +314,7 @@ export class Task {

if (messageText) {
message = this._createTextMessage(messageText);
} else if (messageParts) {
} else if (messageParts != null) {
message = {
kind: 'message',
role: 'agent',
Expand Down Expand Up @@ -361,9 +367,9 @@ export class Task {
kind: 'artifact-update',
taskId: this.id,
contextId: this.contextId,
artifact,
append: true,
lastChunk: false,
artifact,
};
this.eventBus?.publish(artifactEvent);
}
Expand Down Expand Up @@ -549,7 +555,7 @@ export class Task {
'response',
);

if (tc.tool) {
if (tc.tool != null) {
serializableToolCall.tool = this._pickFields(
tc.tool,
'name',
Expand Down Expand Up @@ -712,7 +718,7 @@ export class Task {
const request = updatedRequests.find(
(req) => req.callId === callId,
);
if (request) {
if (request != null) {
request.checkpoint = checkpointPath;
logger.info(
`[Task] Checkpoint created for callId ${callId}: ${checkpointPath}`,
Expand All @@ -734,7 +740,7 @@ export class Task {
}
}

if (!this.scheduler) {
if (this.scheduler == null) {
throw new Error('Scheduler not initialized');
}
await this.scheduler.schedule(updatedRequests, abortSignal);
Expand Down Expand Up @@ -875,7 +881,7 @@ export class Task {

const confirmationDetails = this.pendingToolConfirmationDetails.get(callId);

if (!confirmationDetails) {
if (confirmationDetails == null) {
logger.warn(
`[Task] Received tool confirmation for unknown or already processed callId: ${callId}`,
);
Expand Down
Loading
Loading