[Bug]: `bundle init <bundle>` initialises with the default integration instead of the bundle's, then aborts with a clash
维护者通常 1 天内回复
评估
调研方向
从 src/specify_cli/bundles/command_init.py:33 开始,并比较 bundle install 如何在 src/specify_cli/bundles/command_install.py:98 解析集成;issue 还指出了 src/specify_cli/bundles/_commands.py:132 中的 _resolve_init_integration。运行提供的离线复现步骤以确认不一致。完成标准是 bundle init 使用 bundle 声明的集成初始化一个新项目,并且在没有冲突错误的情况下完成。
由索引模型根据 Issue 内容生成。
描述
Bug Description
In a directory that is not yet a Spec Kit project, specify bundle init <bundle> picks the init integration with _resolve_init_integration(integration, None) (src/specify_cli/bundles/command_init.py:33). Because it passes None instead of the manifest, it skips the bundle-declared integration and initialises the project with the default (copilot). The follow-up install then fails because the bundle targets a different integration.
The project is left initialised with the wrong integration, although the error message says "aborting with no changes". specify bundle install <bundle> in the same situation passes the manifest (command_install.py:98) and initialises with the bundle's integration.
Steps to Reproduce
From the root of a fresh clone after uv sync, save the script below as repro.py and run uv run python -I repro.py. It runs the real specify CLI with --offline. No network access is needed, and HOME points at the temp directory so user configuration is not read.
import json, os, subprocess, tempfile
from pathlib import Path
work = Path(tempfile.mkdtemp())
bundle = work / "claude-bundle"; bundle.mkdir()
(bundle / "bundle.yml").write_text(
'schema_version: "1.0"\n'
'bundle: {id: claude-bundle, name: C, version: "1.0.0", role: dev, description: d, author: a, license: MIT}\n'
'requires: {speckit_version: ">=0.0.1"}\n'
'integration: {id: claude}\n'
)
env = {"PATH": os.environ["PATH"], "HOME": str(work), "COLUMNS": "200"}
for command in (["bundle", "install"], ["bundle", "init"]):
project = work / command[1]; project.mkdir()
run = subprocess.run(["specify", *command, str(bundle), "--offline"],
cwd=project, capture_output=True, text=True, env=env)
state = project / ".specify" / "integration.json"
integration = json.loads(state.read_text())["default_integration"] if state.exists() else None
errors = [line for line in (run.stdout + run.stderr).splitlines() if "Error" in line]
print(f"specify {' '.join(command)}: exit {run.returncode}, project integration={integration}, "
f"bundle recorded={(project / '.specify' / 'bundle-records.json').exists()}")
for line in errors:
print(" ", line)
Expected Behavior
bundle init <bundle> should behave like bundle install <bundle> and initialise with the bundle's declared integration (claude):
src/specify_cli/bundles/_commands.py:132: "Precedence (FR-013): explicit override → bundle-declared → default."docs/reference/bundles.md:192describesbundle initas "an explicit one-step bootstrap for a new checkout".docs/reference/bundles.md:77: if a bundle targets a different integration, install "aborts with no changes".
Actual Behavior
specify bundle install: exit 0, project integration=claude, bundle recorded=True
specify bundle init: exit 1, project integration=copilot, bundle recorded=False
Error: Bundle 'claude-bundle' targets integration 'claude', but this project's active integration is 'copilot'. Installing it would conflict; aborting with no changes.
After the failed bundle init, .specify/integration.json records copilot, and the project has been scaffolded for it.
Error Logs
Error: Bundle 'claude-bundle' targets integration 'claude', but this project's active integration is 'copilot'. Installing it would conflict; aborting with no changes.
Specify CLI Version
1.2.4.dev0 (main at 27d14e2)
AI Agent
Claude Code
Operating System
Linux 6.18 (Ubuntu container)
Python Version
Python 3.12.3
Additional Context
Passing --integration claude explicitly avoids the problem. A likely fix is for bundle init to load the bundle's manifest before initialising, as bundle install does.
Also reproduced on macOS (Darwin 25.6, arm64) with Python 3.14.4 and uv run python -I repro.py against 27d14e2; the output matches the above.
AI Disclosure
Found and reproduced with Claude Code (model: Claude Opus 4.8), run autonomously under human supervision. The human reporter re-ran every reproduction above before filing.
- 主要语言
- Python
- 星标
- 144k
- 派生
- 12.9k
- 平均合并
- 1 天 4 小时
- 30 天内合并 PR
- 181
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
github/spec-kit 的其他 Issue
-
bundle catalog add rewrites Windows drive paths as POSIX paths可能已有人在做 @chelsealong 于 2 天前认领。 未关闭triage-must-have
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
The Python branch-creation port accepts an oversized `--number` and crashes at `int()` instead of rejecting it可能已有人在做 @github-actions 于 3 天前认领。 未关闭bug-assess bug-fix fix-proposed severity-low triage-can-wait
难度 2/5 1-3 小时 新手友好度 84/100
github/spec-kit#5194 · 3 条评论 ·
维护者通常 1 天内回复
-
[Bug]: Cline extension and preset commands have `speckit.*.md` file names rewritten to `speckit-*-md`可能已有人在做 @kevin9327 于 5 天前认领。 未关闭triage-can-wait
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
[Bug]: `create-new-feature.sh` rejects the feature descriptions `-n`, `-e` and `-E`, which the Python script accepts可能已有人在做 @WOLIKIMCHENG 于 7 天前认领。 未关闭triage-can-wait
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
[Bug]: `specify preset set-priority` does not update agent command files that are already written可能已有人在做 @mikamikasuki 于 8 天前认领。 未关闭triage-must-have
难度 2/5 1-3 小时 新手友好度 77/100
维护者通常 1 天内回复
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
enhancement good first issue
难度 2/5 1-3 小时 新手友好度 78/100
elviskahoro/sdk-python-attio#144 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 84/100
维护者通常 1 天内回复
-
RenyiELBO raises TypeError when model has no sample sites可能已有人在做 @alibb007 今天认领。 未关闭
难度 1/5 1 小时以内 新手友好度 85/100
维护者通常 1 天内回复
-
[Bug]: Four evaluation scripts unpack init_memmachine_params's five return values into three names未关闭
难度 1/5 1 小时以内 新手友好度 88/100
MemMachine/MemMachine#1911 ·
维护者通常 3 天内回复