code agent
Factory
Connect your Factory organization to delegate autofix implementation to Factory droids running on managed computers. Polylane investigates and proposes fixes; Factory implements them and pushes the pull request. Bring your own Factory API key.
連接
從終端機連接Factory。傳入--help可查看Factory接受的旗標。
Terminal
polylane integration connect --type factory來自你Factory帳戶的API金鑰。
連接Factory,把Autofix的實作委派給Factory droid。Polylane調查並提出修復;droid在Factory受管的電腦上實作它並推送pull request。請自備Factory API存取權。
設定
- 在Factory中前往Settings → API keys並建立一把API金鑰(以
fk-開頭)。 - 確認Factory組織的GitHub連接可以存取你的目標儲存庫。
- 把金鑰貼到Polylane。
連接會讓Factory成為工作區建立的每個Autofix的執行器。要把Autofix導回Polylane執行器,請在Settings中Factory整合頁面上關閉Use Factory for all autofixes。
你的金鑰在儲存前會先加密,代理永遠看不到它。你的Factory方案必須包含API與遠端工作區存取。
給droid使用Polylane的MCP工具
Droid可以在實作修復時透過MCP直接查詢Polylane(事件、基礎設施圖、可觀測性)。在Polylane的Settings → Coding agents底下建立一把API金鑰(一鍵,帶有MCP工具所檢查的每個讀取範圍),然後把.factory/mcp.json提交到儲存庫:
{
"mcpServers": {
"polylane": {
"type": "http",
"url": "https://mcp.polylane.com/mcp",
"headers": { "Authorization": "Bearer YOUR_API_KEY" }
}
}
}
中斷連接
在Polylane中斷Factory的連接,然後在Factory中撤銷該API金鑰。
中斷連接
中斷連接會停止所有同步與檢查,並刪除Polylane持有的憑證。 Polylane在Factory中建立的一切也會一併移除;不會留下任何東西。
Terminal
polylane integration disconnect <id>