合併: agent::spawn 拆小(1797 行到 373 行,行為不變)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
commit
f682c7714a
|
|
@ -121,7 +121,7 @@
|
|||
- 做法:MCP 的 OAuth(PKCE+動態註冊),在大腦上跑,手機或電腦開瀏覽器完成登入,Token 存保險庫。
|
||||
- 做完:對一個測試用的 OAuth MCP 伺服器登入成功。
|
||||
|
||||
### M7. 拆開 agent::spawn、Tool trait ⬜(最後)
|
||||
### M7. 拆開 agent::spawn、Tool trait 🚧(spawn 已經從 1797 行拆到 373 行、行為不變(937ca5c);Tool trait 還沒做:一個工具呼叫的 1400 行在 run_call,約 40 個 `if call.name == …` 共用 finish/started 兩個閉包和十幾個區域變數,要先改成一個 StepCx 物件帶 finish/started 方法,再把每一塊搬成 trait 的實作。這一步要再整段改寫一次,跟拆 spawn 分開做比較安全)
|
||||
- 做法:E9 之後,把工具執行改成一個 `Tool` trait(參數型別、說明、是否只看、執行),`spawn` 不再用一長串 if 分派。
|
||||
- 做完:行為不變,`agent.rs` 的 `spawn` 小於 500 行。
|
||||
|
||||
|
|
|
|||
2906
src/agent.rs
2906
src/agent.rs
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue