From dec8e8632d675c81c3658d5c7a5f9f9399b18f1f Mon Sep 17 00:00:00 2001 From: hibaa23 Date: Sat, 15 Aug 2026 22:22:47 +0100 Subject: [PATCH] fix: propagate real container exit code instead of hardcoding 0 --- internal/execution/runner_docker.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/internal/execution/runner_docker.go b/internal/execution/runner_docker.go index 0338881..ef47f1c 100644 --- a/internal/execution/runner_docker.go +++ b/internal/execution/runner_docker.go @@ -57,7 +57,7 @@ func (d *DockerExecutor) Run(ctx context.Context, command string) (*Result, erro } statusCh, errCh := d.cli.ContainerWait(ctx, containerID, container.WaitConditionNotRunning) - + var exitCode int64 select { case <-ctx.Done(): return nil, fmt.Errorf("container timed out: %w", ctx.Err()) @@ -65,7 +65,8 @@ func (d *DockerExecutor) Run(ctx context.Context, command string) (*Result, erro if err != nil { return nil, fmt.Errorf("container wait error: %w", err) } - case <-statusCh: // the container stopped successfully” + case status := <-statusCh: + exitCode = status.StatusCode } out, err := d.cli.ContainerLogs( @@ -86,7 +87,7 @@ func (d *DockerExecutor) Run(ctx context.Context, command string) (*Result, erro return &Result{ Stdout: stdout.String(), Stderr: stderr.String(), - ExitCode: 0, + ExitCode: int(exitCode), }, nil }