Why: cmd_finish ran git submodule deinit --all, but submodule.<name>.url entries live in the shared .git/config — finishing any task silently marked every other checkout and worktree uninitialized (observed twice on 2026-09-30: main checkout uninit=12 after each finish; a parallel session hit it minutes before this fix landed). The deinit serves no purpose: worktree removal with gitlinks is refused regardless, so cleanup already goes through rm -rf + prune. Also aligns AGENTS.md with observed hook behavior (post-merge fires on ff-only pulls too, and its inline close cannot see cards merged remotely until they are pulled), and ignores the ZCode-generated .zcodeignore that tripped the BUSY gate in every session.
Evidence: bash -n clean; abandon-path smoke of the patched script — start + FORCE_ABANDON=1 finish of a throwaway branch left shared submodule url config at 12 entries (pre-fix: 0), main checkout submodule status uninit=0, smoke worktree and branch fully recycled; the smoke close also backfilled a parallel session card left open (gitea-access-facts) via a card-close branch, proving the fallback path.
Impact: scripts/task.sh cmd_finish only (removes one line, updates comment), AGENTS.md card-close paragraph, .gitignore one entry. No product or gitlink change; make test not applicable (repo-level tooling/docs only). web_base default fix intentionally withdrawn from this PR — landed via parallel PR #73.
Refs: .task/fix-task-finish-close-followups.md
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
fix/task-finish-close-followups 任务卡
任务主记录:<PR 链接,task-finish 时填写>;状态:进行中;owner:weichen
基线与授权
bb1bf06aec目标与非目标
cmd_finish去掉submodule deinit --all——submodule url 配置在共享.git/config,deinit 会把其他检出/worktree 的子模块一并标成未初始化(工作区清理本就走 rm -rf + prune,deinit 无实际作用);②AGENTS.md 任务卡闭合描述与实测对齐(ff-only pull 同样触发 post-merge 钩子;钩子内 close 扫不到远端新合卡,需手动兜底);③.gitignore增加.zcodeignore(ZCode CLI 会话产物,不入库)。同步记录
bb1bf06aecbb1bf06aec结果与验证
cmd_finish删除 deinit 行并留注释说明共享 config 污染机理;AGENTS.md 闭合路径句改写;.gitignore追加.zcodeignore。bug 期间被并行会话现场复现:其 task-finish 后主检出submodule.*.url配置归零(uninit=12),本卡验证前已用 make sync 恢复。bash -n通过;abandon 冒烟——修复版脚本 start→FORCE_ABANDON=1 finish 一条假任务,断言共享submodule.*.url计数 12→12(修复前会归 0)、主检出submodule status --recursiveuninit=0、smoke worktree/分支全部回收;顺带证实 inline close 能兜底闭合并行会话漏闭合的卡(feature-gitea-access-facts,经 feature/card-close-20260930-155017Z 分支)。