通過 LoongSuite Pilot 將開發人員原生 AI Coding Agent 運行資料接入 AgentLoop,實現會話、模型調用、工具調用、Token 用量和 Trace 資料的統一觀測與分析。
LoongSuite Pilot 簡介
LoongSuite Pilot 是運行在開發人員原生輕量級採集器,用於自動探索本機已安裝的 AI Coding Agent 並部署所需的 Hook 或外掛程式。LoongSuite Pilot 將不同 Agent 的原始活動資料歸一化為統一事件格式,上報到 AgentLoop 使用的日誌或 Trace 後端。
適用情境
當團隊使用 Claude Code、Codex、Cursor、Qoder 等 AI Coding Agent 進行日常研發時,可通過 LoongSuite Pilot 採集端側活動資料,用於以下情境:
查看團隊使用了哪些 AI Coding Agent。
分析會話、模型調用、工具調用和錯誤事件。
按 Agent 維度統計 Token 用量。
通過日誌檢索、Trace 鏈路或自訂介面分析 Agent 運行過程。
在資料上報前過濾 Prompt、Completion、工具參數等敏感內容。
支援的 AI Coding Agent
Linux / macOS 支援情況
下表列出 LoongSuite Pilot 在 Linux / macOS 端支援的 Agent 及資料擷取能力。
AI Coding Agent | 整合方式 | Trace 上報 | 日誌上報 | Token 採集 | 對話和 Tool Call 採集 |
Claude Code | Hook | 支援 | 支援 | 支援 | 支援 |
Codex | Hook | 支援 | 支援 | 支援 | 支援 |
Cursor | Hook | 支援 | 支援 | 支援 | 支援 |
Cursor CLI | 複用 Cursor Hook | 支援 | 支援 | 支援 | 支援 |
DeepSeek Harness | YAML 補丁外掛程式 / 本地 JSONL 輪詢 | 支援 | 支援 | 支援 | 支援 |
Grok Build | Hook / 本地會話日誌 | 支援 | 支援 | 支援 | 支援 |
Hermes Agent | 原生目錄外掛程式 | 支援 | 支援 | 支援 | 支援 |
Kiro CLI | Hook / 會話輪詢 | 支援 | 支援 | 不支援 | 支援 |
MiMo Code | 外掛程式注入 | 支援 | 支援 | 支援 | 支援 |
OpenClaw | 外掛程式注入 | 支援 | 支援 | 支援 | 支援 |
OpenCode | 外掛程式注入 | 支援 | 支援 | 支援 | 支援 |
Pi Coding Agent | 擴充注入 | 支援 | 支援 | 支援 | 支援 |
Qoder | Hook | 支援 | 支援 | 支援 | 支援 |
Qoder CN | Hook | 支援 | 支援 | 支援 | 支援 |
Qoder for JetBrains | 僅檢測,複用 Qoder 採集鏈路 | 支援 | 支援 | 支援 | 支援 |
Qoder CLI | Hook / 會話輪詢 | 支援 | 支援 | 支援 | 支援 |
Qoder Work | Hook / 本機資料輪詢 | 支援 | 支援 | 支援 | 支援 |
Qoder Work CN | Hook / 本機資料輪詢 | 支援 | 支援 | 支援 | 支援 |
Qwen Code CLI | Hook | 支援 | 支援 | 支援 | 支援 |
Qwen Work CN | Hook / 本機資料輪詢 | 支援 | 支援 | 支援 | 支援 |
Wukong | CLI API 輪詢 | 支援 | 支援 | 支援 | 支援 |
WorkBuddy | Hook 喚醒 / 本地會話監聽與輪詢兜底 | 支援 | 支援 | 支援 | 支援 |
OpenClaw 整合支援 OpenClaw 2026.3.8 或更高版本;低於 2026.5.12 的版本使用相容模式,模型調用時間為推定值。
Token 用量以源 Agent 實際提供的資料為準;Kiro CLI 當前資料來源不提供 Token 用量。
Windows 支援情況
AI Coding Agent | 整合方式 | Trace 上報 | 日誌上報 | Token 採集 | 對話和 Tool Call 採集 | 適用條件 |
Claude Code | Hook | 支援 | 支援 | 支援 | 支援 | - |
Cursor | Hook | 支援 | 支援 | 支援 | 支援 | - |
Qoder Work | Hook / 本機資料源 | 支援 | 支援 | 不支援 | 支援 | User 版本 |
Qoder CLI | Hook | 支援 | 支援 | 不支援 | 支援 | - |
Qoder IDE | Hook / 本機資料源 | 支援 | 支援 | 支援 | 支援 | Qoder 1.10.0 或更高版本,User 版本 |
Qwen Work CN | Hook / 本機資料源 | 支援 | 支援 | 支援 | 支援 | - |
OpenCode | 外掛程式注入 | 支援 | 支援 | 支援 | 支援 | - |
WorkBuddy | Hook 喚醒 / 本地會話採集 | 支援 | 支援 | 支援 | 支援 | WorkBuddy Desktop 5.3.5.0;Windows 11 已完成安裝包端到端驗證 |
未列入本表格的 Agent 當前沒有明確的 Windows 支援聲明;未列入不等同於一定無法在 Windows 上運行。
前提條件
開始接入前,請確認本機滿足以下條件:
目標 AI Coding Agent 已安裝,並至少使用過一次。
已在 AgentLoop 中完成 AI Coding Agent 接入資源初始化,並擷取控制台自動產生的安裝命令。
macOS / Linux 環境要求
通常無需預裝 Node.js 和
npm:安裝器會優先下載並固定使用託管的 Node.js 運行時和先行編譯依賴。已安裝
curl或wget。能夠訪問安裝命令中的 OSS 下載地址。
Windows 環境要求
Windows 10 或更高版本。
PowerShell 5.1 或更高版本。
通常無需預裝 Node.js 和
npm,並能夠訪問安裝命令中的 OSS 下載地址。
託管運行時回退:如果託管的 Node.js 運行時因平台不支援或下載失敗而不可用,安裝器會回退使用系統 Node.js;此時要求已安裝 Node.js 18 或更高版本及 npm。
已知平台邊界:Windows ARM64 和使用 musl 的 Linux(例如 Alpine)當前沒有對應的託管 Node.js 產物,需要提前準備系統 Node.js 18 或更高版本及 npm。
安裝 LoongSuite Pilot
對於 AgentLoop 使用者,建議直接複製 AgentLoop 控制台自動產生的安裝命令進行安裝。命令中除 true、false 外的資源名稱和接入參數,通常由 AgentLoop 在初始化接入資源時自動產生。
在安裝前,需要通過 AgentLoop 控制台擷取對應的 CMS、SLS 參數,在安裝命令中替換為實際值。
macOS / Linux 安裝步驟
# 執行安裝命令,下面所有參數需要替換為上面擷取到的參數
curl -fsSL https://aliyun-observability-release-cn-shanghai.oss-cn-shanghai.aliyuncs.com/loongsuite-pilot/installer.sh -o /tmp/loongsuite-pilot-installer.sh && bash /tmp/loongsuite-pilot-installer.sh install \
--collect-log "true" \
--collect-trace "true" \
--sls-project "您的SLS Project名" \
--sls-logstore "您的SLS Logstore名" \
--sls-endpoint "您的SLS Endpoint" \
--cms-license-key "您的Trace License Key" \
--cms-endpoint "您的Trace Endpoint" \
--cms-workspace "您的Trace Workspace" \
--service-name-prefix "您的服務名首碼"Windows 安裝步驟
# 下載安裝指令碼
Invoke-WebRequest `
-Uri 'https://aliyun-observability-release-cn-shanghai.oss-cn-shanghai.aliyuncs.com/loongsuite-pilot/installer.ps1' `
-OutFile installer.ps1
# 執行安裝命令,下面所有參數需要替換為上面擷取到的參數
.\installer.ps1 install `
-CollectLog 'true' `
-CollectTrace 'true' `
-SlsProject "您的SLS Project名" `
-SlsLogstore "您的SLS Logstore名" `
-SlsEndpoint "您的SLS Endpoint" `
-CmsLicenseKey "您的Trace License Key" `
-CmsEndpoint "您的Trace Endpoint" `
-CmsWorkspace "您的Trace Workspace" `
-ServiceNamePrefix "您的服務名首碼"安裝器會自動完成以下操作:
檢測本機支援的 AI Coding Agent。
讓您選擇需要採集的 Agent。
部署對應的 Hook 或外掛程式。
寫入本地配置。
啟動 LoongSuite Pilot 後台服務。
安裝完成後,執行以下命令查看服務狀態:
macOS / Linux / Windows:
loongsuite-pilot status
loongsuite-pilot info預設情況下,LoongSuite Pilot 會把本地配置、運行狀態和 JSONL 採集結果寫入目前使用者目錄下的 .loongsuite-pilot 目錄。預設路徑如下:
用途 | macOS / Linux | Windows |
資料根目錄 |
|
|
設定檔 |
|
|
本地 JSONL 輸出目錄 |
|
|
Agent 准入控制檔案 |
|
|
管理 LoongSuite Pilot
本地 Dashboard 隨 LoongSuite Pilot 採集服務一起啟動和停止,無需單獨執行 monitor 命令。確認採集服務已啟動後,訪問以下預設地址;如果配置了自訂連接埠,請將地址中的 8765 替換為實際連接埠:
http://127.0.0.1:8765/如需卸載 LoongSuite Pilot 並保留本機資料,執行:
macOS / Linux:
curl -fsSL https://aliyun-observability-release-cn-shanghai.oss-cn-shanghai.aliyuncs.com/loongsuite-pilot/installer.sh -o /tmp/loongsuite-pilot-installer.sh && bash /tmp/loongsuite-pilot-installer.sh uninstallWindows:
.\installer.ps1 uninstall如需同時移除安裝檔案和本機資料,執行:
macOS / Linux:
curl -fsSL https://aliyun-observability-release-cn-shanghai.oss-cn-shanghai.aliyuncs.com/loongsuite-pilot/installer.sh -o /tmp/loongsuite-pilot-installer.sh && bash /tmp/loongsuite-pilot-installer.sh uninstall --purgeWindows:
.\installer.ps1 uninstall -Purge配置 Agent 採集
安裝完成後,可以通過本地設定檔中的 agents 配置控制是否採集某個 AI Coding Agent。預設設定檔路徑如下:
系統 | 設定檔路徑 |
macOS / Linux |
|
Windows |
|
{
"agents": {
"claude-code": {
"enabled": true
},
"cursor": {
"enabled": true
},
"qoder": {
"enabled": false
}
}
}例如,需要採集 Claude Code 和 Cursor、關閉 Qoder 時,可以使用上面的配置。修改後需要重啟 LoongSuite Pilot:
loongsuite-pilot restart配置項 | 說明 |
| 開啟該 Agent 的採集。LoongSuite Pilot 仍會檢測本機是否存在對應資料來源。 |
| 關閉該 Agent 的採集。 |
配置資料脫敏
LoongSuite Pilot 可以在正常化事件發送到輸出後端前,對常見密鑰和個人敏感性資料進行脫敏。脫敏適用於 Prompt、Completion、工具參數或工具結果中可能出現憑證或個人敏感性資料的情境。
如需開啟或調整脫敏策略,請修改本地設定檔:
系統 | 設定檔路徑 |
macOS / Linux |
|
Windows |
|
開啟全部脫敏規則:
{
"mask": {
"mode": "all"
}
}僅開啟指定脫敏規則:
{
"mask": {
"mode": "custom",
"types": [
"apiKey",
"idCard",
"phone",
"email",
"ipAddress",
"bankCard"
]
}
}脫敏模式如下。
模式 | 說明 |
| 不進行脫敏。未配置 mask mode 時預設使用該模式。 |
| 開啟所有內建敏感性資料規則。 |
| 只開啟 |
脫敏類型如下。
類型 | 覆蓋內容 | 替換標記 |
| 阿里雲、AWS、騰訊雲風格的 AccessKey ID。 |
|
| OpenAI-compatible 和常見平颱風格 API Key。 |
|
| PEM 或 OpenSSH 私密金鑰塊。 |
|
| 包含密碼的資料庫 URL。 |
|
| 經過嚴格校正的中國內地 18 位社會安全號碼。 |
|
| 中國內地手機號和固定電話。 |
|
| 常見 ASCII 郵箱地址。 |
|
| IPv4 地址,包括公網和私網地址。 |
|
| 通過發行方號段和 Luhn 校正的高信賴度銀行卡號。 |
|
在包含大量純數字業務標識的日誌中,手機號和銀行卡號的格式檢測可能命中相同形態的資料,建議使用 custom 模式並只開啟所需類型。
LoongSuite Pilot 重點掃描可能包含使用者或工具內容的欄位,例如:
LLM 輸入和輸出訊息。
工具調用參數。
工具調用結果。
已知 Agent 內容欄位。
模型名、Token 數、耗時、Git 分支、Workspace 路徑等穩定中繼資料不作為金鑰產製原料欄位掃描。
修改配置後,執行以下命令重啟 LoongSuite Pilot:
loongsuite-pilot restart驗證接入結果
安裝或修改配置後,可以按以下步驟驗證接入是否生效。
如果重啟 LoongSuite Pilot 後發現採集狀態異常,請手動執行 loongsuite-pilot start 命令開啟採集。
查看本地服務狀態
loongsuite-pilot status
loongsuite-pilot info查看本地採集輸出
macOS / Linux:
ls ~/.loongsuite-pilot/logs/output
tail -f ~/.loongsuite-pilot/logs/output/*.jsonlWindows:
Get-ChildItem "$env:USERPROFILE\.loongsuite-pilot\logs\output"
Get-ChildItem "$env:USERPROFILE\.loongsuite-pilot\logs\output\*.jsonl" |
Sort-Object LastWriteTime |
Select-Object -Last 1 |
Get-Content -Wait如果本地輸出目錄中可以看到新事件,說明 AI Coding Agent 採集鏈路已經生效。
查看 AgentLoop 控制台
觸發一次新的 AI Coding Agent 活動後,回到 AgentLoop 控制台查看對應接入任務的資料狀態。資料到達時間可能受本地批量發送和後端處理延遲影響。
驗證 Agent 採集
如果預期 Agent 沒有資料,請按以下步驟檢查:
確認目標 Agent 已安裝,並至少使用過一次。
確認準入控制檔案中沒有將該 Agent 設定為
off。macOS / Linux 預設路徑為~/.loongsuite-pilot/agent-control.json,Windows 預設路徑為C:\Users\<使用者名稱>\.loongsuite-pilot\agent-control.json。確認設定檔中沒有將該 Agent 設定為
"enabled": false。macOS / Linux 預設路徑為~/.loongsuite-pilot/config.json,Windows 預設路徑為C:\Users\<使用者名稱>\.loongsuite-pilot\config.json。修改配置後,執行
loongsuite-pilot restart。觸發一次新的 Agent 活動,再查看本地輸出或 AgentLoop 控制台。
常見問題
未發現預期 Agent 怎麼辦?
請確認目標 Agent 已安裝、已使用過一次,並且沒有在 agent-control.json 或 config.json 中被關閉。修改配置後,執行 loongsuite-pilot restart。
本地沒有新資料怎麼辦?
請確認 LoongSuite Pilot 處於運行狀態,並在服務啟動後觸發一次新的 AI Coding Agent 活動。然後查看本地 JSONL 輸出目錄:macOS / Linux 預設為 ~/.loongsuite-pilot/logs/output/,Windows 預設為 C:\Users\<使用者名稱>\.loongsuite-pilot\logs\output\。
AgentLoop 控制台暫時沒有資料怎麼辦?
請先確認本地輸出中是否已有新事件。如果本地已有事件但控制台暫未展示,請稍後重新整理控制台,或檢查安裝命令是否來自當前 AgentLoop 接入任務。
如何開啟資料脫敏?
修改本地設定檔中的 mask 配置,儲存後執行 loongsuite-pilot restart。設定檔預設路徑:macOS / Linux 為 ~/.loongsuite-pilot/config.json,Windows 為 C:\Users\<使用者名稱>\.loongsuite-pilot\config.json。