Skip to content

[fix] Allow AgentFlow to target a configured base branch instead of always using the repository default #98

Description

@Celine-Coralie-Eni

Problem

AgentFlow currently detects the base branch from the repository’s default branch, usually via origin/HEAD.

This causes problems when a repository’s default branch is not the branch that automation should target.

For example, a repo may use:

  • main as a protected/default branch
  • develop as the integration branch for automated PRs

In that case, AgentFlow may create worktrees, sync changes, check CI, or prepare PR/merge logic against the wrong branch. This can cause PRs to target main when they should target develop.

Proposed Improvements

Add an optional environment variable:

GITHUB_BASE_BRANCH=develop

When set, AgentFlow should use GITHUB_BASE_BRANCH as the base branch.

When unset or empty, AgentFlow should keep the existing behavior and detect the repository default branch normally.

The override should apply to:

  • Worktree/default branch detection
  • VESSEL merge and CI handling
  • LORE documentation PR handling
  • .env.example documentation

Acceptance Criteria

  • GITHUB_BASE_BRANCH can be set to a branch name such as develop.
  • When GITHUB_BASE_BRANCH is set, AgentFlow uses it as the base branch.
  • When GITHUB_BASE_BRANCH is unset or empty, existing default-branch detection remains unchanged.
  • Worktree creation and updates use the configured base branch.
  • VESSEL merge and CI flows use the configured base branch.
  • LORE documentation PR flows use the configured base branch.
  • .env.example documents the optional variable.
  • Branch names are treated as case-sensitive.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions