---
date: 2026-05-10
title: agent-pool 预热不装 testing/ deps，第一次 push 触发 pre-push hook 必撞
tags: [agent-pool, pre-push, hooks]
---

# 现象

新 claim 一个 slot、做完改动、第一次 `git push` 时触发 pre-push hook 报：

```
pre-push: 未找到 testing/node_modules/.bin/ts-node，请先运行: cd testing && npm install
error: failed to push some refs to 'ssh://43.130.59.228:2222/FFAIWorkspace/workspace.git'
```

push 被拒。

# 根因

agent-pool 预热脚本（`pool-init.sh` / `agent-claim.sh`）只装了 `backend/` 和 `frontend/` 的 `node_modules`，**不装 `testing/`**。但仓库的 pre-push hook 会跑 `testing/` 下的 ts-node 脚本（应该是 contract-check 或类似的 CI 静态检查本地版），命中即 fail。

# 解决

`cd testing && npm install` 一次（约 2-5 秒，slot 内 npm cache 已暖），然后重 push。

# 教训

- **slot 预热契约不全**：不只是 backend/frontend，testing/ 也需要装
- **第一次 push 才暴露**：claim 后 build / test 路径都不会触发 testing/ 的 ts-node，只有 push hook 才会
- **建议**：`pool-init.sh` 同步装 testing/——pre-warm 阶段慢一点没事，省去每次 claim 后的 friction

# 跟 ERR-20260510-001 的区别

ERR-001 是 `agent-claim.sh` 的 stdout/stderr 契约（eval 时不能 `2>&1` 合并）——claim 阶段的问题。
ERR-002（本条）是 slot 预热范围不全——claim 后第一次 push 才暴露。
两条都跟 agent-pool 工作流的"看似预热好但有盲点"有关。
