Visible tool status, failure diagnosis, and safe recovery flows
Summary
Add a user-visible tool status, failure diagnosis, retry, and safe recovery experience for desktop actions, file search, application interaction, and model connectivity.
A non-technical user should be able to understand what failed, why it failed, what OpenHuman will try next, and how to recover without reading developer logs or losing their configuration.
Problem
When an assistant action fails today, the user may not know whether the problem is a missing permission, unavailable app, model outage, tool bug, disconnected local service, or a bad instruction. This undermines trust, especially for workflows that touch files, applications, professional records, or long-running tasks.
Scope
- Visible tool/action status panel.
- Human-readable failure explanations for missing permissions, missing apps, unavailable services, bad credentials, blocked actions, and model connection failures.
- Automated retry through an alternative method when one exists and is safe.
- Installation/system diagnostic function that can be run from the app.
- User-readable logs or summarized diagnostics, distinct from developer logs.
- Safe recovery/reset flow that preserves user configuration and local memory unless the user explicitly chooses otherwise.
- Clear separation between recoverable failure, blocked-by-policy, and action-needs-user-confirmation states.
Acceptance criteria
- [ ] Tool calls expose lifecycle states that can be rendered in the UI: queued, running, succeeded, failed, blocked, retrying, and needs user input.
- [ ] Common failures include a plain-language cause and a next action.
- [ ] The app can run a diagnostic pass that checks core health, model connectivity, local model availability, permissions, and configured workspace paths.
- [ ] Recovery/reset does not delete user persona, memory, credentials, or workspace configuration without explicit confirmation.
- [ ] Retry behavior is bounded, visible, and does not repeat destructive or sensitive actions without confirmation.
- [ ] The implementing PR includes tests for failure classification and diagnostic output.
- [ ] Diff coverage >= 80% on changed lines.
Implementation Plan
Triage Assessment
Valid and well-specified feature from maintainer. Addresses a critical UX gap: when an assistant action fails, users cannot distinguish between permission issues, model outages, tool bugs, disconnected services, or bad instructions. This undermines trust, especially for professional/ file-touching workflows. Complements #4252 (installer) and #4253 (persona + memory) as the third pillar of the non-technical user experience. NOT a duplicate of either.
Proposed Scope
- Visible tool/action status panel in the chat UI.
- Human-readable failure explanations with recovery actions.
- Automated retry through safe alternative methods.
- In-app diagnostic function (core health, model connectivity, permissions, workspace paths).
- User-readable diagnostic summary (separate from developer logs).
- Safe recovery/reset flow (preserves persona, memory, credentials).
- Tool lifecycle states: queued, running, succeeded, failed, blocked, retrying, needs user input.
Implementation Steps
- Tool lifecycle states (
src/openhuman/tools/traits.rsandsrc/openhuman/approval/): emitToolLifecycleEventon the event bus for each state transition. The chat stream already carriestool_call/tool_resultevents -- extend with interim states (queued, running, retrying). - Status panel (React:
app/src/features/conversations/components/ToolStatusPanel.tsx): collapsible panel showing current/past tool calls, their state, and timing. Use the tool lifecycle events from the chat stream. - Failure classification (
src/openhuman/security/policy.rsandsrc/openhuman/tools/): classify common failure modes: permission denied, unavailable service, bad credentials, blocked-by-policy, model timeout, tool error. Map each to a plain-language message + next-step action. - Diagnostic pass (new controller in
src/openhuman/config/ops.rs):config.run_diagnosticsRPC that checks core health, model connectivity, Ollama status, file permission, workspace path validity. Returns structured results. - Recovery/reset: add a
config.reset_to_safe_defaultsRPC that resets config to defaults while preserving persona, memory, credentials. Requires user confirmation.
Verification
- Unit:
cargo test --lib tools-- lifecycle state emission and failure classification. - E2E: tool failure produces status panel with human-readable message.
- E2E:
config.run_diagnosticsreturns all component statuses. - E2E: recovery/reset preserves persona and memory.
Risks and Open Questions
- Tool lifecycle events add overhead on the hot chat path. Sample or batch for streaming.
- Diagnostic pass may trigger side effects (model inference costs). Make read-only where possible.
Acceptance Criteria
- [ ] Tool lifecycle states visible in UI (queued, running, succeeded, failed, blocked, retrying, needs input).
- [ ] Common failures show plain-language cause and next action.
- [ ] In-app diagnostic pass available.
- [ ] Recovery/reset preserves persona, memory, credentials, workspace config.
- [ ] Retry bounded, visible, and non-destructive.
Partially addressed on main (6be58a9ab) — basic status and failure rendering exist; the lifecycle, diagnosis and recovery layers do not.
What exists
- Tool status rendering —
app/src/features/conversations/components/ChatToolParts.tsx,ToolTimelineBlock.tsx,AssistantUiToolCall.tsx. - Failure rendering —
ToolFailureLines.tsx. - A needs-input concept, but only for sub-agents —
AssistantUiSubagentCall.awaitingUser.test.tsx. - A memory diagnostic —
src/openhuman/memory/tools/doctor.rs.
Against the acceptance criteria
1. "Tool calls expose lifecycle states: queued, running, succeeded, failed, blocked, retrying, and needs user input." — not met. The transcript type carries three states, not seven (app/src/types/derivedTranscript.ts:21):
export type DerivedToolCallStatus = 'running' | 'success' | 'error';
queued, blocked, retrying and needs user input have no representation at the tool-call level. The distinction the issue calls out as important — "clear separation between recoverable failure, blocked-by-policy, and action-needs-user-confirmation states" — collapses into a single 'error'. A permission refusal, a policy block and a genuine tool bug are indistinguishable to the UI, so no amount of UI work can render them differently. This is the load-bearing gap: it is a type-level change in core, and criteria 2 and 4 both depend on it.
2. "Common failures include a plain-language cause and a next action." — not met as a general property. ToolFailureLines renders whatever message the tool produced; there is no mapping from failure class → human-readable cause + suggested next action. Individual tools do this well in places (the Exa key message, the cloud-runtime sign-in copy from #3025), but each is hand-written at its own call site rather than a shared layer.
3. "The app can run a diagnostic pass that checks core health, model connectivity, local model availability, permissions, and configured workspace paths." — partially met, and only for one subsystem. memory/tools/doctor.rs is a memory doctor. There is no app-level diagnostic covering the other four things listed.
4. "Recovery/reset flow that preserves user configuration and local memory." — not met; no such flow exists.
Suggested sequencing
The criteria are not independent — 1 gates 2 and 4:
- Widen the tool-call status type in core and propagate it to
DerivedToolCallStatus. Withoutblockedandneeds_inputas distinct states, "explain what failed and what happens next" cannot be built, because the information is already lost by the time it reaches the UI. Note the concept partly exists for sub-agents (awaitingUser) — worth checking whether that can generalise rather than inventing a parallel scheme. - A failure-classification layer mapping causes (missing permission, app not installed, service unavailable, bad credentials, policy block, model outage) to plain-language text plus a next action. This is where the ad-hoc per-tool messages should converge.
- Extend the diagnostic pass beyond memory, reusing
doctor.rsas the pattern. - Recovery/reset flow, last — it is the most destructive surface and benefits from 1-3 existing first.
Item 1 is a small, well-defined change with a large unlock, and would be a good standalone PR.
Scope note
As filed this is four features in one issue, which is likely why it has sat since 2026-06-29 with no comments. Worth splitting along the four items above; item 1 in particular is concrete enough to pick up immediately.
Leaving open.
Triage: needs opinion — “Visible tool status, failure diagnosis, and safe recovery flows” needs a maintainer decision on product scope/priority or fresh reproduction evidence before its status can be settled. Please advise whether to pursue, narrow, or close it.
Thanks. On current main, tool calls in chat show running, succeeded and failed, plus "waiting for you" and cancelled. The rest of this issue is still open: there are no queued, blocked or retrying states, and no plain-language diagnosis of why something failed or what to do next.
This is still a valid feature. It needs a maintainer to set its priority and, ideally, split out the lifecycle states (smaller) from the diagnosis and recovery flows (larger).