Skip to content

Default chunk task run to create a new branch#433

Open
hidetaka-cci wants to merge 1 commit into
CircleCI-Public:mainfrom
hidetaka-cci:task-run-new-branch-default-true
Open

Default chunk task run to create a new branch#433
hidetaka-cci wants to merge 1 commit into
CircleCI-Public:mainfrom
hidetaka-cci:task-run-new-branch-default-true

Conversation

@hidetaka-cci

Copy link
Copy Markdown
Contributor
  • Default --new-branch to true so chunk task run sends create-new-branch: true when the flag is omitted, matching the Web UI.
  • Users who want to commit on the checkout branch must pass --new-branch=false explicitly.
  • Update docs/CLI.md and tests for the new default.

Closes #432

Motivation

chunk task run without --new-branch could commit agent changes directly to default_branch (often main) with no confirmation. The Web UI always sets create-new-branch: true; chunk-cli defaulted to false, which is unsafe for users following task configtask run.

Behavior change

Invocation Before After
chunk task run ... (no branch flag) create-new-branch: false create-new-branch: true
chunk task run ... --new-branch create-new-branch: true create-new-branch: true (unchanged)
chunk task run ... --new-branch=false N/A (was default false) create-new-branch: false

Breaking change: Scripts that depended on the old silent default must add --new-branch=false.

Example

# Default: agent creates a new branch (same as Web UI)
chunk task run --definition dev --prompt "Fix the flaky test"

# Opt out: commit on the checkout branch (previous default)
chunk task run --definition dev --prompt "Fix the flaky test" --new-branch=false

Changes

Area Change
internal/cmd/task.go --new-branch default falsetrue; updated flag help
docs/CLI.md Flag tree + Behavior Decisions note for default and opt-out
acceptance/task_test.go TestTaskRunHappyPath expects true; TestTaskRunNewBranchFalse for --new-branch=false
internal/task/task_test.go Happy path uses NewBranch: true; add TestTriggerRunNoNewBranch

Out of scope

  • TTY confirmation prompt or --yes / --force for direct commits
  • Server-side auto-override of create-new-branch
  • Changes to --branch or default_branch resolution

Test plan

  • go test -race ./...
  • TestTaskRunHappyPath — default payload sends create-new-branch: true
  • TestTaskRunNewBranchFalse--new-branch=false sends create-new-branch: false
  • TestTriggerRunNoNewBranch — unit coverage for explicit NewBranch: false

Align chunk-cli with the Web UI by sending create-new-branch: true unless
the user passes --new-branch=false to commit on the checkout branch.

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

chunk task run commits to the default branch with no confirmation when --new-branch is omitted

1 participant