Preserve Codex cwd on turns
This commit is contained in:
@@ -270,9 +270,11 @@ func (c *Client) StartTurn(ctx context.Context, threadID, cwd, model, reasoningE
|
||||
params := map[string]any{
|
||||
"threadId": threadID,
|
||||
"input": input,
|
||||
"cwd": cwd,
|
||||
"approvalPolicy": "on-request",
|
||||
"sandboxPolicy": SandboxPolicy(sandbox, cwd),
|
||||
}
|
||||
if strings.TrimSpace(cwd) != "" {
|
||||
params["cwd"] = cwd
|
||||
params["sandboxPolicy"] = SandboxPolicy(sandbox, cwd)
|
||||
}
|
||||
if model != "" {
|
||||
params["model"] = model
|
||||
|
||||
@@ -710,7 +710,7 @@ func (b *Bot) continueThread(ctx context.Context, message *Message, session stor
|
||||
return err
|
||||
}
|
||||
|
||||
thread, workspace, err := b.ensureThread(ctx, userID, chatID, session)
|
||||
thread, _, err := b.ensureThread(ctx, userID, chatID, session)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -723,7 +723,7 @@ func (b *Bot) continueThread(ctx context.Context, message *Message, session stor
|
||||
}
|
||||
|
||||
b.registerOutput(thread.CodexThreadID, chatID)
|
||||
turn, err := b.codex.StartTurn(ctx, thread.CodexThreadID, workspace.Path, session.Model, session.ReasoningEffort, session.Sandbox, input)
|
||||
turn, err := b.codex.StartTurn(ctx, thread.CodexThreadID, "", session.Model, session.ReasoningEffort, session.Sandbox, input)
|
||||
if err != nil {
|
||||
b.clearOutput(thread.CodexThreadID)
|
||||
return b.sendError(ctx, chatID, "Codex turn failed", err)
|
||||
|
||||
Reference in New Issue
Block a user