Lỗi xóa lane có working tree #28

Closed
opened 2026-09-18 02:14:32 +00:00 by nntrivi2001 · 1 comment
Owner

Thông báo như sau: Lane action failed: lane is not listed as a worktree in /home/khoenv/smartgift/twitter/twitter-execution
image.png

Thông báo như sau: Lane action failed: lane is not listed as a worktree in /home/khoenv/smartgift/twitter/twitter-execution ![image.png](/attachments/555683b9-ce2b-4e04-8012-3149e7b2d880)
284 KiB
nntrivi2001 self-assigned this 2026-09-18 02:14:32 +00:00
Author
Owner

Đã sửa trong v1.6.12: https://git.smartgift.io.vn/Smartgift-AI/AgentHub/releases/tag/v1.6.12

Nguyên nhân. Khi xóa lane, POST /api/lanes/:id/remove gọi removeWorktree → assertDestroyable (server/lib/worktree.js), mà check thứ 3 của nó bắt buộc thư mục của lane phải có trong git worktree list --porcelain của source repo. Lane managed mà git không (còn) liệt kê là worktree sẽ nhận ENOTWORKTREE → HTTP 400 "lane is not listed as a worktree in …", và không bao giờ xóa được khỏi dashboard.

Cách sửa. remove không còn hủy bất cứ thứ gì: nó dừng run + stack, dọn bookkeeping runtime của chính AgentHub trong LANES_ROOT/.state/lane<slot>/, rồi xóa row. Working tree, nhánh, bản ghi worktree của git và database của lane đều giữ nguyên — xóa chúng là việc của bạn, bằng tay (git worktree remove / git branch -d / drop DB). Nhờ vậy không còn đường nào tới ENOTWORKTREE từ remove, không preflight blocker nào chặn nó, và cổng force cho unpushed commits giờ chỉ còn áp cho reset.

UI đi kèm: nút đổi thành "Delete lane record" cho cả hai loại lane, modal ghi rõ thứ gì được giữ lại, bỏ checkbox Force khi xóa.

Có regression test đúng kịch bản của issue trong server/__tests__/lane-lifecycle.test.js ("removes a managed lane whose directory git no longer lists as a worktree (issue #28)").

Cập nhật lên v1.6.12 rồi thử xóa lại giúp mình nhé — nếu vẫn còn lỗi thì mở lại issue này.

Đã sửa trong **v1.6.12**: https://git.smartgift.io.vn/Smartgift-AI/AgentHub/releases/tag/v1.6.12 **Nguyên nhân.** Khi xóa lane, `POST /api/lanes/:id/remove` gọi `removeWorktree` → `assertDestroyable` (`server/lib/worktree.js`), mà check thứ 3 của nó bắt buộc thư mục của lane phải có trong `git worktree list --porcelain` của source repo. Lane managed mà git không (còn) liệt kê là worktree sẽ nhận `ENOTWORKTREE` → HTTP 400 "lane is not listed as a worktree in …", và không bao giờ xóa được khỏi dashboard. **Cách sửa.** `remove` không còn hủy bất cứ thứ gì: nó dừng run + stack, dọn bookkeeping runtime của chính AgentHub trong `LANES_ROOT/.state/lane<slot>/`, rồi xóa row. Working tree, nhánh, bản ghi worktree của git và database của lane đều giữ nguyên — xóa chúng là việc của bạn, bằng tay (`git worktree remove` / `git branch -d` / drop DB). Nhờ vậy không còn đường nào tới `ENOTWORKTREE` từ `remove`, không preflight blocker nào chặn nó, và cổng force cho unpushed commits giờ chỉ còn áp cho `reset`. UI đi kèm: nút đổi thành "Delete lane record" cho cả hai loại lane, modal ghi rõ thứ gì được giữ lại, bỏ checkbox Force khi xóa. Có regression test đúng kịch bản của issue trong `server/__tests__/lane-lifecycle.test.js` ("removes a managed lane whose directory git no longer lists as a worktree (issue #28)"). Cập nhật lên v1.6.12 rồi thử xóa lại giúp mình nhé — nếu vẫn còn lỗi thì mở lại issue này.
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Smartgift-AI/AgentHub#28