Skip to content

Commit c45d69b

Browse files
wenshaoclaude
andcommitted
fix: re-check abort signal after async operations in handleGetContextUsage
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 32ee12e commit c45d69b

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

packages/cli/src/nonInteractive/control/controllers/systemController.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,9 @@ export class SystemController extends BaseController {
8383

8484
try {
8585
const mod = await import('../../../ui/commands/contextCommand.js');
86+
if (signal.aborted) {
87+
throw new Error('Request aborted');
88+
}
8689
if (typeof mod.collectContextData !== 'function') {
8790
throw new Error('collectContextData is not available');
8891
}
@@ -91,6 +94,9 @@ export class SystemController extends BaseController {
9194
this.context.config,
9295
showDetails,
9396
);
97+
if (signal.aborted) {
98+
throw new Error('Request aborted');
99+
}
94100

95101
return {
96102
subtype: 'get_context_usage',

0 commit comments

Comments
 (0)