Skip to content

fix(payments): T03 wait for the new wallet to be funded before checking balance#1675

Closed
fahadfa-aws wants to merge 1 commit into
awslabs:mainfrom
fahadfa-aws:fix/payments-t03-block-on-new-wallet-funding
Closed

fix(payments): T03 wait for the new wallet to be funded before checking balance#1675
fahadfa-aws wants to merge 1 commit into
awslabs:mainfrom
fahadfa-aws:fix/payments-t03-block-on-new-wallet-funding

Conversation

@fahadfa-aws

Copy link
Copy Markdown

Issue

Tutorial 03 Section 1 creates a brand-new payment instrument for tutorial-03-user. Section 2 prints faucet instructions and Section 3 prints delegation instructions, but the script then runs straight into Section 4, which calls GetPaymentInstrumentBalance against the unfunded wallet. The API returns:

```
ValidationException: No balance found on chain 'base-sepolia' for token 'USDC'
```

A user reading the output sees a confusing AWS API error rather than a clean balance read. The print at line 148 says "ACTION REQUIRED: Fund the wallet before continuing" but nothing in the script actually halts.

Reproduced from the original test session at T03_user_onboarding.log:73.

Changes

user_onboarding.py:170 — add an input(\"Press Enter when the new wallet is funded and signing is granted... \") pause at the end of Section 3, before Section 4's balance check.

This matches the existing pattern at setup_agentcore_payments.py:412 in Tutorial 00, which uses an identical input() after its delegation instructions before checking balance.

Two-line change. No semantic change for users on the happy path who run through interactively — they pause where the README's tone already implied they should pause. For users running unattended, this is the smallest possible behavior change to make the "before continuing" promise true.

Verification

  • Re-read upstream code: line 148 makes the promise; the next code path is Section 4's balance check at line 187.
  • Original test log shows the ValidationException firing on the new instrument because the script ran through without waiting.
  • T00's setup_agentcore_payments.py:412 is the established precedent for this pattern in the same tutorial set.

…ng balance

Section 1 creates a brand new payment instrument for tutorial-03-user.
Section 2 prints faucet instructions, Section 3 prints delegation
instructions, then Section 4 immediately calls
GetPaymentInstrumentBalance against the new (unfunded) wallet. The API
returns:

  ValidationException: No balance found on chain 'base-sepolia'
  for token 'USDC'

A user reading the output sees a confusing AWS API error instead of a
clean "0.00 USDC" or a meaningful next step. The earlier print at
line 148 says "ACTION REQUIRED: Fund the wallet before continuing" but
the script never actually pauses.

Add the same input() pause that Tutorial 00 uses at
setup_agentcore_payments.py:412 — wait for the operator to confirm the
new wallet is funded and signing is granted, then proceed to Section 4
where the balance check will return a real number.
@fahadfa-aws

Copy link
Copy Markdown
Author

@mvangara10 — flagging this for your review when you have a moment. Tagged across the full set of payments-tutorial fixes I've been pushing today; happy to walk through any of them. Audit logs and test evidence are referenced in the PR description.

@fahadfa-aws

Copy link
Copy Markdown
Author

Superseded by #1738 (consolidated PR)

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