Skip to content

fix(fund): render receive QR + address on stderr before polling#16

Merged
vvillait88 merged 1 commit intomainfrom
fix/fund-render-qr-upfront
May 4, 2026
Merged

fix(fund): render receive QR + address on stderr before polling#16
vvillait88 merged 1 commit intomainfrom
fix/fund-render-qr-upfront

Conversation

@vvillait88
Copy link
Copy Markdown
Contributor

Summary

Pre-existing UX bug surfaced by a user: agentscore-pay fund --chain base --amount 10 hung silently in the terminal. fund() was polling balance for up to 15 minutes before printing anything — the QR + address only landed in the final result that incur renders after the call returns.

Fix

fund() now emits a funding_started event via emitProgress (stderr, JSON in non-TTY, plain in TTY) before entering the poll loop. In TTY mode it also writes the rendered ASCII QR + the polling-cadence status message to stderr immediately.

Stdout (incur's structured result) is unchanged — same FundResult shape with qr_uri, initial_usdc, etc. landing at the end. The new event is purely additive on stderr.

Why this matches the rest of pay

Brings fund's UX in line with every other polling command:

Command Already-correct mechanism
passport login onVerifyUrl callback writes verify URL to stderr
passport resume (auto-bootstrap) same
pay (retry on transient errors) onRetry callback emits retry progress event
fund mainnet was silent — fixed now
fund tempo testnet fast (~5s, programmatic mint) — no UX issue

Test plan

  • 352/352 vitest pass
  • tsc --noEmit clean
  • All 3 chains (Base / Solana / Tempo mainnet) emit chain-appropriate funding_started events with correct QR URI
  • Tempo testnet programmatic mint path unchanged
  • Stdout JSON shape unchanged

Bumps to 0.1.0-rc.15.

🤖 Generated with Claude Code

Pre-existing UX bug surfaced by a user: agentscore-pay fund --chain
base --amount 10 hung silently in the terminal. fund() was polling
balance for up to 15 minutes before printing anything — the QR + address
only landed in the final result that incur renders after the call
returns.

Now fund() emits a `funding_started` event via emitProgress (stderr,
JSON in non-TTY, plain in TTY) before entering the poll loop, and in
TTY mode also writes the rendered ASCII QR + the actionable status
message to stderr immediately. JSON consumers see one structured event
on stderr; humans see scannable QR + address + polling cadence right
away.

Stdout (incur's structured result) is unchanged — same FundResult
shape with qr_uri, initial_usdc, etc. landing at the end.

Tempo testnet path is unaffected (programmatic mint returns instantly,
doesn't enter the poll loop).

Brings fund's UX in line with the rest of pay's polling commands —
passport login, passport resume/bootstrap, and retry already emit to
stderr before/during their waits via onVerifyUrl / onRetry callbacks.

Bumps to 0.1.0-rc.15.

Test plan: 352/352 vitest pass; tsc --noEmit clean; live test against
the smoke wallet on all 3 chains confirms structured event + QR URI
shape.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@vvillait88 vvillait88 merged commit 16e1cc4 into main May 4, 2026
6 checks passed
@vvillait88 vvillait88 deleted the fix/fund-render-qr-upfront branch May 4, 2026 14:33
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