fix(agent): Add refresh token validation before token refresh

Check for refresh token availability before attempting credential refresh.
Setup tokens that expire without a refresh token now return a clear error
instead of attempting an invalid refresh operation.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
Lukas May
2026-02-10 10:01:35 +01:00
parent 7f8a936c02
commit 4d3bd9ca90

View File

@@ -68,6 +68,13 @@ export class ProcessManager {
baseBranch
}, 'creating project worktrees');
// No linked projects — fall back to standalone worktree so the agent
// always has a git-backed working directory.
if (projects.length === 0) {
log.info({ alias, initiativeId }, 'initiative has no linked projects, falling back to standalone worktree');
return this.createStandaloneWorktree(alias);
}
for (const project of projects) {
const clonePath = await ensureProjectClone(project, this.workspaceRoot);
const worktreeManager = new SimpleGitWorktreeManager(clonePath, undefined, agentWorkdir);