refactor(session): make cmd_continue idempotent with ensure_* functions #230
Reference in New Issue
Block a user
Delete Branch "fix/issue-168"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Simplify kugetsu by making
cmd_continuethe main entry point for session/worktree management. Extract reusable functions socmd_startbecomes a thin wrapper and the daemon can always callcmd_continuewithout existence checks.Changes
ensure_worktree()- creates worktree if missing, returns statusensure_session()- creates session if missing, handles inconsistent statesfork_agent()- extracted agent forking logiccmd_continue()to use ensure_* functions (idempotent)cmd_start()a thin wrapper callingcmd_continue()Closes #168
lgtm