Skip to content

fix: handle TimeoutExpired and OSError in dispatch_command() - #3921

Open
Quratulain-bilal wants to merge 1 commit into
github:mainfrom
Quratulain-bilal:fix/dispatch-timeout-handler
Open

fix: handle TimeoutExpired and OSError in dispatch_command()#3921
Quratulain-bilal wants to merge 1 commit into
github:mainfrom
Quratulain-bilal:fix/dispatch-timeout-handler

Conversation

@Quratulain-bilal

Copy link
Copy Markdown
Contributor

Problem

subprocess.run() with timeout parameter can raise TimeoutExpired if the timeout elapses. Also catch OSError for cases where the binary is not found or not executable.

Fix

Added try/except blocks to handle both exception types in both base and copilot dispatch_command().

subprocess.run() with timeout parameter can raise TimeoutExpired if the
timeout elapses. Also catch OSError for cases where the binary is not
found or not executable (TOCTOU race between shutil.which and run).
@Quratulain-bilal
Quratulain-bilal requested a review from mnriem as a code owner July 31, 2026 15:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant