agent-ecosystem/src
Diego Serrano 080e0af55a
fix(team): resolve stuck "reconciling" state and skip resume when teammates never spawned (#55)
* fix(team): resolve stuck "reconciling" state and skip resume when teammates never spawned

Addresses #54.

When a team launch fails to bootstrap teammates, the team gets stuck showing
"Last launch is still reconciling" indefinitely, and retrying with --resume
reconnects the lead but does not re-spawn the dead teammates. The only
workaround was enabling "Clear context (fresh session)", which loses the
lead's prior conversation context.

Two root causes addressed:

1. createPersistedLaunchSnapshot counted members still in 'starting' state
   (agentToolAccepted=false) as 'pending' regardless of launchPhase. When
   launchPhase was 'finished' with never-spawned members, the aggregate
   state stayed as 'partial_pending' forever, rendered as "still reconciling".
   Fix: when launchPhase != 'active', promote such members to
   'failed_to_start' so the aggregate becomes 'partial_failure'
   ("Launch failed partway"), which correctly signals a terminal state.

2. TeamProvisioningService._launchTeamInner always used --resume when a
   previous leadSessionId existed, even if the previous launch had no
   teammates successfully spawned. The CLI's deterministic reconnect path
   restores lead context but does not re-spawn dead teammates, so the team
   stays broken across relaunches. Fix: before adding --resume, read the
   persisted launch state. If every expected teammate is 'starting' (never
   spawned) or 'failed_to_start', skip --resume so the CLI performs a full
   fresh bootstrap that spawns all teammates.

Verified manually on Linux: a team stuck in "still reconciling" correctly
transitions to "failed partway" after the first fix, and the next Launch
(without "Clear context") fully bootstraps and brings teammates online.

* fix(team): narrow skip resume to never-spawned teammates

---------

Co-authored-by: 777genius <quantjumppro@gmail.com>
2026-04-14 18:31:09 +03:00
..
main fix(team): resolve stuck "reconciling" state and skip resume when teammates never spawned (#55) 2026-04-14 18:31:09 +03:00
preload feat(activity-detail): implement task activity detail retrieval and UI integration 2026-04-13 19:19:52 +03:00
renderer fix(team): preserve provider model ids and codex slash suggestions 2026-04-14 14:56:29 +03:00
shared feat(chat): show project and user skills as slash command suggestions 2026-04-14 14:37:27 +03:00
types feat(agent-teams): integrate MCP tool catalog and enhance tool registration 2026-03-30 17:58:17 +03:00