- Remove duplicate write_index, get_base_session_id, get_pm_agent_session_id,
get_session_for_issue, set_base_in_index, set_pm_agent_in_index,
add_issue_to_index, remove_issue_from_index from kugetsu
- These functions are already defined in kugetsu-index.sh which is sourced earlier
- The kugetsu versions were shadowing the kugetsu-index.sh ones unnecessarily
- This removes code duplication and ensures consistent behavior
Tests run sequentially to avoid memory exhaustion with too many opencode sessions:
- JSON session list parsing
- Session ID format validation
- create_session returns valid session ID
- create_session creates NEW session (different from base)
- create_session creates different sessions on multiple calls
- create_session accepts optional base session parameter
- Created session visible in opencode session list
- Add create_session() function that forks from base session using JSON session detection
- cmd_delegate: fork new session from base instead of using pm_agent
- cmd_start: use create_session() instead of broken before/after detection
- cmd_continue: use --session instead of --continue (no need to continue existing session)
- Remove pm_agent check from cmd_start (no longer needed)
With set -u, expanding $GITEA_TOKEN fails if not set.
Changed to ${GITEA_TOKEN:-} to provide empty default.
Also initializes $ENV_DIR/default.env during kugetsu init
so users are aware of the env file structure.