Example 39c_serverless_code_execution.py needs to be changed for it to work
評価
- 難易度
- 1/5
- 見積もり時間
- 1時間未満
- 初心者へのやさしさ
- 90/100
調査の方向性
問題はファイル Example 39c_serverless_code_execution.py にあります。修正方法は、行 mock_server = _start_mock_server(port=9753) を if __name__ == "__main__": ブロック内に移動し、モジュールが再インポートされた際のポート競合を防ぐことです。変更後、スクリプトを実行し、'Address already in use' エラーなしで起動し、エージェントコードが正常に実行されることを確認してください。
索引モデルが issue の本文から書いたものです。
説明
currently we have start_mock_server not inside main. Moving it to main works
── Agent setup ───────────────────────────────────────────────────────
mock_server = _start_mock_server(port=9753)
serverless_coder = Agent(
name="serverless_coder",
model=settings.llm_model,
code_execution=CodeExecutionConfig(
executor=ServerlessCodeExecutor(
endpoint="http://127.0.0.1:9753/execute",
language="python",
timeout=15,
),
),
instructions=(
"You write Python code that runs on a remote execution service. "
"Use the execute_code tool to run code remotely."
),
)
if name == "main":
### #mock_server = _start_mock_server(port=9753). -> ADD THIS
with AgentRuntime() as runtime:
print("--- Serverless Code Execution ---")
result = runtime.run(
serverless_coder,
"Calculate 2**100 and print the result.",
)
result.print_result()
This was a claude code suggested fix and it works.
Claude's reasoning:
Before: mock_server = _start_mock_server(9753) was outside. You start the script — port 9753 grabbed. Worker starts, re-imports the file, hits that same line, tries to grab 9753 again. Already taken → Address already in use → worker dies.
After: it's inside the if. You start the script — port grabbed once. Worker re-imports, reaches the if, sees it's false, skips it. No second bind. Worker lives.
- 主要言語
- Python
- スター
- 104
- フォーク
- 44
- 平均マージ
- 4日 18時間
- マージ済み PR(30日)
- 3
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートなし
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
conductor-oss/python-sdk のほかの issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
conductor-oss/python-sdk#507 ·
-
`.[agents]` extra omits `langchain-anthropic`, so a shipped example cannot run対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンbug dependencies
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
conductor-oss/python-sdk#486 ·
-
Framework-agent failures return `None` instead of the failed task's reason再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
conductor-oss/python-sdk#483 ·
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
conductor-oss/python-sdk#478 ·
-
TaskType.NOOP missing — NOOP system task has no enum value or builder class対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
conductor-oss/python-sdk#430 ·
conductor-oss/python-sdk の issue をすべて見る
似ている issue
-
bug needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
debpalash/VoiceStudio#2624 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
Make Catch2 optional when `RDK_BUILD_CPP_TESTS=OFF`対応中かも @pechersky が今日担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 2 日以内に返信
-
There are a few redundant calls to `fdesc._setCloseOnExec()`対応中かも @gudnimg が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信