github / github/app

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

未关闭
#3,211 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
没有语言数据
星标
2.1k
派生
153
PR 合并指标
30 天内没有已合并 PR

描述

## 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.

贡献指南

打开贡献指南

调研方向

跟踪 child-session worktree 创建和 kickoff 启动路径,对比复现步骤中描述的空闲流程和启用 kickoff 的流程。验证在 kickoff agent 启动之前,worktree 已完全初始化且配置的 Git post-checkout hooks 已完成,并确认 hook 失败会作为 workspace 创建失败进行报告。

由索引模型根据 Issue 内容生成。

评估

技术栈
git
领域
developer-experience
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
活跃
描述清晰度
基本清楚
新手友好度
68/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。