gemini-cli icon indicating copy to clipboard operation
gemini-cli copied to clipboard

bug(tools): delayed background output reads ignore cancellation

Open Web4everyone32 opened this issue 1 month ago • 12 comments

What happened?

ReadBackgroundOutputInvocation ignores its AbortSignal. Its delay_ms option uses an unconditional setTimeout promise, then continues with process lookup and file reads even after cancellation.

Reproduction: invoke read_background_output with delay_ms=300 and abort its signal after 20 ms. The actual tool still waits roughly 300 ms and returns the fixture log successfully. A long requested delay can therefore keep the underlying invocation running after cancellation.

What did you expect to happen?

An already-aborted signal should reject immediately, and cancelling during the delay should clear the timer and reject promptly with AbortError without reading the process log. Successful delayed reads should continue to work normally.

Client information

Windows, Node.js 22.19.0, npm 10.9.3, upstream main at cd1b45c. Reproduced by executing the actual tool/invocation classes with local fixture files or stubbed remote transport; no authenticated Gemini CLI session or live remote server was required.

Login information

Not applicable to the local reproductions.

Anything else we need to know?

A focused fix and regression tests are being prepared on the fork branch listed below. Could a maintainer triage this for community contribution and apply help wanted if appropriate?

Fork branch: Web4everyone32:codex/background-log-cancellation.

Web4everyone32 avatar Oct 25 '26 23:10 Web4everyone32

/assign

yuvrajangadsingh avatar Oct 26 '26 08:10 yuvrajangadsingh

👋 @yuvrajangadsingh, you've been assigned to this issue! Thank you for taking the time to contribute. Make sure to check out our contributing guidelines.

gemini-cli[bot] avatar Oct 26 '26 08:10 gemini-cli[bot]

PR is up: #29977

cancelling now stops the wait right away (it reuses the existing abortable delay helper), and a call that is already cancelled returns without reading the log.

yuvrajangadsingh avatar Oct 27 '26 17:10 yuvrajangadsingh

👋 @yuvrajangadsingh — it has been more than 7 days since you were assigned to this issue and we could not find a pull request ready for review.

To keep the backlog moving and ensure issues stay accessible to all contributors, we require a PR that is open and ready for review (not a draft) within 7 days of assignment.

We are automatically unassigning you so that other contributors can pick this up. If you are still actively working on this, please:

  1. Re-assign yourself by commenting /assign.
  2. Open a PR (not a draft) linked to this issue (e.g. Fixes #29945) within 7 days so the automation knows real progress is being made.

Thank you for your contribution — we hope to see a PR from you soon! 🙏

gemini-cli[bot] avatar Nov 02 '26 09:11 gemini-cli[bot]

/assign

yuvrajangadsingh avatar Nov 02 '26 11:11 yuvrajangadsingh

👋 @yuvrajangadsingh, you've been assigned to this issue! Thank you for taking the time to contribute. Make sure to check out our contributing guidelines.

gemini-cli[bot] avatar Nov 02 '26 11:11 gemini-cli[bot]

👋 @yuvrajangadsingh — it has been more than 7 days since you were assigned to this issue and we could not find a pull request ready for review.

To keep the backlog moving and ensure issues stay accessible to all contributors, we require a PR that is open and ready for review (not a draft) within 7 days of assignment.

We are automatically unassigning you so that other contributors can pick this up. If you are still actively working on this, please:

  1. Re-assign yourself by commenting /assign.
  2. Open a PR (not a draft) linked to this issue (e.g. Fixes #29945) within 7 days so the automation knows real progress is being made.

Thank you for your contribution — we hope to see a PR from you soon! 🙏

gemini-cli[bot] avatar Nov 10 '26 09:11 gemini-cli[bot]

/assign

yuvrajangadsingh avatar Nov 10 '26 09:11 yuvrajangadsingh

👋 @yuvrajangadsingh, you've been assigned to this issue! Thank you for taking the time to contribute. Make sure to check out our contributing guidelines.

gemini-cli[bot] avatar Nov 10 '26 09:11 gemini-cli[bot]

👋 @yuvrajangadsingh — it has been more than 7 days since you were assigned to this issue and we could not find a pull request ready for review.

To keep the backlog moving and ensure issues stay accessible to all contributors, we require a PR that is open and ready for review (not a draft) within 7 days of assignment.

We are automatically unassigning you so that other contributors can pick this up. If you are still actively working on this, please:

  1. Re-assign yourself by commenting /assign.
  2. Open a PR (not a draft) linked to this issue (e.g. Fixes #29945) within 7 days so the automation knows real progress is being made.

Thank you for your contribution — we hope to see a PR from you soon! 🙏

gemini-cli[bot] avatar Nov 18 '26 09:11 gemini-cli[bot]

/assign

prajwal-dn avatar Nov 27 '26 12:11 prajwal-dn

👋 @prajwal-dn, you've been assigned to this issue! Thank you for taking the time to contribute. Make sure to check out our contributing guidelines.

gemini-cli[bot] avatar Nov 27 '26 12:11 gemini-cli[bot]