The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
Setup chat: working row after a card, install step on the catalog card (#129210)
Siddharth Balyana59453b1cca6
diff --git a/apps/desktop/src/components/assistant-ui/catalog-install-tool.tsx b/apps/desktop/src/components/assistant-ui/catalog-install-tool.tsxindex f5aa189042b..053d0ae4159 100644--- a/apps/desktop/src/components/assistant-ui/catalog-install-tool.tsx+++ b/apps/desktop/src/components/assistant-ui/catalog-install-tool.tsx@@ -307,10 +307,12 @@ function RowOutcome({if (target.state === 'initiated' || sending) {return (<div className="grid min-w-0 gap-1.5" role="status">- <p className={cn(CAPTION, 'text-(--ui-text-tertiary) wrap-anywhere')}>- {target.state === 'initiated' && target.detail ? target.detail : copy.installing}- </p>+ <p className={cn(CAPTION, 'text-(--ui-text-tertiary)')}>{copy.installing}</p><Progress animated aria-label={copy.installing} className="h-0.5 bg-primary/15" indeterminate />+ {/* The install phase the host is in ("Downloading…", "Installing Python packages…"). */}+ {target.state === 'initiated' && target.detail ? (+ <p className={cn(CAPTION, 'text-(--ui-text-quaternary) wrap-anywhere')}>{target.detail}</p>+ ) : null}</div>)}diff --git a/apps/desktop/src/components/assistant-ui/thread/assistant-message.tsx b/apps/desktop/src/components/assistant-ui/thread/assistant-message.tsxindex da67b759bdf..9437e3dbe6a 100644--- a/apps/desktop/src/components/assistant-ui/thread/assistant-message.tsx+++ b/apps/desktop/src/components/assistant-ui/thread/assistant-message.tsx@@ -399,14 +399,22 @@ const AssistantStatusSlot: FC = () => {return 'none'}- return s.message.status?.type === 'running' && s.message.content.length === 0 ? 'placeholder' : 'activity'+ if (s.message.status?.type !== 'running') {+ return 'activity'+ }++ if (s.message.content.length === 0) {+ return 'placeholder'+ }++ return s.message.content.every(part => part.type === 'reasoning') ? 'thinking' : 'activity'})if (slot === 'none') {return null}- return slot === 'placeholder' ? <ResponseLoadingIndicator /> : <TurnActivityIndicator />+ return slot === 'placeholder' ? <ResponseLoadingIndicator /> : <TurnActivityIndicator thinking={slot === 'thinking'} />}/**diff --git a/apps/desktop/src/components/assistant-ui/thread/status.tsx b/apps/desktop/src/components/assistant-ui/thread/status.tsxindex d13b551a1a7..4148f4b8124 100644--- a/apps/desktop/src/components/assistant-ui/thread/status.tsx+++ b/apps/desktop/src/components/assistant-ui/thread/status.tsx@@ -8,6 +8,7 @@ import { toolPresentVerb } from '@/components/assistant-ui/tool/run-summary'import { useElapsedSeconds } from '@/components/chat/activity-timer'import { ActivityTimerText } from '@/components/chat/activity-timer-text'import { SCAFFOLD_LABEL_CLASS } from '@/components/chat/scaffold-row'+import { useOnboardingChatActive } from '@/components/onboarding-chat/assembly'import { Codicon } from '@/components/ui/codicon'import { Loader } from '@/components/ui/loader'import { StatusPulse } from '@/components/ui/status-pulse'@@ -19,6 +20,7 @@ import { sessionCompacting } from '@/store/compaction'import { $localModelsEnabled } from '@/store/local-models-flag'import { sessionAwaitingInput } from '@/store/prompts'import { parseModelLoadWait, sessionProviderWait } from '@/store/provider-wait'+import { $showReasoning } from '@/store/reasoning-disclosure'import { $currentModel } from '@/store/session'import { type DraftingTool, sessionDraftingTool } from '@/store/tool-drafting'import type { LocalModelLoadProgress } from '@/types/hermes'@@ -305,9 +307,13 @@ export const BackgroundResumeNotice: FC = () => {// Subscribes to the activity signal ITSELF (rather than taking it as a prop)// so that per-token updates re-render only this leaf, not the whole// AssistantMessage subtree.-export const TurnActivityIndicator: FC = () => {+export const TurnActivityIndicator: FC<{ thinking?: boolean }> = ({ thinking = false }) => {const { t } = useI18n()- const activity = useAuiState(s => activitySignature(s.message.content))+ // Same rule the reasoning disclosure renders by (message-parts.tsx).+ const showReasoning = useStore($showReasoning)+ const guidedChat = useOnboardingChatActive()+ const reasoningShown = showReasoning && !guidedChat+ const activity = useAuiState(s => activitySignature(s.message.content, reasoningShown))// Timestamp of the last visible progress, held from the moment the quiet// spell qualifies. Holding the timestamp (not a boolean) is what lets the@@ -341,6 +347,23 @@ export const TurnActivityIndicator: FC = () => {return () => window.clearTimeout(id)}, [activity])+ // The user handing the turn back is progress too: a hidden setup prompt+ // starts a fresh turn under the card it answers, and an answered question+ // card resumes the turn it paused. Neither is a gap between two quick calls,+ // so the wait after it shows at once, timed from that moment, the way a+ // normal send's row does.+ const [handBack, setHandBack] = useState({ awaitingInput, turnStartedAt })++ if (handBack.awaitingInput !== awaitingInput || handBack.turnStartedAt !== turnStartedAt) {+ setHandBack({ awaitingInput, turnStartedAt })++ if (turnStartedAt !== undefined && turnStartedAt !== handBack.turnStartedAt) {+ setQuietSince(turnStartedAt)+ } else if (handBack.awaitingInput && !awaitingInput) {+ setQuietSince(Date.now())+ }+ }+// Every second the app claims to be working belongs to something. A named// wait says what it is straight away; an unnamed gap has to go quiet for// TURN_QUIET_S first, or a run of quick calls would strobe a row between@@ -372,6 +395,12 @@ export const TurnActivityIndicator: FC = () => {setEverActive(true)}+ // A reply that has only thought so far, with the thinking not drawn, has+ // still put nothing on screen: it keeps the pre-first-token row.+ if (thinking && !reasoningShown) {+ return <ResponseLoadingIndicator />+ }+if (!active && !everActive) {return null}diff --git a/apps/desktop/src/components/assistant-ui/thread/turn-activity.ts b/apps/desktop/src/components/assistant-ui/thread/turn-activity.tsindex 4704043f807..ad3d2624ab7 100644--- a/apps/desktop/src/components/assistant-ui/thread/turn-activity.ts+++ b/apps/desktop/src/components/assistant-ui/thread/turn-activity.ts@@ -1,3 +1,4 @@+import { QUESTION_CARD_TOOLS } from '@/lib/chat-messages'import { isSilentTool } from '@/lib/tool-render-class'/**@@ -21,6 +22,13 @@ export interface ActivityPart {// A sealed call carries a completion marker and no result.const settled = (part: ActivityPart): boolean => part.result !== undefined || part.completedAt !== undefined+// A question card is the user's move, not the agent's. Open, the user is+// answering it; answered, it narrates nothing, and its result landing is the+// user's answer coming back rather than the agent producing something. The+// indicator times that hand-back itself.+const isQuestionCard = (part: ActivityPart): boolean =>+ part.type === 'tool-call' && QUESTION_CARD_TOOLS.has(part.toolName ?? '')+/*** What the tail message has produced so far, as a value that changes exactly* when the turn makes visible progress.@@ -31,21 +39,30 @@ const settled = (part: ActivityPart): boolean => part.result !== undefined || pa* signature without it reads a finished tool call as more of the same silence* and dates the gap after it from whenever the call started.*/-export function activitySignature(content: readonly ActivityPart[]): string {+export function activitySignature(content: readonly ActivityPart[], reasoningShown = true): string {+ let parts = 0let textLength = 0let settledTools = 0for (const part of content) {+ // Reasoning the transcript does not draw (the guided chat, or the user+ // turned it off) is the model thinking in silence, not progress on screen.+ if (!reasoningShown && part.type === 'reasoning') {+ continue+ }++ parts += 1+if (typeof part.text === 'string') {textLength += part.text.length}- if (part.type === 'tool-call' && settled(part)) {+ if (part.type === 'tool-call' && settled(part) && !isQuestionCard(part)) {settledTools += 1}}- return `${content.length}:${textLength}:${settledTools}`+ return `${parts}:${textLength}:${settledTools}`}/**@@ -58,5 +75,7 @@ export function activitySignature(content: readonly ActivityPart[]): string {* of those is as unnarrated as a wait on nothing at all.*/export function toolNarratesWait(content: readonly ActivityPart[]): boolean {- return content.some(part => part.type === 'tool-call' && !settled(part) && !isSilentTool(part.toolName ?? ''))+ return content.some(+ part => part.type === 'tool-call' && !settled(part) && !isSilentTool(part.toolName ?? '') && !isQuestionCard(part)+ )}diff --git a/hermes_cli/plugins_cmd_install.py b/hermes_cli/plugins_cmd_install.pyindex 58ac0032700..663f08e62be 100644--- a/hermes_cli/plugins_cmd_install.py+++ b/hermes_cli/plugins_cmd_install.py@@ -559,12 +559,14 @@ def cmd_install(def dashboard_install_plugin(identifier: str, *, force: bool, enable: bool, catalog_name: Optional[str] = None,- ref: Optional[str] = None,+ ref: Optional[str] = None, on_step: Optional[Callable[[str], None]] = None,) -> dict[str, Any]:"""Non-interactive install for the dashboard/TUI. *catalog_name* installs a curated entry at itspinned SHA (identifier may be empty); *ref* pins a custom source to one full commit SHA (same- contract as ``--ref``); every path enforces the kill list (no GUI bypass)."""+ contract as ``--ref``); every path enforces the kill list (no GUI bypass). *on_step* hears a short+ user-facing line as each slow phase starts (the catalog card draws it under its bar)."""from hermes_cli import plugins_cmd_catalog as catalog+ step = on_step or (lambda _text: None)warnings: list[str] = []entry = Noneif catalog_name:@@ -589,6 +591,7 @@ def dashboard_install_plugin(return catalog.install_catalog_entry(entry, force=force, allow_removed=False)return _pc()._install_plugin_core(identifier, force=force, ref=(ref or "").strip() or None)+ step("Downloading…")try:target, installed_manifest, installed_name = recorded_install(_install, catalog_name=entry.name if entry is not None else None, identifier=identifier)@@ -605,9 +608,13 @@ def dashboard_install_plugin(except _pc().PluginOperationError as exc:return {"ok": False, "error": str(exc)}+ deps = _pc()._python_dependency_summary(target, warnings)if enable:from hermes_cli.plugins_admission import AdmissionRefused+ if deps:+ # Enabling admits the plugin, and admission resolves its Python dependencies.+ step("Installing Python packages…")try:_pc()._set_plugin_enabled(installed_name, enable=True)except AdmissionRefused as exc:@@ -615,11 +622,12 @@ def dashboard_install_plugin("ok": False, "error": f"enable refused: {exc}","plugin_name": installed_name, "enabled": False,}- deps = _pc()._python_dependency_summary(target, warnings)ap = target / "after-install.md"# Deps first, then load: the plugin activates in this process (TUI/Desktop server subscribers see it)# and in the running gateway; ``activation`` says what is live now vs next session (#87770).from hermes_cli.plugins_activation import activate_plugin_now+ if enable:+ step("Loading its tools…")activated = activate_plugin_now(installed_name) if enable else {"gateway_reloaded": False, "activation": None, "restart_required": False}return {diff --git a/tests/tools/test_connectors_catalog.py b/tests/tools/test_connectors_catalog.pyindex ad0df9f7aaf..d94b98ae50c 100644--- a/tests/tools/test_connectors_catalog.py+++ b/tests/tools/test_connectors_catalog.py@@ -52,7 +52,7 @@ class FakeInstaller:if entry.name in self.refusal:raise RuntimeError(self.refusal[entry.name])- def install_plugin(self, name, *, force, enable, ref):+ def install_plugin(self, name, *, force, enable, ref, on_step):from hermes_constants import get_hermes_homeself.installs.append({"name": name, "force": force, "enable": enable, "ref": ref,diff --git a/tools/connectors/catalog.py b/tools/connectors/catalog.pyindex d602621ba94..655beacb013 100644--- a/tools/connectors/catalog.py+++ b/tools/connectors/catalog.py@@ -90,10 +90,11 @@ class HostInstaller:raise_if_removed(entry.name, entry.repo)_refuse_unsupported_catalog_platform(entry)- def install_plugin(self, name: str, *, force: bool, enable: bool, ref: Optional[str]) -> Dict[str, Any]:+ def install_plugin(self, name: str, *, force: bool, enable: bool, ref: Optional[str],+ on_step: Callable[[str], None]) -> Dict[str, Any]:from hermes_cli.plugins_cmd import dashboard_install_plugin- return dashboard_install_plugin("", force=force, enable=enable, catalog_name=name, ref=ref)+ return dashboard_install_plugin("", force=force, enable=enable, catalog_name=name, ref=ref, on_step=on_step)def skill_meta(self, identifier: str) -> Optional[Dict[str, Any]]:"""The first hub source that knows the identifier; metadata only, no bundle download."""@@ -226,9 +227,14 @@ class _Runner:work = _Work()self.work[target.name] = work+ def step(text: str) -> None:+ # The phase line under the row's bar; a row that left ``initiated`` keeps its own text.+ if not operation.settled and target.state == TargetState.initiated:+ operation.refresh(target.name, connect_url=None, detail=text, actor=Actor.backend_watcher)+def body() -> None:try:- work.outcome = self._install(target, env)+ work.outcome = self._install(target, env, step)except Exception as exc:work.error = self._detail(exc, target)work.done.set()@@ -238,16 +244,18 @@ class _Runner:threading.Thread(target=contextvars.copy_context().run, args=(body,), daemon=True,name=f"catalog-install-{target.name}").start()- def _install(self, target: Target, env: Dict[str, str]) -> Dict[str, Any]:+ def _install(self, target: Target, env: Dict[str, str], step: Callable[[str], None]) -> Dict[str, Any]:profile = (env.get("target_profile") or self.profile).strip()force = _flag(env.get("force"), False)with target_scope(profile):_save_credentials({k: v for k, v in env.items() if k not in _OPTION_KEYS and v})if target.kind == "skill":identifier = str(self.facts[target.name].get("identifier") or target.name)+ step("Downloading…")return {"profile": profile, **self.installer.install_skill(identifier, force=force)}enable = _flag(env.get("enable"), True)- result = self.installer.install_plugin(target.name, force=force, enable=enable, ref=env.get("ref") or None)+ result = self.installer.install_plugin(target.name, force=force, enable=enable,+ ref=env.get("ref") or None, on_step=step)if not result.get("ok"):raise RuntimeError(result.get("error") or "the install failed")return {"profile": profile, "enabled": enable, **result}