Python SDK: cloud agents with a named environment fail with "env.name cannot be combined with repos"
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 90/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- node.js, python, typescript
調査の方向性
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/sdk1.0.18) with the sameenv: { type: 'cloud', name }and noreposworks. - 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-sdk1.0.32 and 1.0.35 (latest)
- 主要言語
- TypeScript
- スター
- 4.1k
- フォーク
- 493
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
cursor/cookbook のほかの issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
-
No CI: a typecheck matrix over the examples would have caught #60 and #61対応中かも @deanrie が 11 日前に担当しました。 オープン
難易度 3/5 半日 初心者へのやさしさ 50/100
-
Human-IA generativeオープン
難易度 5/5 1週間以上 初心者へのやさしさ 15/100
-
App Builder passes local.envVars, which @cursor/sdk ignores対応中かも @rajarshidattapy が 56 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
-
Several examples assign Agent.create() without awaiting it対応中かも @rajarshidattapy が 56 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 76/100
cursor/cookbook の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
awesome-dsh-plugin/awesome-dsh-plugin#9184 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
farion1231/cc-switch#8829 ·
メンテナーはふだん 1 日以内に返信
-
[core-client] Remove unused hand-maintained transport helpers after the definition-table cutoverオープンdoc-audit enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100