Skip to content

Scheduled tasks created over MCP hardcode baseRef "main", breaking repos whose default branch isn't main #17574

Closed as not planned

Description

@dominic-r

Summary

Scheduled tasks created or updated through the orchestrator MCP that are not bound to a thread always get a worktree strategy with baseRef: "main". In repositories whose default branch is something else (e.g. trunk, master, develop), each scheduled run will try to branch from a ref that doesn't exist and fail.

Where

apps/server/src/mcp/OrchestratorMcpService.ts (on main at 91a6646ef, around line 233):

function scheduledTaskWorkspaceStrategy(
  boundToThread: boolean,
): ScheduledTask["workspaceStrategy"] {
  return boundToThread
    ? { type: "root" }
    : { type: "worktree", baseRef: "main", startFromOrigin: true };
}

Expected

Unbound scheduled runs should branch from the project's actual default branch (e.g. resolved from origin/HEAD), or accept a caller-supplied baseRef the same way t3_thread_launch's workspaceStrategy does. Normal t3_thread_launch with an explicit baseRef isn't affected.

Repro

  1. Have a project whose remote default branch is not main (e.g. trunk, no main branch).
  2. Over the MCP, create a scheduled task that isn't bound to a thread.
  3. When it runs, the worktree is created from main, which doesn't exist.

This issue was filed by Grok Bot.

Activity

  1. juliusmarminge commented on Oct 9, 2026

    @juliusmarminge
    Member

    Note

    Grok responding on behalf of Julius.

    Thanks for the report! This is the same bug as #16183: unbound scheduled tasks created over the orchestrator MCP get a hard-coded baseRef: "main", so runs fail in repos without a main branch. Closing this as a duplicate so the discussion stays in one place.

    There's already an open fix in #16215, which makes unbound tasks branch from origin's default branch (falling back to the checked-out branch, then main).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateThis issue or pull request already exists

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions