Repository navigation
feat(cli): Number tier commands with Hybrid Link resolution and merge - #35
Conversation
Add session tier quote/confirm/status and session hybrid-merge-candidates. Quote accepts --keep, --split --stay --new-number-name, and --merge-with; hybrid_resolution_required names the flags to add. CI verifies against the companion SDK source until it is published.
|
Warning Review limit reachedThe included review limit has been reached and this organization has disabled usage-based review continuation. Wait for reviews to reset or ask a billing admin to change After included review limits.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Next included review available in 3 minutes. View limit detailsLimit details: You’ve used all 2 included reviews currently available. Your 69 included PR review attempts over the past 7 days set your current allowance at 2 reviews per hour. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (10)
Comment |
|
@codex review |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Merge candidates show whether each Number can be absorbed, print the merge command for eligible pairs, and explain each ineligible reason, including transition_in_progress, pairing_in_progress and hms_enabled. A merge that would absorb a hosted-storage Number explains which Number to keep. CI now builds SDK f89365c.
The missing-choice code is hybrid_choice_required. session tier status explains a queued change rejected for that reason. CI builds SDK aa64132.
Take dev's call-analytics retrieve, which no longer needs the source-pin cast. CI builds SDK 6271f47.
Adds typed Number tier commands with Hybrid Link tier transitions. Before this PR the CLI had no tier-change command; the README pointed users to raw
apicalls.--keep,--splitand--merge-withare mutually exclusive.--stay/--new-number-namework only with--split, and the name follows the API pattern.--merge-withneeds--tier proand a UUID. Every invalid combination exits 2 before a request.--projectis sent as the bodyprojectId.metaDisconnectRequiredis true. It also prints the next command (confirm or status).--jsonprints{data, metadata}like the other Platform commands.hybrid_choice_required(409, exit 4) adds: "Choose --keep linked_devices|official_api, or --split --stay linked_devices|official_api --new-number-name NAME, and quote again."hybrid_transition_ineligible(exit 4) keeps the API's message, which carries the reason.session hybrid-merge-candidateslabels each Number "can be absorbed" or "must be kept" (fromcanBeAbsorbed; a Number with hosted message storage must be kept). For an eligible pair it prints the exact merge command. For an ineligible pair it explains every reason, includingtransition_in_progress,pairing_in_progressandhms_enabled. Without Hybrid Link access, the API's403 feature_unavailableexits 3.--merge-withis not refused locally for hosted storage, because the quote command cannot know it without a second request; the API decides. When the API rejects withhybrid_transition_ineligible: hms_enabled, the CLI adds: "A Number with hosted message storage must be kept: quote the merge on it and pass the other Number to --merge-with."hybrid_choice_required(API PR #381), replacinghybrid_resolution_required. It still exits 4 with the--keep/--splithint.session tier statusexplains a queued change rejected withfailureReason: "hybrid_choice_required"and says to quote again with a choice.confirmrequires--yesbecause it charges credit and records the connection change. It never creates or confirms a replacement quote.session:tiertopic. README "Number tier changes" section replaces the raw-API instructions.SDK dependency
The commands need unpublished SDK changes from polymorfa/sdks#304 (
6271f4734476c195b4a84d1863561222a8e515d1), which pins API contractpolymorfa/polymorfa@fcf7b21015dd185e987b5aa3580e8af5f4c7f1a4(brancht3code/hybrid-pro-downgrade, API PR #404, not yet merged). As in #33, CI temporarily checks out that exact SDK commit, builds it, packs it and installs it with--no-save.package.json/package-lock.jsonstill pin thedevregistry version (0.1.0-dev.20261001215108). Before merging: publish the SDK, bump the registry pin (package.json and lockfile) to the new0.1.0-dev.*, and remove the CI source override.Six-part assessment
fcf7b21owns the routes, the 409/403 codes and the authority checks.messaging.hybrid-linkand keeps the downgrade resolution ungated. No flag or rollout change.admin-hybrid-linkview.Verification (Node 24.15, local SDK tarball from #304 @
6271f47, after merging CLIdevas of 2026-10-02)src/services/call-analytics.ts. I resolved it by taking dev's version: dev now callscalls.retrievedirectly, so this branch's earlier lint suppression is gone.format:check,lint,typecheck,build,npm pack --dry-run: passaudit:prod: 0 vulnerabilities. Thebrace-expansionadvisory from the previous revision is resolved ondev.--testTimeout=30000(the host was heavily loaded): 104 files, 1001 tests pass.test/commands/number-tiers.test.tshas 26 tests.No live API or deployment was exercised.