Skip to content

Conductor Quick Start gstack template fails when generated repo has unborn HEAD #1176

Closed

Description

@JonasFocus

Summary

Conductor Quick Start can fail when creating a new project from the gstack template because the setup/build path assumes git rev-parse HEAD works. In a brand-new generated repo before the first commit exists, HEAD is unborn, so git rev-parse HEAD exits 128 and the template setup aborts.

This is separate from the public garrytan/gstack repository itself: the upstream repo has a valid main HEAD. The failure is triggered by the generated Conductor workspace state during bootstrapping.

Observed Error

From Conductor while creating a new Quick Start project named test at /Users/jonas/conductor/repos with the gstack template:

Installing gstack...
error: script "build" exited with code 128
'git <command> [<revision>...] -- [<file>...]'
Use '--' to separate paths from revisions, like this:
fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree.
Node server bundle ready: /Users/jonas/conductor/repos/test/.claude/skills/gstack/browse/dist/server-node.mjs

Likely Setup Path

Current main appears to route Conductor setup like this:

  • conductor.json runs bin/dev-setup
  • bin/dev-setup creates .claude/skills/gstack -> repo root
  • bin/dev-setup calls .claude/skills/gstack/setup
  • setup runs bun run build when compiled browse output is missing or stale
  • package.json writes git rev-parse HEAD into these version files:
    • browse/dist/.version
    • design/dist/.version
    • make-pdf/dist/.version

The hard failure is here in the build script:

"build": "... && git rev-parse HEAD > browse/dist/.version && git rev-parse HEAD > design/dist/.version && git rev-parse HEAD > make-pdf/dist/.version && ..."

Reproduction Mechanism

I reproduced the same Git failure mode locally by creating a new parent Git repo with no commits, then placing a gstack copy under .claude/skills/gstack without its own .git metadata. From inside that directory:

git rev-parse HEAD

returns:

fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'

That matches the Conductor screenshot error and explains why a normal git clone of garrytan/gstack does not reproduce the issue: a normal clone has a resolved HEAD, while Conductor's generated repo can be in an unborn-HEAD state before the initial commit.

Suggested Fix

Make the build version fallback tolerate unborn Git repos. For example, centralize the version resolution once and write the fallback to all version files:

GSTACK_BUILD_VERSION="$(git rev-parse HEAD 2>/dev/null || printf unknown)"
printf '%s\n' "$GSTACK_BUILD_VERSION" > browse/dist/.version
printf '%s\n' "$GSTACK_BUILD_VERSION" > design/dist/.version
printf '%s\n' "$GSTACK_BUILD_VERSION" > make-pdf/dist/.version

Or inline the same fallback in package.json if keeping the build script single-line is preferred:

(git rev-parse HEAD 2>/dev/null || echo unknown) > browse/dist/.version
(git rev-parse HEAD 2>/dev/null || echo unknown) > design/dist/.version
(git rev-parse HEAD 2>/dev/null || echo unknown) > make-pdf/dist/.version

This should preserve normal cloned-repo behavior while allowing Conductor/new-repo bootstrapping before the first commit exists.

Workaround

Before setup runs, create an initial commit in the generated workspace:

git add -A
git commit -m "Initial commit"
bin/dev-setup

If there is nothing to commit, an empty commit should be enough to create HEAD:

git commit --allow-empty -m "Initialize workspace"
bin/dev-setup

Activity

  1. JonasFocus commented on Apr 24, 2026

    @JonasFocus
    Author

    I opened a PR for this here: #1177

    I also confirmed the diagnosis locally through Conductor.

    A temporary local workaround was to put a narrow git shim earlier in Conductor's PATH that only changes this one case:

    git rev-parse HEAD

    When Git reports an unborn HEAD inside a work tree, the shim returns unknown instead of exiting 128. With that workaround in place, Conductor's GStack Quick Start completed successfully.

    That confirms the root issue: the GStack build currently treats missing HEAD as fatal while Conductor may still be creating a brand-new repo before its first commit exists.

    The PR moves version writing into scripts/write-build-version.sh and uses:

    VERSION="$(git rev-parse --verify HEAD 2>/dev/null || printf unknown)"

    I verified the PR without the local workaround in PATH:

    • focused tests pass
    • full bun run build passes in a fresh Git repo with no commits
    • .version files are written as unknown in the unborn-HEAD case
    • normal committed repos still write the real commit SHA
  2. time-attack commented on Jul 15, 2026

    @time-attack
    Contributor

    @16francej Please close this issue as resolved. The build helper introduced in #1594 safely handles a brand-new repository with no first commit, so the Conductor quick-start build no longer aborts on Git metadata.

  3. capy-ai commented on Oct 2, 2026

    @capy-ai
    Contributor

    Verified fixed on main (v1.91.12.0): scripts/write-version-files.sh tolerates an unborn HEAD and writes an empty version instead of failing, so the Conductor quick-start build succeeds in a brand-new repo. Shipped in v1.64.0.0 (#2571, absorbing #1594). Thanks! Reply here if you still see the failure and we'll reopen.

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions