Skip to content

Team broker start/stop routes never reply on no-op transitions #8513

Description

@andypalmi

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions