From 0a697970048fc8252d7dfcbbc204b79a96e9f658 Mon Sep 17 00:00:00 2001 From: Janni Turunen Date: Tue, 24 Feb 2026 07:24:35 +0200 Subject: [PATCH] fix(taskctl): replace ctx.session.directory with Instance.directory in executeStart (#336) --- packages/opencode/src/tasks/job-commands.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/opencode/src/tasks/job-commands.ts b/packages/opencode/src/tasks/job-commands.ts index 818ea8414d9..8c8986d8510 100644 --- a/packages/opencode/src/tasks/job-commands.ts +++ b/packages/opencode/src/tasks/job-commands.ts @@ -6,6 +6,7 @@ import { enableAutoWakeup } from "../session/async-tasks" import { runComposer } from "./composer" import { SessionPrompt } from "../session/prompt" import { Worktree } from "../worktree" +import { Instance } from "../project/instance" const log = Log.create({ service: "taskctl.tool.job-commands" }) @@ -69,12 +70,12 @@ export async function executeStart(projectId: string, params: any, ctx: any): Pr // Create the feature branch in the main repository try { const { $ } = await import("bun") - const result = await $`git checkout -b ${safeFeatureBranch} dev`.cwd(ctx.session.directory).quiet().nothrow() + const result = await $`git checkout -b ${safeFeatureBranch} dev`.cwd(Instance.directory).quiet().nothrow() if (result.exitCode !== 0) { log.error("failed to create feature branch", { issueNumber, featureBranch: safeFeatureBranch }) } else { // Push the feature branch to origin - MUST succeed before creating job - const pushResult = await $`git push -u origin ${safeFeatureBranch}`.cwd(ctx.session.directory).quiet().nothrow() + const pushResult = await $`git push -u origin ${safeFeatureBranch}`.cwd(Instance.directory).quiet().nothrow() if (pushResult.exitCode !== 0) { const stderr = pushResult.stderr ? new TextDecoder().decode(pushResult.stderr) : "Unknown error" log.error("failed to push feature branch to origin", { issueNumber, featureBranch: safeFeatureBranch, error: stderr }) @@ -303,4 +304,4 @@ export async function executeResume(projectId: string, params: any, ctx: any): P output: `Pipeline resumed for job ${jobId}. ${remaining} tasks remaining. Pulse is running.`, metadata: {}, } -} \ No newline at end of file +}