[Phase 5] cmd_continue return proper exit codes #248

Closed
opened 2026-04-08 06:34:37 +02:00 by shoko · 0 comments
Owner

Problem

cmd_continue uses exit 1 for all errors, making it difficult for the daemon to distinguish between recoverable errors (max agents) and actual failures.

Solution

Modify cmd_continue and fork_agent to return proper exit codes:

Exit Code Meaning
0 Success - agent forked successfully
1 General error - worktree/session/validation failed
2 Max concurrent agents reached (MAX_CONCURRENT_AGENTS limit)

Key changes:

  1. fork_agent() should NOT exit - return exit code instead
  2. cmd_continue() should NOT exit 1 - return the exit code from fork_agent()
  3. Return exit code 2 when max agents is reached (do not exit, return)

Also create EXITCODES.md documenting all exit codes.

Status

READY - No dependencies

Files

  • skills/kugetsu/scripts/kugetsu-session.sh
  • EXITCODES.md (new file)

Parent: #235

## Problem cmd_continue uses exit 1 for all errors, making it difficult for the daemon to distinguish between recoverable errors (max agents) and actual failures. ## Solution Modify cmd_continue and fork_agent to return proper exit codes: | Exit Code | Meaning | |-----------|---------| | 0 | Success - agent forked successfully | | 1 | General error - worktree/session/validation failed | | 2 | Max concurrent agents reached (MAX_CONCURRENT_AGENTS limit) | Key changes: 1. fork_agent() should NOT exit - return exit code instead 2. cmd_continue() should NOT exit 1 - return the exit code from fork_agent() 3. Return exit code 2 when max agents is reached (do not exit, return) Also create EXITCODES.md documenting all exit codes. ## Status **READY** - No dependencies ## Files - skills/kugetsu/scripts/kugetsu-session.sh - EXITCODES.md (new file) ## Related Issue Parent: #235
shoko added the ready label 2026-04-08 06:38:28 +02:00
shoko closed this issue 2026-04-08 08:42:32 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: shoko/kugetsu#248