Skip to content

v0.15.0

Choose a tag to compare

@github-actions github-actions released this 19 Nov 20:43
· 12 commits to main since this release
9b2ee3c

Router purchases recover after an interruption without a second charge, swarm dissolution refuses while a worker is active or unresolved, and vapi login works on more Linux keyrings.

Added

  • CLI vapi router clear-pending --confirm-settled saves any missing succeeded receipt, prints payment evidence and support guidance, then retires a settled journal under the purchase lock. JSON adds receipt, receiptAppended and notice; prepared, signed and unknown entries are refused. The flag is exclusive with --confirm-unpaid and has no MCP equivalent.
  • CLI purchase/refill JSON and MCP purchase/refill output add optional receipt.settlement (succeeded, rejected or unknown). MCP output schemas accept settlement_unconfirmed, credit_pending and pending_purchase_unlinked warnings.
  • The Router subentry exports ensureRouterPurchaseReceipt to record settled purchase evidence; a separate strict sync gates retirement. Pending purchase journals optionally record baselinePurchasedUsd; older entries remain recoverable through a successful balance-key chat.
  • Payment warnings add settlement_unconfirmed, credit_pending and pending_purchase_unlinked to distinguish unconfirmed authorizations, credit awaiting confirmation, and settled purchases whose link changed.
  • vapi router clear-pending [--confirm-unpaid] prints public payment evidence and explorer instructions. Before clearing, the CLI uses the same receipt/authorization-state resolution as automatic recovery: paid attempts and live authorizations are refused, and unused expired authorizations can clear. Only when chain evidence is unavailable may explicit human confirmation override the guard; output identifies that confirmation as lacking chain evidence. There is no MCP equivalent.
  • CLI vapi swarm forget-run <swarm> <runId> --confirm-destroyed lets an owner confirm a verified unknown/orphaned sandbox is destroyed. It prints the original recorded scope and check command, retains a timestamped forgotten run record and retires the matching sidecar. Missing scope is reported rather than guessed.
  • MCP adds swarm.stop with name and exactly one of runId or all: true. VapiServerOptions.runtimeForStop optionally resolves stop-only adapters by runtime kind. The CLI-hosted server supplies local/Railway stop adapters without enabling remote startup or stale-start confirmation over MCP.
  • PayRequestArgs adds optional beforeSign (also on x402 payment builders) for durable public authorization journaling before signing, and optional receiptId to correlate a durable purchase reservation with its receipt ledger entry. The Router subentry exports routerPurchaseView, the shared public receipt/warning projection.
  • Core exports the PaymentWarning type. The Router subentry exports RouterPurchaseResult, RouterPurchaseWarning and routerPurchaseSummary.
  • Core exports PAYMENT_WARNING_CODES, the list every payment warning schema is derived from, and swarmRunRefillSchema. Swarm member results, delegation records and the MCP Router tools accept the same warning codes and the receipt's settlement outcome, so a refill with an unconfirmed settlement or pending credit no longer fails output validation in a swarm run.
  • Core exports RouterPendingPurchase. Wallet entries expose its public recovery metadata in memory, while WalletStore.setRouterPendingPurchase atomically reserves, updates or clears the matching record in router-pending/<wallet>.json, separate from the v1 wallet registry. Older registry writers cannot erase it. Existing registry records migrate on read; legacy prepared records remain unknown because older clients did not journal signing. Empty tombstones prevent stale registry snapshots from resurrecting cleared purchases.

Breaking

  • MCP runtime RuntimeError.code adds swarm_unavailable and launch_ambiguous. startDetachedRun reserves swarm members under the swarm lock before taking their member lock, revalidates membership and can reject with swarm_unavailable; this applies to local and Railway swarm workers. Standalone agents retain the member-only lock.
  • Exported MCP stopRun now attempts to stop unknown workers and requires successful adapter completion before persisting stopped. Runtime.stop adds an optional { requireSuccessfulExit: true } argument, passed by stopRun for running, unknown and starting Railway records with a saved sandbox id and by launch-persistence rollback; adapters must honor it without text-based absence inference. The Railway adapter always requires destroy exit 0, with or without the option, across launch-failure, signal, terminal-status and direct-stop cleanup; destroyRailwaySidecar requires exit 0 for every sidecar it retires. Stderr warnings are harmless on success; non-zero, interrupted and timeout outcomes reject even when text says not found. Local stops retain their behavior.
  • AgentEvent adds the refill member with public Router purchase evidence and warnings.
  • CLI Router purchase/refill JSON now matches MCP: receipt.id, receipt.amountUsd, receipt.network and optional receipt.transaction replace the flat receiptId, amountUsd, network and transaction fields. Human output includes the public receipt and transaction references.
  • buyRouterBalance returns RouterPurchaseResult with optional PaymentWarning entries. routerPurchaseSummary, CLI purchase JSON and MCP purchase output allow amountUsd: null and network: "unknown" when charged metadata is absent.
  • payRequest returns a confirmed in-memory receipt with warnings when receipt persistence or post-settlement processing fails, instead of rejecting. Callers must retain the receipt and must not repeat the payment for these warnings.
  • RouterClientError adds refill_pending, an optional prior refill purchase (fourth constructor argument, including interrupted purchases awaiting confirmation), and a public toJSON() summary. ChatResult adds optional refill: RouterPurchaseResult; CLI/MCP chat results and errors preserve public payment evidence and warnings.
  • refreshRunRecord now acquires the member lock, re-reads the stored record and returns its fresh state. Unknown and terminal records are never polled from stale snapshots. Missing records reject with RuntimeError("run_not_found"), changed member identity with runtime_unavailable, and lock contention with member_busy. MCP exports withMemberRunLock(home, account, operation) for the same lifecycle lock; no run-record schema or function argument changes in this round.
  • destroyRailwaySidecar serializes cleanup on the recorded member and re-reads ownership/state before acting. Concurrent completed confirmation with no sidecar returns destroyed: true without another Railway call; conflicting/current metadata or contention returns a failed cleanup result. Unattributed legacy cleanup is serialized by run id and does not rewrite failed metadata without a member lock.
  • MCP runtime RunState adds orphaned and forgotten; RunRecord and DetachedRunSummary add optional forgottenAt and confirmedBy: "cli". A forgotten record requires both confirmation fields. RuntimeHandle adds optional railwayScope: { projectId?, environmentId? } for original creation metadata when available. MCP read-only run summaries include these states/confirmation fields; no forget tool is exposed.
  • SwarmErrorCode adds swarm_workers_active for active/unresolved-worker dissolution refusals. CLI JSON and MCP return that shared domain code instead of an untyped error.

Fixed

  • Failed Railway destroys retain evidence that blocks dissolution before any balance read or transfer, including when stderr says not found. A text-only not-found status returns unknown and leaves the sidecar unchanged. Without a run record, use swarm stop --all first; a failed destroy marks the sidecar orphaned for forget-run --confirm-destroyed. Failed starting/running stops become unknown with sanitized detail; when sidecar persistence succeeds, launch-failure and signal cleanup retain an identified orphaned sidecar that CLI forget-run can clear without a reservation, and failed persistence rollback retains its sidecar. Terminal-result cleanup stays running and retries on refresh; a failed explicit stop then becomes unknown. Nonterminal status polls keep Railway starts unresolved, including when status requests fail. CLI and MCP stop errors and identified failed-launch diagnostics name vapi swarm forget-run <swarm> <runId> --confirm-destroyed after verification in the original project/environment. CLI swarm stop --all and MCP swarm.stop retry unknown workers instead of permanently stranding a disappeared sandbox; only successful destruction or explicit CLI confirmation unblocks dissolution. CLI confirmation also accepts finished, failed or stopped Railway records with an identified orphaned sidecar; id-less sidecars remain refused.
  • Detached swarm reservations serialize with dissolution in swarm-then-member lock order. Launch releases the swarm lock and verifies its reservation before creating a worker, so a dissolve cannot miss a concurrent start.
  • Ambiguous Railway creates retain their starting reservation and return launch_ambiguous with the stale-start confirmation command. After five minutes and owner verification, stop --confirm-worker-stopped clears the id-less sidecar; failures before Railway receives a request still clear the reservation.
  • Swarm member results and delegation replays retain public Router refill receipts and warnings.
  • Bundled agent runs print refill evidence to stderr and preserve public transaction hashes in JSON and result files while redacting secrets.
  • Agent runs retain Router refill evidence in RunAgentResult.refills, CLI stderr, JSON and result files, including purchases carried by failed chats. Stops preserve refill_pending recovery guidance.
  • SDK client.router.buy() returns RouterPurchaseResult so callers can read warnings. The main core entry exports RouterPurchaseResult and RouterPurchaseWarning types.
  • Receipt appends sync payment evidence best effort; settled Router journals retire only after a separate strict sync of the ledger and its parent directory, including receipts saved by older clients. The file is opened without creating it, writable only on Windows; directory sync is skipped there. Fresh transfers strictly sync their signed authorization file and parent directory (except the directory on Windows) before calling the relay. If sync fails, no relay request is sent. A successful failed-row append releases the reservation and reports that no money moved. If that append also fails, the transfer returns unknown, keeps its reservation and can be resumed. Wallet renames require the receipt rewrite to sync before replacement and sync its directory best effort afterward.
  • Recovered Router purchases appear once in receipt listings, JSON/CSV exports and stats, preserving original metadata through append-only settlement revisions.
  • Logout bounds remote revocation and its token refresh requests and response bodies to ten seconds. Local cleanup uses the wallet credential lock even after that deadline. Refresh re-checks the link and stored token pair before publishing a rotation, accepting login metadata changes when the tokens still match.
  • CLI Router purchases with unknown settlement now say that the authorization was sent, settlement is not confirmed and the purchase must not be repeated. Rejected settlements are also identified without a successful payment claim.
  • CLI Router chat and buy errors preserve refill evidence when a missing link message is normalized. Human errors print purchase warnings, including the settled-retirement command; JSON retains the warning codes and messages.
  • Settled Router purchases keep blocking another payment until their receipt is in the ledger and purchased credit is established by usage under a current link with the same owner (case-insensitive) and API base or a successful balance-key chat. Repeated failed chats and manual buys recover the earlier purchase without paying again.
  • Router recovery appends missing settled receipts with sender, authorization nonce, token, amount and known transaction before retiring the journal. Receipt write or retirement sync failures retain the journal and credit_pending warning and allow balance-key chat; repeated recovery never appends another succeeded row for the same purchase.
  • Router purchases with an unconfirmed settlement return an explicit warning and keep their signed journal for chain recovery, while allowing chat on usable balance credit.
  • Settled Router purchases recover after relinking to the same owner and API base. A missing link or another owner or API base keeps the payment evidence and skips refills. Stake-key chat continues under a valid current link with usable credentials; without a link, chat returns not_linked with pending_purchase_unlinked. Login and logout serialize link changes with purchases using the purchase lock before credential locks.
  • Linux: vapi login no longer fails with "The agent link could not be stored consistently" on keyrings where secret-tool clear exits 1 without a message when it matches nothing. An exit 1 without a message for an entry the lookup did not find now counts as nothing to remove; any other exit code, a failure with a reason, and a failure to remove an entry the lookup found are still reported. Reported in #41, first fixed by @Rizal9 in #31.
  • A refused agent link now names the HTTP status and the server's error code, for example The vAPI agent link request failed (HTTP 429, rate_limited). Earlier versions printed only "The vAPI agent link request failed." for a rate limit, a refusal and a proxy error alike (#30, #42). A gateway or proxy error page without a JSON body is reported the same way and no longer as "response was invalid".
  • Pending Router purchases survive process restarts and are recovered before any refill decision, including manual purchases with automatic refill disabled. An unresolved purchase blocks another payment; credential-only chat retries do not unlock the payment account.
  • Router reservations now distinguish unsigned prepared, journaled signed, confirmed settled, and legacy/unsupported unknown attempts. Recovery under a per-wallet purchase lock clears unsigned reservations. Signed EIP-3009 attempts query the token's authorizationState(from, nonce) on the configured network RPC: used nonces recover the original purchase; unused nonces clear only after validBefore plus a 30-second clock margin. Live authorizations return refill_pending with a retry time. RPC errors and unsupported networks fail closed with CLI recovery guidance.
  • Concurrent automatic Router refills re-read balance and the durable completion marker under the purchase reservation, so stale low-balance decisions cannot buy twice after a successful first purchase, even if the configured threshold exceeds the purchased tier.
  • Accounts with pending Router purchases cannot be renamed or removed, even with forced removal. The check and mutation hold the purchase lock so an in-flight reservation cannot lose its guard; errors point to vapi router clear-pending.
  • Confirmed Router purchases retain their receipts when audit, key retrieval/storage, balance lookup, receipt persistence or later response processing fails. Explicit warnings report these failures; unavailable balance is null.
  • First automatic Router refills retain settled receipts through console, credential and chat failures. Payment-aware guidance explains pending key recovery; the next chat request fetches the missing balance key without a second purchase.
  • CLI and MCP report the charged quote amount and network from available receipt evidence. Missing network metadata no longer throws after payment or silently guesses a network.
  • x402 settlement evidence is captured before post-response timing reads; throwing timing clocks cannot discard settlement or interrupt response consumption.
  • Confirmed x402 payments retain their receipt and report a warning when an injected timing clock throws during final receipt construction.
  • x402 receipt metadata is snapshotted and validated before payment. Failures after confirmed settlement return the receipt and warnings instead of rejecting.
  • Swarm dissolution performs one shared core check before any balance lookup, pending movement resumption or transfer. CLI and MCP refresh tracked runs before that check and refuse active or unresolved Railway runs and sidecars with the same stop guidance. The core check also fails closed without a runtime adapter.
  • SwarmCapitalDeps adds an optional reconcileRuns port; local run records remain the authority for the final eligibility check. Existing capital locks and movement-journal formats are unchanged.
  • Concurrent Railway refreshes cannot turn a stored unknown run into finished through stale ordinary cleanup, or overwrite stopped/forgotten records and their confirmation metadata. Start and stop refresh through an internal helper while already holding the member lock.
  • Orphan-sidecar cleanup and CLI confirmation share the member lock. Failed cleanup cannot recreate a stale orphan after forget-run has retired it and retained the confirmation.
  • A rejected transfer releases its spend reservation only after its failed receipt row is written. If that write fails, it returns unknown, keeps the reservation and can be resumed. A relayed transfer whose receipt row cannot be written still returns sent (with the transaction when the relay reported one) or unknown with the nonce instead of a filesystem error. --resume with that nonce records the result once the receipt can be written.
  • Token refresh checks and stores rotated tokens under a credential lock shared with login and logout, so a refresh that finishes after logout stores nothing and cannot overwrite a newer login. The new lock adds no wait for a refresh's network request.
  • A wallet named constructor can now be created on a machine that has none. Earlier versions reported it as an existing wallet, so creating it failed with "already exists" while vapi wallet list showed nothing. Reported and fixed by @goranai in #48 and #49.
  • Setting spend caps, a ceiling or provisioning limits for a wallet named constructor that does not exist now says "No wallet named constructor" instead of failing with a JavaScript error, and the ceiling sweep no longer claims a window for it. Reported by @goranai in #48.
  • Atomic JSON writes no longer fail on Windows: the parent directory flush that Windows rejects is skipped there. Other platforms still flush it.
  • On Windows, a caller waiting for a file lock keeps waiting when the released lock it is removing is deleted by another caller at the same moment, instead of failing with a permission error.
  • A failure while releasing a file lock no longer replaces the result of the operation that ran under it, so a saved receipt or a completed wallet rename is not reported as failed.
  • A failed Railway launch that leaves a launch marker without a sandbox id, because the id could not be saved or the marker could not be removed, now keeps its starting reservation and returns launch_ambiguous, so vapi swarm stop <swarm> <runId> --confirm-worker-stopped can clear the marker after the five-minute window. Identified sidecars still use vapi swarm stop <swarm> <runId> and vapi swarm forget-run <swarm> <runId> --confirm-destroyed after verified destruction.
  • Railway launches treat a sandbox id in the railway sandbox create output that matches the member key, the bundle or a credential exported with the member as unreadable. The launch returns launch_ambiguous and the value is not written to the sidecar, the run record or a railway command line. Failure text from railway is scrubbed before it is shortened, and an echoed VAPI_MEMBER_BUNDLE value is always removed.

Internal

  • Core uses current path helpers and declared Tasks entry points, shares provenance deduplication in core, breaks the HD/keystore and Solana/x402 runtime import cycles, and refreshes the deprecated wallet option's removal notice without changing behavior.
  • The CLI all-networks gas-error test injects deterministic balance RPC responses during Arc setup instead of contacting live RPCs.

Install: npm i -g vapi-network@0.15.0 · npm · Changes since v0.14.0