Skip to content

fix: correct bash array syntax, exception handling, and spec JSON examples#1657

Open
wishhyt wants to merge 3 commits intoa2aproject:mainfrom
wishhyt:fix/misc-bug-fixes
Open

fix: correct bash array syntax, exception handling, and spec JSON examples#1657
wishhyt wants to merge 3 commits intoa2aproject:mainfrom
wishhyt:fix/misc-bug-fixes

Conversation

@wishhyt
Copy link
Copy Markdown

@wishhyt wishhyt commented Mar 18, 2026

Summary

  • Fix stray comma in bash array in deploy_root_files.sh that silently prevented llms.txt from being deployed to gh-pages
  • Broaden exception handling in proto_to_table MkDocs macro to match sibling macros and prevent build crashes on proto parse errors
  • Fix invalid JSON syntax (trailing/missing commas) and field name/type mismatches against proto definitions in specification examples (§4.6.1, §6.6, §6.7)

Details

scripts/deploy_root_files.sh
The comma after "llms.txt", in the FILES_TO_DEPLOY bash array caused the element to be interpreted as the literal string llms.txt, (with trailing comma), so the real llms.txt was never found and silently skipped during gh-pages deployment.

.mkdocs/macros.py
proto_to_table only caught FileNotFoundError, while the sibling macros proto_enum_to_table and proto_service_to_table both catch Exception. A proto parse error would propagate uncaught and crash the entire MkDocs build instead of rendering a graceful in-page error message.

docs/specification.md

  • §4.6.1: Remove trailing comma in AgentCard JSON example (invalid JSON)
  • §6.6: Rename pushNotificationConfig to taskPushNotificationConfig to match proto field SendMessageConfiguration.task_push_notification_config
  • §6.6: Change "schemes": ["Bearer"] to "scheme": "Bearer" to match proto AuthenticationInfo.scheme (singular string, not array)
  • §6.6: Change "state": "submitted" to "TASK_STATE_SUBMITTED" to match the SCREAMING_SNAKE_CASE enum convention required by §5.5
  • §6.7: Add missing comma after "raw" value and remove trailing comma after "mediaType" (invalid JSON)

Test plan

  • Verify scripts/deploy_root_files.sh correctly lists all 4 files without trailing comma
  • Verify MkDocs docs build succeeds with the updated macro
  • Verify all modified JSON examples in specification.md are valid JSON and match proto definitions

Closes #1656

wishhyt added 3 commits March 18, 2026 16:59
The comma after "llms.txt" in the FILES_TO_DEPLOY array caused bash to
interpret the element as the literal string "llms.txt," (with trailing
comma), so the real llms.txt was never found and silently skipped during
gh-pages deployment.

Made-with: Cursor
proto_to_table only caught FileNotFoundError, while the sibling macros
proto_enum_to_table and proto_service_to_table both catch Exception.
A proto parse error would propagate uncaught and crash the entire MkDocs
build instead of rendering a graceful in-page error message.

Made-with: Cursor
…cation examples

- §4.6.1: remove trailing comma in AgentCard JSON example (invalid JSON)
- §6.6: rename `pushNotificationConfig` to `taskPushNotificationConfig`
  to match proto field `SendMessageConfiguration.task_push_notification_config`
- §6.6: change `"schemes": ["Bearer"]` to `"scheme": "Bearer"` to match
  proto `AuthenticationInfo.scheme` (singular string, not array)
- §6.6: change `"state": "submitted"` to `"TASK_STATE_SUBMITTED"` to
  match the SCREAMING_SNAKE_CASE enum convention required by §5.5 and
  used consistently in all other examples
- §6.7: add missing comma after `"raw"` value and remove trailing comma
  after `"mediaType"` (invalid JSON)

Made-with: Cursor
@wishhyt wishhyt requested a review from a team as a code owner March 18, 2026 09:27
@gemini-code-assist
Copy link
Copy Markdown
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 enhances the reliability of documentation deployment, improves the robustness of the MkDocs build process, and ensures the accuracy of JSON examples within the project's specification. These changes collectively contribute to a more stable and correct development and documentation environment.

Highlights

  • Bash Script Deployment: Corrected a syntax error in scripts/deploy_root_files.sh that prevented llms.txt from being deployed to gh-pages.
  • MkDocs Macro Robustness: Broadened exception handling in the proto_to_table MkDocs macro to prevent build crashes on proto parse errors.
  • Specification Documentation: Fixed invalid JSON syntax and field name/type mismatches in several specification examples within docs/specification.md.
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
Copy Markdown
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 introduces several important fixes that significantly enhance the robustness and accuracy of the project. The corrections to the bash array syntax in deploy_root_files.sh resolve a silent deployment failure, ensuring all intended files are correctly handled. The broadened exception handling in .mkdocs/macros.py improves the stability of the documentation build process by preventing crashes from proto parse errors. Furthermore, the numerous adjustments to JSON examples in docs/specification.md address critical syntax errors and field mismatches, ensuring the documentation accurately reflects the A2A protocol definitions and adheres to ProtoJSON conventions. These changes collectively contribute to a more reliable system and clearer, more accurate documentation.


# --- Configuration ---
# List of files to copy from the source directory to the root of the gh-pages branch.
FILES_TO_DEPLOY=("404.html" "robots.txt" "llms.txt", "llms-full.txt")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

The trailing comma after "llms.txt" in the FILES_TO_DEPLOY bash array caused llms.txt to be interpreted as llms.txt, (with the trailing comma), leading to silent failures where the file was not correctly deployed. Bash array elements should be space-separated, not comma-separated.

{
"url": "https://research-agent.example.com/a2a/v1",
"protocolBinding": "HTTP+JSON",
"protocolVersion": "0.3",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

This line contained a trailing comma, which is invalid JSON syntax. It's important for documentation examples to be syntactically correct to avoid misleading users.

"messageId": "6dbc13b5-bd57-4c2b-b503-24e381b6c8d6"
},
"configuration": {
"pushNotificationConfig": {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The field name pushNotificationConfig here did not match the proto definition SendMessageConfiguration.task_push_notification_config. Consistency with proto definitions is crucial for accurate specification.

"url": "https://client.example.com/webhook/a2a-notifications",
"token": "secure-client-token-for-task-aaa",
"authentication": {
"schemes": ["Bearer"]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The authentication object incorrectly used an array for schemes (["Bearer"]) instead of a singular string scheme ("Bearer"), which is required by the AuthenticationInfo.scheme proto definition. This was a type mismatch in the example.

"id": "43667960-d455-4453-b0cf-1bae4955270d",
"contextId": "c295ea44-7543-4f78-b524-7a38915ad6e4",
"status": {
"state": "submitted",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The enum value "submitted" did not adhere to the SCREAMING_SNAKE_CASE convention required by the ProtoJSON specification (Section 5.5) and general rules for enum values in the A2A protocol. This could lead to parsing issues or inconsistencies.

References
  1. Enum values in the A2A protocol should be in SCREAMING_SNAKE_CASE to comply with the ProtoJSON specification.

"text": "Analyze this image and highlight any faces."
},
{
"raw": "iVBORw0KGgoAAAANSUhEUgAAAAUA..."
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

A comma was missing after the "raw" field, which resulted in invalid JSON syntax. This is a common JSON parsing error.

"raw": "iVBORw0KGgoAAAANSUhEUgAAAAUA..."
"raw": "iVBORw0KGgoAAAANSUhEUgAAAAUA...",
"filename": "input_image.png",
"mediaType": "image/png",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

This line contained a trailing comma, which is invalid JSON syntax. It's important for documentation examples to be syntactically correct to avoid misleading users.

try:
elements = _parse_proto(proto_file)
except FileNotFoundError as e:
except Exception as e:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

low

Catching a generic Exception can sometimes mask other, more specific issues that might warrant different handling. While this change aligns with sibling macros as noted in the PR description, consider if a more targeted exception type (or a union of specific exceptions) could be used here to provide more precise error handling and debugging capabilities.

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.

[Bug]: bash array syntax error, inconsistent error handling, and incorrect JSON examples

1 participant