Skip to content

Fix config not propagated to data-plane URL construction in DataAPI and Sandbox.__get_client()#88

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/fix-sandbox-delete-config-issue
Draft

Fix config not propagated to data-plane URL construction in DataAPI and Sandbox.__get_client()#88
Copilot wants to merge 2 commits intomainfrom
copilot/fix-sandbox-delete-config-issue

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 20, 2026

When config (carrying account_id, region, credentials, etc.) was passed only at call time (not at construction), it was silently ignored during data-plane base URL assembly, causing ValueError: account id is not set even though a valid config was provided.

Two independent bugs:

  1. DataAPI HTTP methods ignored config in with_path()get, post, put, patch, delete (and their _async variants), plus post_file, get_file, get_video all called self.with_path(path, query=query) without forwarding config. Since with_pathget_base_url(config) uses Config.with_configs(self.config, config), the call-site config never reached URL construction.

  2. Sandbox.__get_client() always returned a config-less SandboxClient() — so even if every downstream method received config=config, the SandboxDataAPI instance embedded in the client was initialized with an empty config.

Changes

  • agentrun/utils/data_api.py + __data_api_async_template.py: All 16 HTTP wrapper methods now pass config to with_path():

    # Before
    self.with_path(path, query=query)
    # After
    self.with_path(path, query=query, config=config)
  • agentrun/sandbox/sandbox.py + __sandbox_async_template.py: __get_client() now accepts and forwards config:

    # Before
    def __get_client(cls):
        return SandboxClient()
    
    # After
    def __get_client(cls, config: Optional[Config] = None):
        return SandboxClient(config=config)

    All ~20 call sites updated to pass config=config.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • astral.sh
    • Triggering command: /usr/bin/curl curl -LsSf REDACTED (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title [WIP] Fix Sandbox.delete_by_id config merging issue Fix config not propagated to data-plane URL construction in DataAPI and Sandbox.__get_client() Apr 20, 2026
Copilot AI requested a review from OhYee April 20, 2026 16:14
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.

Sandbox.delete_by_id 与 DataAPI 在拼数据面 URL 时未合并调用方传入的 config;__get_client() 仍返回无参 SandboxClient

2 participants