fix: implement session-counting for MAX_CONCURRENT_AGENTS limit (fixes #63) #65
Reference in New Issue
Block a user
Delete Branch "fix/issue-63-session-counting"
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
Replaced broken slot-based mechanism with session-counting approach per comment #687.
Changes
count_active_dev_sessions()- counts actual session files in~/.kugetsu/sessions/, excludingbase.jsonandpm-agent.jsoncmd_start()- checks session count before creating new session, rejects if at limitwait $child_pid- sinceopencode run --forkreturns immediately, not when child completescmd_continue()- no longer counts toward limit (existing sessions can always continue)How it works
Rules
--continuedoes not count toward limit)Testing
With MAX=3 and 6 existing sessions:
Fixes #63
lgtm