Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Python SDK: cloud agents with a named environment fail with "env.name cannot be combined with repos"

オープン 初心者向け
#70 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
90/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
node.js, python, typescript
領域
api, backend

調査の方向性

cursor_sdk/_vendor/bridge/dist/sdk-converters.js を開き、protoCloudAgentOptionsToSdk を調べて、repos の処理を envVars および metadata と比較します。名前付きの CloudEnvironment を使用し、repos なしで Python SDK の再現を実行してから、リクエストが成功する一方で空でない repos は引き続き転送されることを確認します。

索引モデルが issue の本文から書いたものです。

説明

Description

Creating a cloud agent from the Python SDK (cursor-sdk on PyPI) with only a named cloud environment and no repos fails when sending the first message.

from cursor_sdk import CloudAgentOptions, CloudEnvironment
from cursor_sdk.asyncio import AsyncClient

async with await AsyncClient.launch_bridge() as client:
    agent = await client.agents.create(
        api_key=API_KEY,
        model="composer-2.5",
        cloud=CloudAgentOptions(env=CloudEnvironment(type="cloud", name="my-env")),
    )
    run = await agent.send("hello")

agent.send raises:

BadRequestError invalid_argument: [validation_error] env.name cannot be combined with repos for cloud environments

Root cause

The Node bridge bundled in the Python package, cursor_sdk/_vendor/bridge/dist/sdk-converters.js, function protoCloudAgentOptionsToSdk, always sets:

repos: cloud.repos.map(repo => stripUndefined({ ... })),

The Python SDK passes options to the bridge as protobuf, so an omitted repeated field decodes as an empty list. The bridge therefore always forwards repos: []. stripUndefined only removes undefined, so the empty array reaches the API. The API rejects env.name combined with any repos field, even an empty one. The REST docs say named cloud environments are mutually exclusive with repos.

Confirmation

  • TypeScript SDK (@cursor/sdk 1.0.18) with the same env: { type: 'cloud', name } and no repos works.
  • Passing repos: [] explicitly in TypeScript reproduces the same error.

Suggested fix

repos: cloud.repos.length === 0 ? undefined : cloud.repos.map(repo => stripUndefined({ ... })),

The same file already does this for envVars and metadata.

Impact

Named cloud environments can't be used from the Python SDK at all. The only workaround is calling the REST API /v1/agents directly.

Environment

  • macOS (darwin 24.6)
  • Python 3.14
  • cursor-sdk 1.0.32 and 1.0.35 (latest)
主要言語
TypeScript
スター
4.1k
フォーク
493
PR マージ指標
30日以内にマージされた PR はありません

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

cursor/cookbook のほかの issue

cursor/cookbook の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。