fix(agentworker): the agent works from its worktree, so a resumed stage in an OpenShell sandbox finds the repository
This commit is contained in:
1 file changed
+7
@@ -5,6 +5,7 @@ import (
|
||||
"context"
|
||||
"log/slog"
|
||||
"net/http"
|
||||
"os"
|
||||
"time"
|
||||
|
||||
"github.com/samcharles93/archie-core/internal/agentexec"
|
||||
@@ -125,6 +126,12 @@ func run(ctx context.Context, settings Settings, log *slog.Logger, dependencies
|
||||
return &StartupError{Operation: "model proxy", Err: err}
|
||||
}
|
||||
}
|
||||
// Commands run with no directory of their own run in the worktree. The
|
||||
// runtime's starting directory is not it: an OpenShell sandbox starts
|
||||
// elsewhere, and a resumed stage carries no directory.
|
||||
if err := os.Chdir(workDir); err != nil {
|
||||
return &StartupError{Operation: "enter worktree", Err: err}
|
||||
}
|
||||
dependencies.markSafe(ctx, workDir, log)
|
||||
|
||||
// The task is known before connecting: the worker logs in as its task,
|
||||
|
||||
Reference in new issue
Block a user