fix: Use coreEvents.emitFeedback directly for deprecation warning

Removes the unnecessary setTimeout wrapper when emitting the allowedTools
deprecation warning, leveraging the built-in event backlog mechanism of
CoreEventEmitter.
This commit is contained in:
Abhijit Balaji
2026-02-03 13:47:23 -08:00
parent 4731df1fe6
commit ba48dd04b4

View File

@@ -520,12 +520,10 @@ export async function main() {
// Show deprecation warning only for allowedTools as that's the only one set by the user currently via command line args
if (config.getAllowedTools() !== undefined) {
setTimeout(() => {
coreEvents.emitFeedback(
'warning',
`The allowed-tools cli argument is deprecated and will be removed in Gemini CLI 1.0: Please use the Policy Engine to manage tool permissions instead: https://geminicli.com/docs/core/policy-engine/`,
);
}, 0);
coreEvents.emitFeedback(
'warning',
`The allowed-tools cli argument is deprecated and will be removed in Gemini CLI 1.0: Please use the Policy Engine to manage tool permissions instead: https://geminicli.com/docs/core/policy-engine/`,
);
}
if (config.isInteractive() && config.storage && config.getDebugMode()) {