fix(tui): hydrate lazy startup panel and use animated loaders
The lazy startup panel could remain stuck on the placeholder when no first prompt was submitted because agent construction only started from _sess(). Keep session.create cheap, but schedule _start_agent_build shortly after returning the placeholder so tools/skills hydrate automatically. Also replace the ugly placeholder bar rows with compact unicode-animations braille loaders for the tools and skills sections. Tests: - python -m py_compile tui_gateway/server.py - cd ui-tui && npm run type-check && npm run build - cd ui-tui && npm test -- --run src/__tests__/useSessionLifecycle.test.ts src/__tests__/useConfigSync.test.ts - scripts/run_tests.sh tests/tui_gateway/test_protocol.py::test_sess_found tests/tools/test_code_execution_modes.py tests/tools/test_code_execution.py
This commit is contained in:
@@ -1726,6 +1726,17 @@ def _(rid, params: dict) -> dict:
|
||||
"transport": current_transport() or _stdio_transport,
|
||||
}
|
||||
|
||||
# Return the lightweight session immediately so Ink can paint the composer
|
||||
# + skeleton panel, then build the real AIAgent just after this response is
|
||||
# flushed. This keeps startup responsive while still hydrating tools/skills
|
||||
# without requiring the user to submit a first prompt.
|
||||
def _deferred_build() -> None:
|
||||
session = _sessions.get(sid)
|
||||
if session is not None:
|
||||
_start_agent_build(sid, session)
|
||||
|
||||
threading.Timer(0.05, _deferred_build).start()
|
||||
|
||||
return _ok(
|
||||
rid,
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user