* fix: mark task as failed when PR creation fails
Previously, when PR creation failed (e.g. invalid base branch),
the task was still marked as 'completed' even though the PR was
not created. This fix ensures:
- postExecutionFlow returns prFailed/prError on failure
- executeAndCompleteTask marks the task as failed when PR fails
- selectAndExecuteTask runs postExecution before persisting result
The pipeline path (executePipeline) already handled this correctly
via EXIT_PR_CREATION_FAILED.
* fix: use detectDefaultBranch instead of getCurrentBranch for PR base
Previously, baseBranch for PR creation was set to HEAD's current branch
via getCurrentBranch(). When the user was on a feature branch like
'codex/pr-16-review', PRs were created with --base codex/pr-16-review,
which fails because it doesn't exist on the remote.
Now uses detectDefaultBranch() (via git symbolic-ref refs/remotes/origin/HEAD)
to always use the actual default branch (main/master) as the PR base.
Affected paths:
- resolveTask.ts (takt run)
- selectAndExecute.ts (interactive mode)
- pipeline/execute.ts (takt pipeline)
Pipeline mode previously ignored the --create-worktree option.
Now when --create-worktree yes is specified with --pipeline,
a worktree is created and the agent executes in the isolated directory.
- Add createWorktree field to PipelineExecutionOptions
- Pass createWorktreeOverride from routing to executePipeline
- Use confirmAndCreateWorktree when createWorktree is true
- Execute task in worktree directory (execCwd) instead of project cwd
Replace the always-on syncDefaultBranch with opt-in resolveBaseBranch:
- Add auto_fetch config (default: false) — only fetch when enabled
- Add base_branch config (project and global) — fallback to current branch
- Fetch-only mode: git fetch origin without modifying local branches
- Use fetched commit hash (origin/<base_branch>) to reset clone to latest
- No more git merge --ff-only or git fetch origin main:main
Config example:
# ~/.takt/config.yaml or .takt/config.yaml
auto_fetch: true
base_branch: develop
Addresses review feedback: opt-in behavior, no local branch changes,
configurable base branch with current-branch fallback.
interactive.tsからsummary/runSelector/runSessionReader/selectorUtilsを分離し、
run session参照をrouting層からinstructMode層に移動。instructBranchで新タスク
作成の代わりに既存タスクのrequeueを使用する方式に変更。worktree確認プロンプトを
廃止し常時有効化。