Skip to content

fix: add missing run.sh for x402 scenario#185

Open
ayushozha wants to merge 2 commits intogoogle-agentic-commerce:mainfrom
ayushozha:fix-missing-x402-run-sh
Open

fix: add missing run.sh for x402 scenario#185
ayushozha wants to merge 2 commits intogoogle-agentic-commerce:mainfrom
ayushozha:fix-missing-x402-run-sh

Conversation

@ayushozha
Copy link

Summary

  • Add a run.sh script to samples/python/scenarios/a2a/human-present/x402/ that delegates to the existing cards/run.sh with --payment-method x402
  • Update the x402 README to reference its own run.sh instead of pointing to cards/run.sh

Fixes #107

Test plan

  • Verify bash samples/python/scenarios/a2a/human-present/x402/run.sh starts the x402 scenario correctly
  • Verify the script delegates to cards/run.sh with the correct --payment-method x402 flag
  • Verify additional arguments are passed through via "$@"

🤖 Generated with Claude Code

The x402 scenario directory was missing a run.sh script, which is
inconsistent with the sibling cards/ directory. Add a convenience
wrapper that delegates to cards/run.sh with --payment-method x402.
Also update the README to reference the new run.sh directly.

Fixes google-agentic-commerce#107

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@ayushozha ayushozha requested a review from a team as a code owner March 18, 2026 08:25
@google-cla
Copy link

google-cla bot commented Mar 18, 2026

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request streamlines the execution of the x402 payment scenario by introducing a dedicated shell script. This script simplifies the process for users by abstracting away the need to manually specify the payment method, improving the developer experience and reducing potential setup errors. The accompanying documentation has also been updated to reflect this change, ensuring clarity and ease of use.

Highlights

  • New run.sh script for x402 scenario: A dedicated run.sh script has been added to samples/python/scenarios/a2a/human-present/x402/. This script acts as a convenience wrapper, delegating to the existing cards/run.sh while automatically applying the --payment-method x402 flag.
  • README update for x402 scenario: The README.md for the x402 scenario has been updated to reference the newly added run.sh script, simplifying the instructions for executing the scenario.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request correctly adds a convenience run.sh script for the x402 scenario and updates the documentation. My review focuses on improving the robustness of the new script. I've suggested a change to ensure the script works correctly regardless of the directory from which it's run, addressing a potential bug. Otherwise, the changes look good.

Comment on lines +1 to +8
#!/bin/bash

# A script to automate the execution of the x402 payment example.
# This is a convenience wrapper that runs the standard scenario with
# the x402 payment method.

SCRIPT_DIR="$(dirname "$0")"
exec bash "$SCRIPT_DIR/../cards/run.sh" --payment-method x402 "$@"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The cards/run.sh script that is being called expects to be run from the repository root. The current implementation of this wrapper script will fail if it's not executed from the repository root itself (e.g., if a user changes into this directory and runs ./run.sh). This can be fixed by changing the current directory to the repository root before executing the cards/run.sh script.

Additionally, it's good practice to add set -e to the script to ensure it exits immediately if any command fails.

Suggested change
#!/bin/bash
# A script to automate the execution of the x402 payment example.
# This is a convenience wrapper that runs the standard scenario with
# the x402 payment method.
SCRIPT_DIR="$(dirname "$0")"
exec bash "$SCRIPT_DIR/../cards/run.sh" --payment-method x402 "$@"
#!/bin/bash
set -e
# A script to automate the execution of the x402 payment example.
# This is a convenience wrapper that runs the standard scenario with
# the x402 payment method.
# The wrapped script, cards/run.sh, expects to be run from the repository root.
# To make this script runnable from any directory, we first change to the repo root.
cd "$(dirname "$0")/../../../../../../"
exec bash "samples/python/scenarios/a2a/human-present/cards/run.sh" --payment-method x402 "$@"

Address Gemini review feedback: add set -e, cd to repo root using
dirname, and use absolute path for the wrapped script.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

File missing

1 participant