Skip to content

Conversation

@ammar-agent
Copy link
Collaborator

When forkWorkspace() fails during task creation, the fallback logic used parentMeta.name directly as the trunkBranch for git worktree creation. This fails when the parent's branch doesn't exist locally (e.g., SSH workspaces, or branches that were never fetched).

The fix validates that trunkBranch exists as a local branch before using it, falling back to the repository's default trunk branch (main/master/etc) if not found.

Fixes the cosmetic error:

fatal: 'git-debounce-5w4e' is not a commit and a branch
'agent_explore_7eeffc7df6' cannot be created from it

Generated with mux • Model: anthropic:claude-opus-4-5 • Thinking: high

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

When forkWorkspace() fails during task creation, the fallback logic
used parentMeta.name directly as the trunkBranch for git worktree
creation. This fails when the parent's branch doesn't exist locally
(e.g., SSH workspaces, or branches that were never fetched).

The fix validates that trunkBranch exists as a local branch before
using it, falling back to the repository's default trunk branch
(main/master/etc) if not found. For non-git projects (LocalRuntime),
git commands are wrapped in try-catch to fall back to "main".

Fixes the cosmetic error:
  fatal: 'git-debounce-5w4e' is not a commit and a branch
  'agent_explore_7eeffc7df6' cannot be created from it
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.

1 participant