* fix: capture exact OpenCode session ID from JSON stream to prevent orphan sessions
- Primary: Extract session_id from opencode run --format json step_start event
- Fallback: Title-based match with newest-first sorting for delayed visibility
- Core: Add atomic reserveSessionId check in spawnOrchestrator to prevent race conditions
- Prevents orphan sessions when multiple spawns use same title or delayed discovery
(cherry picked from commit 42cc0cfa1a)
* fix: capture OpenCode session id from stream output
(cherry picked from commit 42b3bf3ba6)
* fix: respawn orchestrators when stale metadata is left behind
(cherry picked from commit e519628017)
* fix: align respawn guard and opencode test expectation
* fix: remove unused helper from opencode launch path
* fix: remove unused function and align tests with session capture format
- Remove unused buildSessionLookupScript function from opencode agent
- Update integration tests to expect --format json flag in launch commands
- Fix assertions for exec opencode --session wrapper format
* fix: address Bugbot findings on PR #366
- Fix orphaned runtime leak when reuse strategy finds alive runtime but
get() returns null (now destroys the orphaned runtime)
- Restore session ID format validation in fallback script with
isValidId regex check
- Add regression tests for both fixes
* fix: address additional Bugbot findings on PR #366
- Add timestamp helper to fallback sort to avoid NaN from invalid dates
- Add session ID type/format validation to primary capture script
- Add tests for both robustness improvements