github / github/app

Child sessions with kickoff do not run Git `post-checkout` hooks

Offen
#3,211 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Keine Sprachdaten
Sterne
2.1k
Forks
153
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

## Summary

Creating a local worktree child session without a kickoff correctly runs the configured Git `post-checkout` hook.

Creating the same session with a kickoff prompt does not run the hook, and the child agent starts in an incompletely initialized worktree.

## Steps to reproduce

1. Configure a Git `post-checkout` hook that:
- writes an entry to a log;
- creates a file or symlink in the worktree.
2. Create a worktree child session without a kickoff.
3. Confirm that the hook ran and created the expected resource.
4. Create another worktree child session with an automatic kickoff prompt.
5. Confirm that:
- no hook-log entry exists;
- the expected resource is missing;
- the child agent has already started.

## Expected behavior

Idle and kickoff-enabled child sessions should use the same worktree initialization process. Git hooks should finish before the kickoff agent starts.

## Actual behavior

The hook runs for idle child sessions but not for kickoff-enabled sessions.

The affected worktree still has the correct commit and Git hook configuration, but hook-created repository resources are absent.

## Impact

Kickoff agents can fail immediately when repository setup relies on Git hooks—for example, to provide shared instructions, skills, configuration, or tool wrappers.

## Suggested fix

Create and fully initialize the worktree before starting the kickoff agent:

1. Create and check out the worktree.
2. Run configured Git hooks.
3. Wait for initialization to complete.
4. Start the child agent and deliver the kickoff prompt.

Hook failures should be reported as workspace-creation failures.

## Workaround

Create the child session without a kickoff, wait for hook initialization, and send the task prompt afterward.

This workaround may lose kickoff-specific model, reasoning-effort, or mode selection.

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Trace the child-session worktree creation and kickoff startup paths, comparing the idle and kickoff-enabled flows described in the reproduction steps. Verify that the worktree is fully initialized and configured Git post-checkout hooks finish before the kickoff agent starts, and confirm hook failures are reported as workspace-creation failures.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
git
Bereich
developer-experience
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Aktiv
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
68/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.