Skip to content

fix: [#91] Fix build success detection for negative exit codes#390

Open
nandanosql wants to merge 1 commit into
bytedance:mainfrom
nandanosql:fix/issue-91-build-success-detection
Open

fix: [#91] Fix build success detection for negative exit codes#390
nandanosql wants to merge 1 commit into
bytedance:mainfrom
nandanosql:fix/issue-91-build-success-detection

Conversation

@nandanosql
Copy link
Copy Markdown

Fixes #91

Problem

In docker_manager.py, the _execute_interactive method uses regex (\d+) to capture the exit code from shell commands. This fails to match negative exit codes like -1 (returned on timeout or error), causing the success detection to be incorrect.

Solution

Changed the regex from (\d+) to (-?\d+) to allow an optional leading minus sign. This enables proper detection of:

  • Success: exit code 0
  • Failure: any non-zero exit code (positive or negative like -1)

Changes

  • In docker_manager.py line ~183: Changed regex pattern from r"(\d+)" to r"(-?\d+)"

The regex in _execute_interactive used (\d+) to capture exit codes,
which fails to match negative numbers like -1 (returned on timeout).

Changed to (-?\d+) to allow optional leading minus sign, enabling
proper detection of both success (0) and failure (non-zero, including
negative codes like -1 for errors/timeouts).
@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

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.

[Bug]: TRAE 1.4.16版本判断项目编译是否成功是通过返回码判断,未编译成功的也判断为成功

2 participants