續接昨天沒有完成的除錯,Input是今天最主要需被克服的難題。花了不少時間和agent溝通和了解問題後,終於找了問題所在,是多個小問題的複合在一起的。在除錯的過程中讓不同的agent經手,每個agent找到一些錯誤後修正,但同時也增加了一些bug進來。所以一個個agent修過後,變的更加的複雜。最後也還是要定下某個框框,讓agent可以在較為侷限的空間裡找問題,方才能解決。
尋找問題的過程中,發現目前的專案有好幾個cs project是有重疊的,且有些是一開始時圖方便而產出的,對於agent來說沒有辧法理解哪個是要再往下調整或是該移除的。因此,又只好再花時間做重構。又擔心重構後會有更多地方出現錯誤。
其實一直都有請agent加入test以防止這樣的狀況發生,但其實效果不是很好。如同人為的開發一般,test很容易就過時了,而AI調整code的速度超過,這表示test也過時的很快。雖然agent修正test錯誤的速度也很快,但用agent開發現階段存在一個問題,那就是context, token的使用量,光是功能部份它就已經常常會出現金魚腦的症狀,再加上還要去調整test,真的是"很浪費”。
然而,還是會讓agent做完某功能後進行test的撰寫,也就是沒有走TDD,但還是會保留test,讓agent有個可以快速驗證的管道。哪怕會浪費一些token,也還是儘量讓test保持更新。在用agent協同開發的領悟是TDD並不是最好的方法,但撰寫一定程度的test仍是有必要的。
而另一個浮現出來的問題則是隨著plugin dll的增加,任何一個dll載入後若是沒有預期的行為,會讓除錯變的逐漸困難
========================================
ConsoleDungeon.Host - Dynamic Plugin Mode
========================================
[1/5] Initializing foundation services...
✓ Foundation services initialized
[2/5] Loading plugin configuration...
✓ Found 8 enabled plugins
[3/5] Loading plugins...
→ Loading: wingedbean.plugins.config (priority: 1000)
✓ Loaded: WingedBean.Plugins.Config v1.0.0
→ Loading: wingedbean.plugins.websocket (priority: 100)
✓ Loaded: WingedBean.Plugins.WebSocket v1.0.0
→ Registered: IWebSocketService (priority: 100)
→ Loading: wingedbean.plugins.terminalui (priority: 100)
✓ Loaded: WingedBean.Plugins.TerminalUI v1.0.0
→ Registered: ITerminalUIService (priority: 100)
→ Loading: wingedbean.plugins.archecs (priority: 100)
✓ Loaded: WingedBean.Plugins.ArchECS v1.0.0
→ Registered: IECSService (priority: 100)
→ Registered: IWorld (priority: 100)
→ Loading: wingedbean.plugins.dungeongame (priority: 100)
✓ Loaded: WingedBean.Plugins.DungeonGame v1.0.0
[DungeonGamePlugin] OnActivateAsync called
[DungeonGamePlugin] Created DungeonGameService instance
[DungeonGamePlugin] Registered IDungeonGameService
→ Registered: IPlugin (priority: 100)
→ Registered: IECSSystem (priority: 100)
→ Registered: IGameUIService (priority: 100)
→ Registered: IRenderService (priority: 100)
→ Loading: wingedbean.plugins.ptyservice (priority: 90)
✓ Loaded: WingedBean.Plugins.PtyService v1.0.0
⊘ Skipping wingedbean.plugins.asciinemarecorder (strategy: Lazy)
→ Loading: wingedbean.plugins.consoledungeon (priority: 50)
✓ Loaded: WingedBean.Plugins.ConsoleDungeon v1.0.0
→ Registered: ITerminalApp (priority: 50)
→ Registered: IInputMapper (priority: 50)
→ Registered: IInputRouter (priority: 50)
✓ 7 plugins loaded successfully
每次增加、更名cs project都會有可能出現plugin載入或是載入後沒有功能的問題。仔細想想,這真的是很吃token的架構。雖然input問題才剛解決,但調整後plugin又出現問題,隨著功能變多,這是下一步要認真思考的並要找到方案的。