Team broker start/stop routes never reply on no-op transitions
Summary
The team-broker branches of the broker lifecycle routes in forge/ee/routes/teamBroker/3rdPartyBroker.js do not send a response for two no-op transitions:
POST /api/v1/teams/:teamId/brokers/team-broker/start when the agent is already running: the handler only replies when the agent exists and is not running, or when there is no agent yet. Starting an already-running agent falls through with no reply.send.
POST /api/v1/teams/:teamId/brokers/team-broker/stop when the agent is not running (or does not exist): the else branch is empty (// hmm shouldn't be able to get here) and never replies.
Any caller that hits these branches gets no HTTP response, so the request hangs.
Impact
This surfaced while adding the MCP broker lifecycle tool in #8503. platform_broker_lifecycle_action exposes start/stop/suspend directly, so an agent can reach these transitions (unlike the UI, which only offers the valid action for the current state). The tool's inject call then hangs with no timeout behind it, stalling the caller. The tool description mitigates it by telling callers to check platform_get_broker first, but the underlying route should not leave a request unanswered.
Suggested fix
Send a response in both dead branches, for example a 200 for the already-in-target-state case (the transition is effectively a no-op), so the routes always reply regardless of current state.
start on an already-running team-broker agent: reply instead of falling through.
stop on a team-broker agent that is not running or does not exist: reply from the else branch.
Notes
Route-only change, no MCP tool changes needed. The tools from #8503 are correct as written and will work unchanged once the routes always reply.
Team broker start/stop routes never reply on no-op transitions
Summary
The
team-brokerbranches of the broker lifecycle routes inforge/ee/routes/teamBroker/3rdPartyBroker.jsdo not send a response for two no-op transitions:POST /api/v1/teams/:teamId/brokers/team-broker/startwhen the agent is already running: the handler only replies when the agent exists and is not running, or when there is no agent yet. Starting an already-running agent falls through with noreply.send.POST /api/v1/teams/:teamId/brokers/team-broker/stopwhen the agent is not running (or does not exist): theelsebranch is empty (// hmm shouldn't be able to get here) and never replies.Any caller that hits these branches gets no HTTP response, so the request hangs.
Impact
This surfaced while adding the MCP broker lifecycle tool in #8503.
platform_broker_lifecycle_actionexposes start/stop/suspend directly, so an agent can reach these transitions (unlike the UI, which only offers the valid action for the current state). The tool'sinjectcall then hangs with no timeout behind it, stalling the caller. The tool description mitigates it by telling callers to checkplatform_get_brokerfirst, but the underlying route should not leave a request unanswered.Suggested fix
Send a response in both dead branches, for example a 200 for the already-in-target-state case (the transition is effectively a no-op), so the routes always reply regardless of current state.
starton an already-running team-broker agent: reply instead of falling through.stopon a team-broker agent that is not running or does not exist: reply from theelsebranch.Notes
Route-only change, no MCP tool changes needed. The tools from #8503 are correct as written and will work unchanged once the routes always reply.