mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-28 01:21:43 +00:00
fix(tui): first-run setup preflight + actionable no-provider panel
- tui_gateway: new `setup.status` RPC that reuses CLI's `_has_any_provider_configured()`, so the TUI can ask the same question the CLI bootstrap asks before launching a session - useSessionLifecycle: preflight `setup.status` before both `newSession` and `resumeById`, and render a clear "Setup Required" panel when no provider is configured instead of booting a session that immediately fails with `agent init failed` - createGatewayEventHandler: drop duplicate startup resume logic in favor of the preflighted `resumeById`, and special-case the no-provider agent-init error as a last-mile fallback to the same setup panel - add regression tests for both paths
This commit is contained in:
parent
5b386ced71
commit
0dd5055d59
9 changed files with 145 additions and 62 deletions
|
|
@ -1,4 +1,4 @@
|
|||
import { type ScrollBoxHandle, useApp, useHasSelection, useSelection, useStdout } from '@hermes/ink'
|
||||
import { useApp, useHasSelection, useSelection, useStdout, type ScrollBoxHandle } from '@hermes/ink'
|
||||
import { useStore } from '@nanostores/react'
|
||||
import { useCallback, useEffect, useMemo, useRef, useState } from 'react'
|
||||
|
||||
|
|
@ -270,6 +270,7 @@ export function useMainApp(gw: GatewayClient) {
|
|||
colsRef,
|
||||
composerActions,
|
||||
gw,
|
||||
panel,
|
||||
rpc,
|
||||
setHistoryItems,
|
||||
setLastUserMsg,
|
||||
|
|
@ -413,10 +414,11 @@ export function useMainApp(gw: GatewayClient) {
|
|||
colsRef,
|
||||
newSession: session.newSession,
|
||||
resetSession: session.resetSession,
|
||||
resumeById: session.resumeById,
|
||||
setCatalog
|
||||
},
|
||||
system: { bellOnComplete, stdout, sys },
|
||||
transcript: { appendMessage, setHistoryItems }
|
||||
transcript: { appendMessage, panel, setHistoryItems }
|
||||
}),
|
||||
[
|
||||
appendMessage,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue