Styx 如何判斷編碼智能體 CLI 登入後是否可用?
Is 'signed in' the same as 'working'? Checking a coding agent's login
Nic Flemmer 在開發中的 Styx 把「Ready」定義為編碼智能體 CLI 成功回覆測試訊息,而不只是已登入。設定時會使用供應商的安裝及登入流程,再傳送一則簡短訊息;若回覆顯示需要方案或用量已用盡,介面會列出原因及處理方法。對沒有低成本檢查方式的 Goose 和 Amp,Styx 標示「未驗證」但仍可開始任務;測試只在設定時或用戶要求時執行,密碼和 token 則留在供應商端。
A coding agent CLI can say it's signed in and still not work: the account has no plan for it, or it's out of usage until the limit resets.
So in Styx, the app I'm building, 'Ready' means more than 'signed in'. During setup it runs the vendor's own installer and sign-in, then sends one tiny message and waits for the answer. If the answer comes back, the plan really works. If it says 'needs a plan' or 'out of usage', the card says that in one sentence, with the fix.
Two things I learned doing it.
Never write your own login flow for someone else's CLI. Run their installer and their sign-in, and keep only where the binary lives and which account it reports. Passwords and tokens stay with the vendor.
Some CLIs have no cheap check. Goose has no offline identity probe, and its provider check spends a model turn. Amp has none either. For those, the row says 'not verified' and still lets you start a task, because a green tick I can't back up is worse than an honest grey one.
The tradeoff is that the tiny message costs a few tokens on a real plan, so I only send it during setup and when you ask.
How do you check that an agent CLI works before you hand it a real task?
來源:DEV Community · dev.to