Hacktoberfest 2026:維護者為十月標記出來的 issue,仍然開放、適合新手。 瀏覽 Hacktoberfest issue

Example 39c_serverless_code_execution.py needs to be changed for it to work

未關閉 適合新手
#512 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

@nthmost-orkes 已經在處理了。

開始於 2026年9月24日。

  • #513 來自 @nthmost-orkes —— 未關閉

評估

難度
1/5
預估耗時
1 小時以內
新手友好度
90/100
Issue 類型
缺陷
描述清晰度
描述清楚
活躍度
活躍
技術堆疊
python
領域
cli, tooling

研究方向

問題位於檔案 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
分支
46
平均合併
8 天 16 小時
30 天內合併 PR
3

環境準備

  • 提供 Dockerfile 或 Docker Compose 檔案
  • 沒有 Pull Request 範本
  • 沒有貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

conductor-oss/python-sdk 的其他 Issue

查看 conductor-oss/python-sdk 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。