Skip to content

connection upsert/update report success when a destination change is ignored #466

Description

@leggetter

The API never changes the destination of an existing connection ("A connection's source and destination cannot be updated", core server/api/routes/gateway/webhook.ts#L312). The CLI sends the change anyway and reports success, so the user thinks the connection was re-pointed when it wasn't.

Repro

Existing connection deepgram-tts with destination local-deepgram (production, CLI built from main, 2026-10-02):

Command Result
gateway connection upsert deepgram-tts --source-name deepgram-tts --source-type WEBHOOK --destination-name local-deepgram-tts --destination-type CLI --destination-cli-path /tts/webhook exit 0, destination unchanged. local-deepgram-tts is created as an orphan
gateway connection upsert deepgram-tts --destination-id des_NEW 422 value must contain at least one of [source_id, source]
gateway connection upsert deepgram-tts --source-id src_X --destination-id des_NEW exit 0, destination unchanged
gateway connection update web_ID --destination-id des_NEW exit 0, prints the old destination path, destination unchanged

Cause

Suggested fix

  1. upsert: when the connection exists and the requested destination (ID or name) differs from its current one, exit non-zero before calling the API. Say a connection's destination can't be changed, and suggest creating a new connection or deleting and recreating it.
  2. Do this before the inline destination upsert, so no orphan is created.
  3. update: remove --destination-id and --source-id, or error when they differ from the current values.
  4. Count --destination-id and --destination-name in needsExistingConnection().
  5. Apply the same checks to the MCP gateway_connections_write tool.

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