mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-08 03:01:47 +00:00
feat(tui): honest status 'starting agent…' until session.info arrives
Post-async-session.create, `session.create` returns in ~1ms with partial info and the real agent fires `session.info` ~1s later. Previously the status bar went straight to 'ready' right after the instant RPC return, which was misleading — `prompt.submit` would block server-side waiting for the agent to finish building. Now: - `newSession`: status = 'starting agent…' when info has no `version`, else 'ready' (covers the fast resume path too) - `session.info` event: flips status to 'ready' only if it was 'starting agent…', preserving running/interrupted/error states
This commit is contained in:
parent
a8e0a1148f
commit
04e36851b7
2 changed files with 13 additions and 1 deletions
|
|
@ -104,7 +104,16 @@ export function useSessionLifecycle(opts: UseSessionLifecycleOptions) {
|
|||
|
||||
resetSession()
|
||||
setSessionStartedAt(Date.now())
|
||||
patchUiState({ info: r.info ?? null, sid: r.session_id, status: 'ready', usage: usageFrom(r.info ?? null) })
|
||||
// Python's `session.create` returns instantly with partial info (no `version`
|
||||
// field); the `session.info` event will flip status to 'ready' once the
|
||||
// agent is fully built (~1s later). Until then prompt.submit will block
|
||||
// server-side on `_wait_agent`.
|
||||
patchUiState({
|
||||
info: r.info ?? null,
|
||||
sid: r.session_id,
|
||||
status: r.info?.version ? 'ready' : 'starting agent…',
|
||||
usage: usageFrom(r.info ?? null)
|
||||
})
|
||||
|
||||
if (r.info) {
|
||||
setHistoryItems([introMsg(r.info)])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue