Skip to content

fix(mpc): make create point to participant add instead of a 405 - #98

Merged
Priyanshu (priyanshu-plivo) merged 1 commit into
mainfrom
fix/mpc-create-fail-fast
Sep 29, 2026
Merged

Priyanshu (priyanshu-plivo) merged 1 commit into
mainfrom
fix/mpc-create-fail-fast

Conversation

@priyanshu-plivo

Copy link
Copy Markdown
Contributor

What

plivo voice multiparty create could never succeed. It POSTed to /v1/Account/{auth_id}/MultiPartyCall/, but that collection is GET-only in Plivo's API, so every call got a 405. There is no create-MPC endpoint: an MPC starts when its first participant is added, and plivo voice multiparty participant add <name> already does that. It posts to name_<name>/Participant/, and Plivo creates the MPC if no ongoing call with that name exists.

Change

  • create now sends nothing and needs no credentials or --yes. It exits BAD_INPUT (exit 1) with a hint to run plivo voice multiparty participant add <name> --from <number> --to <number> --role agent --yes.
  • It is Hidden, so it no longer shows in help, docs/COMMANDS.md or completion. It stays registered with its old flags, none required, so existing scripts get the guidance rather than "unknown command" or "unknown flag". Hidden was chosen over cobra's Deprecated because Deprecated prints an extra stderr line in front of the JSON error envelope.
  • cli-skill/SKILL.md drops create and notes that participant add <name> starts the MPC.
  • participant add itself is unchanged; its dry-run output is byte-identical.

Tests

  • New cmd/mpc_test.go has two cases: the old flags plus --yes against a server that records every request, and a bare create while logged out. Both assert that nothing is sent, the error is BAD_INPUT with exit 1, and the hint names the real participant add command path. Against the old code the first case caught the POST and the second failed on the required --name.
  • The spend-verb and required-flag test tables drop create. Help goldens changed only for voice multiparty and voice multiparty create.
  • Run locally, all passing: go test -race ./..., golangci-lint run, GOOS=windows go build ./..., scripts/smoke.sh, and make docs drift.

Plivo has no create-MPC API: the MultiPartyCall collection is GET-only,
so create always got a 405. An MPC starts when its first participant is
added, which `participant add <name>` already does.

create now sends nothing and needs no credentials or --yes. It exits
BAD_INPUT with that command as the hint, is hidden from help and docs,
and keeps its old flags so existing scripts reach the guidance.
@priyanshu-plivo
Priyanshu (priyanshu-plivo) merged commit 3381929 into main Sep 29, 2026
15 of 16 checks passed
@priyanshu-plivo
Priyanshu (priyanshu-plivo) deleted the fix/mpc-create-fail-fast branch September 29, 2026 08:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant