V2 footer shows "AFT starting…" until the first AFT tool call because the bridge now spawns lazily
Short description
On OpenCode 2 the footer reads AFT starting… for the whole session until the model happens to call an AFT tool, although nothing is starting.
What happened?
Follow-up to #334 (fixed in 0.57.2 for the "health counts never arrive" case). With a healthy install the footer still sits on AFT starting…, because the bridge is spawned lazily and getStatus answers:
{"success":true,"status":"not_initialized","cache_role":"not_initialized",
"message":"AFT bridge is now spawned lazily; status will be populated after the first tool call."}
formatAftStatusSegment (packages/opencode-plugin/src/tui/v2-status.ts) maps cache_role === "not_initialized" to AFT starting…, so a session that only uses built-in tools (or hasn't used any yet) shows "starting" indefinitely. Users read that as a hang (it's what made me go looking). After an aft_outline call the footer and sidebar populate normally.
Expected: distinguish "not spawned yet, by design" from "spawning", e.g. show AFT idle / AFT ready on first use when the status says the bridge is lazy and not yet started, and keep AFT starting… for an actual spawn in progress.
Happy to send a PR once there's agreement on the wording/signal (the status already carries status: "not_initialized" plus the lazy-spawn message; a dedicated field would be cleaner than matching text).
Plugin version
@cortexkit/aft-opencode 0.57.2
AFT binary version
0.57.2
Platform
linux x64, OpenCode 2.0.18
Thanks, confirmed against the code: formatAftStatusSegment in packages/opencode-plugin/src/tui/v2-status.ts shows AFT starting… whenever cache_role is not_initialized, which is also the normal state before the first AFT tool call, since the bridge starts lazily. For reference, the sidebar placeholder for the same state already changed to "Starts on the first tool call." on master. We'll settle the footer wording and the signal to key on, then reply here before any PR.
Decided: before AFT has started (it starts lazily on the first AFT tool call), the OpenCode 2 footer omits the AFT segment entirely, instead of showing AFT starting…. Once the bridge is up, the segment appears with its usual counts.
For the implementation, please key it on a dedicated field in the status rather than on cache_role === "not_initialized" or on message text, because not_initialized also covers the moment a spawn is actually in progress. If a spawn that's really under way is still worth showing as AFT starting…, that's fine, as long as a session that hasn't used an AFT tool shows nothing. A PR is welcome. Please include a test for the not-started case and one for the started case.
This is still present in 0.64.0: a status read before the first tool call returns the lazy not-initialized state, and the footer still renders it as ‘AFT starting…’. The separate footer opt-out is available, but it does not implement the agreed distinction between not started and starting.