launch: accept config.phase_teams as a valid team source
ci / gates (push) Successful in 5s
ci / rust (push) Failing after 10s
ci / frontend (push) Successful in 26s
ci / e2e (push) Skipped
ci / publish (push) Skipped

Missions created via the new multi-team wizard have neither team_id
nor team_template_id set — they carry config.phase_teams. Both the
frontend Launch button gate and the backend set_status precondition
were checking only the old two fields, disabling launch for every
new wizard-created mission with a "No team" tooltip.

  - MissionCanvas: hasTeam now also returns true when
    mission.config.phase_teams has at least one non-empty list.
  - routes::missions::set_status: same check on the server so a
    direct API caller with only config.phase_teams also gets past
    the gate.

Directly unblocks the "we just finished the wizard, Launch is greyed
out" report. Agents materialize AFTER Launch — the button is the
trigger, not a post-condition of creation.
This commit is contained in:
Omar Sobh
2026-07-21 05:26:27 -07:00
parent f0dd0147f6
commit eb1df6acde
2 changed files with 34 additions and 3 deletions
@@ -411,8 +411,21 @@ export function MissionCanvas({
<RefreshCw size={13} />
</button>
{mission.status === "draft" && (() => {
// Launch is enabled when we have SOMETHING that can
// materialize agents:
// - team_id set (already materialized)
// - team_template_id set (legacy single-team path)
// - config.phase_teams has entries (new multi-team wizard path)
const phaseTeams =
(mission.config as { phase_teams?: Record<string, string[]> })
?.phase_teams;
const hasPhaseTeams =
phaseTeams &&
Object.values(phaseTeams).some((arr) => arr.length > 0);
const hasTeam =
mission.team_id !== null || mission.team_template_id !== null;
mission.team_id !== null ||
mission.team_template_id !== null ||
Boolean(hasPhaseTeams);
const disabled = launching || !hasTeam;
return (
<button