Skip to content

ACP Developer Experience Improvements #34

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

0xspacecreated
Copy link

@0xspacecreated 0xspacecreated commented Jun 25, 2025

This PR improves the ACP Python SDK with better error handling, developer docs, and test reliability.


🔧 Improvements

1. Fixed Legacy Imports & Restored Tests

  • Replaced acp_sdk with virtuals_acp in examples
  • Fixed VirtualsACP.__init__() errors and restored test_helper_functions

2. Improved Configuration Validation

  • Enhanced wallet address checks
  • Added ConfigDict for clearer Pydantic config errors

3. Docstrings Added

Note

Added full Google-style docstrings to all VirtualsACP methods for IDE support and easier onboarding (more required for other files for better devving experience❗)

4. Exception Hierarchy Refactor

  • Replaced generic exceptions with 25+ specific error classes
  • Grouped by categories: connection, auth, API, contract, job lifecycle, validation

5. Fixed Broken SDK Docs Link

  • TODO: Update/remove outdated link in examples/acp_base/README.md

Impact for devs

  • Faster debugging and integration
  • More maintainable SDK
  • Cleaner, more accessible developer experience

Suggestions (Optional Follow-Up Work)

Code Organization

  • Modularize Examples: Separate directories for /buyers, /sellers, /evaluators, and /hybrid use cases
  • End-to-End Testing: Create comprehensive test script that demonstrates full transaction lifecycle

Documentation Enhancement

  • Missing Docstrings: Add comprehensive documentation to contract_manager.py, memo.py, and other core modules similar to the client.py
  • Usage Examples: Add more real-world usage examples and step-by-step tutorials + remove dead links

@@ -11,8 +11,14 @@ def test_helper_functions():
acp = VirtualsACP(
wallet_private_key=env.WHITELISTED_WALLET_PRIVATE_KEY,
agent_wallet_address=env.BUYER_AGENT_WALLET_ADDRESS,
config=BASE_SEPOLIA_CONFIG
config=BASE_MAINNET_CONFIG,
Copy link
Contributor

Choose a reason for hiding this comment

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

could you remove the config param? we removed these on purpose because the default behaviour would be mainnet-only moving forward (except for exceptional scenarios)

@@ -47,8 +48,11 @@ def on_evaluate(job: ACPJob):
agent_wallet_address=env.BUYER_AGENT_WALLET_ADDRESS,
on_new_task=on_new_task,
on_evaluate=on_evaluate,
entity_id=env.BUYER_ENTITY_ID
entity_id=env.BUYER_ENTITY_ID,
config=BASE_MAINNET_CONFIG
Copy link
Contributor

Choose a reason for hiding this comment

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

please remove the config param

@@ -40,8 +41,11 @@ def on_new_task(job: ACPJob):
wallet_private_key=env.WHITELISTED_WALLET_PRIVATE_KEY,
agent_wallet_address=env.SELLER_AGENT_WALLET_ADDRESS,
on_new_task=on_new_task,
entity_id=env.SELLER_ENTITY_ID
entity_id=env.SELLER_ENTITY_ID,
config=BASE_MAINNET_CONFIG
Copy link
Contributor

Choose a reason for hiding this comment

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

please remove the config param

)

print(f"ACP client: {acp_client.agent_address}")
Copy link
Contributor

Choose a reason for hiding this comment

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

please remove this print statement

@@ -14,8 +14,33 @@
)
from .exceptions import (
Copy link
Contributor

Choose a reason for hiding this comment

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

I tihnk these are a bit overkill especially if not use - would leave it to individual devs to customise their own error messages so we left it quite generic

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.

2 participants