Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

fix(tools): classify unavailable, not-found and unsupported tool failures as permanent

M3gA-Mind6fe592eaa706
diff --git a/app/src/features/conversations/components/ToolFailureLines.tsx b/app/src/features/conversations/components/ToolFailureLines.tsx
index 5ac2de97f9..e53740d138 100644
--- a/app/src/features/conversations/components/ToolFailureLines.tsx
+++ b/app/src/features/conversations/components/ToolFailureLines.tsx
@@ -16,6 +16,8 @@ const LOCALIZED_FAILURE_CLASSES: ReadonlySet<string> = new Set([
'timeout',
'denied',
'approvalExpired',
+ 'notFound',
+ 'unsupported',
'unknown',
]);
diff --git a/app/src/lib/i18n/ar.ts b/app/src/lib/i18n/ar.ts
index 19a3d8f21a..eca28ad725 100644
--- a/app/src/lib/i18n/ar.ts
+++ b/app/src/lib/i18n/ar.ts
@@ -199,6 +199,10 @@ const messages: TranslationMap = {
'conversations.toolFailure.unknown.cause': 'حدث خطأ ما في هذا الإجراء.',
'conversations.toolFailure.unknown.next':
'حاول مرة أخرى؛ وإذا استمر الفشل، شغّل التشخيص من الإعدادات.',
+ 'conversations.toolFailure.notFound.cause': 'ما طلبه هذا الإجراء غير موجود أو غير متاح هنا.',
+ 'conversations.toolFailure.notFound.next': 'لا حاجة لأي إجراء. يمكن للمساعد البحث عن الاسم الصحيح والمحاولة مرة أخرى.',
+ 'conversations.toolFailure.unsupported.cause': 'لا يستطيع OpenHuman القيام بذلك تلقائيًا بعد.',
+ 'conversations.toolFailure.unsupported.next': 'قم بذلك يدويًا، أو اطلب خيارًا آخر.',
'conversations.backgroundTasks.title': 'مهام الخلفية',
'nav.feedback': 'شارك ملاحظاتك',
'feedback.board': 'لوحة الملاحظات',
diff --git a/app/src/lib/i18n/bn.ts b/app/src/lib/i18n/bn.ts
index 63da7e1515..e8f0b72f48 100644
--- a/app/src/lib/i18n/bn.ts
+++ b/app/src/lib/i18n/bn.ts
@@ -208,6 +208,10 @@ const messages: TranslationMap = {
'conversations.toolFailure.unknown.cause': 'এই কাজটিতে কিছু ভুল হয়েছে।',
'conversations.toolFailure.unknown.next':
'আবার চেষ্টা করুন; বারবার ব্যর্থ হলে সেটিংস থেকে ডায়াগনস্টিকস চালান।',
+ 'conversations.toolFailure.notFound.cause': 'এই কাজটি যা চেয়েছিল তা নেই বা এখানে উপলভ্য নয়।',
+ 'conversations.toolFailure.notFound.next': 'কিছু করার দরকার নেই। সহকারী সঠিক নামটি খুঁজে আবার চেষ্টা করতে পারে।',
+ 'conversations.toolFailure.unsupported.cause': 'OpenHuman এখনও এটি স্বয়ংক্রিয়ভাবে করতে পারে না।',
+ 'conversations.toolFailure.unsupported.next': 'এটি নিজে করুন, অথবা অন্য একটি বিকল্প চান।',
'conversations.backgroundTasks.title': 'পটভূমি কাজ',
'nav.feedback': 'মতামত দিন',
'feedback.board': 'মতামত বোর্ড',
diff --git a/app/src/lib/i18n/de.ts b/app/src/lib/i18n/de.ts
index d5a5b972b4..048d01ba0b 100644
--- a/app/src/lib/i18n/de.ts
+++ b/app/src/lib/i18n/de.ts
@@ -225,6 +225,10 @@ const messages: TranslationMap = {
'conversations.toolFailure.unknown.cause': 'Bei dieser Aktion ist etwas schiefgelaufen.',
'conversations.toolFailure.unknown.next':
'Versuche es erneut; wenn es weiterhin fehlschlägt, führe die Diagnose in den Einstellungen aus.',
+ 'conversations.toolFailure.notFound.cause': 'Was diese Aktion angefordert hat, existiert nicht oder ist hier nicht verfügbar.',
+ 'conversations.toolFailure.notFound.next': 'Du musst nichts tun. Der Assistent kann den richtigen Namen suchen und es erneut versuchen.',
+ 'conversations.toolFailure.unsupported.cause': 'OpenHuman kann das noch nicht automatisch erledigen.',
+ 'conversations.toolFailure.unsupported.next': 'Erledige es manuell oder bitte um eine andere Option.',
'conversations.backgroundTasks.title': 'Hintergrundaufgaben',
'nav.feedback': 'Feedback geben',
'feedback.board': 'Feedback-Board',
diff --git a/app/src/lib/i18n/en.ts b/app/src/lib/i18n/en.ts
index d6391e1025..86ac1ca052 100644
--- a/app/src/lib/i18n/en.ts
+++ b/app/src/lib/i18n/en.ts
@@ -3848,6 +3848,10 @@ const en: TranslationMap = {
'conversations.toolFailure.unknown.cause': 'Something went wrong with this action.',
'conversations.toolFailure.unknown.next':
'Try again; if it keeps failing, run diagnostics from Settings.',
+ 'conversations.toolFailure.notFound.cause': "What this action asked for doesn't exist or isn't available here.",
+ 'conversations.toolFailure.notFound.next': 'No action needed. The assistant can look up the right name and try again.',
+ 'conversations.toolFailure.unsupported.cause': "OpenHuman can't do this automatically yet.",
+ 'conversations.toolFailure.unsupported.next': 'Do it manually, or ask for a different option.',
'conversations.backgroundTasks.title': 'Background tasks',
'conversations.backgroundTasks.titleWithCount': 'Background tasks ({count})',
'conversations.backgroundTasks.running': '{count} running',
diff --git a/app/src/lib/i18n/es.ts b/app/src/lib/i18n/es.ts
index b642378fcb..2fe5ac6339 100644
--- a/app/src/lib/i18n/es.ts
+++ b/app/src/lib/i18n/es.ts
@@ -216,6 +216,10 @@ const messages: TranslationMap = {
'conversations.toolFailure.unknown.cause': 'Algo salió mal con esta acción.',
'conversations.toolFailure.unknown.next':
'Inténtalo de nuevo; si sigue fallando, ejecuta el diagnóstico desde Configuración.',
+ 'conversations.toolFailure.notFound.cause': 'Lo que pidió esta acción no existe o no está disponible aquí.',
+ 'conversations.toolFailure.notFound.next': 'No hace falta hacer nada. El asistente puede buscar el nombre correcto y volver a intentarlo.',
+ 'conversations.toolFailure.unsupported.cause': 'OpenHuman todavía no puede hacer esto automáticamente.',
+ 'conversations.toolFailure.unsupported.next': 'Hazlo manualmente o pide otra opción.',
'conversations.backgroundTasks.title': 'Tareas en segundo plano',
'nav.feedback': 'Compartir opiniones',
'feedback.board': 'Tablero de opiniones',
diff --git a/app/src/lib/i18n/fr.ts b/app/src/lib/i18n/fr.ts
index 0d79a03342..1f28ab8fab 100644
--- a/app/src/lib/i18n/fr.ts
+++ b/app/src/lib/i18n/fr.ts
@@ -223,6 +223,10 @@ const messages: TranslationMap = {
'conversations.toolFailure.unknown.cause': 'Un problème est survenu avec cette action.',
'conversations.toolFailure.unknown.next':
"Réessayez ; si l'échec persiste, lancez le diagnostic depuis les Paramètres.",
+ 'conversations.toolFailure.notFound.cause': "Ce que cette action demandait n'existe pas ou n'est pas disponible ici.",
+ 'conversations.toolFailure.notFound.next': "Aucune action nécessaire. L'assistant peut chercher le bon nom et réessayer.",
+ 'conversations.toolFailure.unsupported.cause': 'OpenHuman ne peut pas encore faire cela automatiquement.',
+ 'conversations.toolFailure.unsupported.next': 'Faites-le manuellement ou demandez une autre option.',
'conversations.backgroundTasks.title': 'Tâches en arrière-plan',
'nav.feedback': 'Donner mon avis',
'feedback.board': 'Tableau des suggestions',
diff --git a/app/src/lib/i18n/hi.ts b/app/src/lib/i18n/hi.ts
index 27c2620d1a..053efdfacb 100644
--- a/app/src/lib/i18n/hi.ts
+++ b/app/src/lib/i18n/hi.ts
@@ -210,6 +210,10 @@ const messages: TranslationMap = {
'conversations.toolFailure.unknown.cause': 'इस कार्य में कुछ गड़बड़ हो गई।',
'conversations.toolFailure.unknown.next':
'दोबारा प्रयास करें; यदि यह बार-बार विफल हो, तो सेटिंग्स से डायग्नोस्टिक्स चलाएँ।',
+ 'conversations.toolFailure.notFound.cause': 'इस कार्रवाई ने जो माँगा वह मौजूद नहीं है या यहाँ उपलब्ध नहीं है।',
+ 'conversations.toolFailure.notFound.next': 'कुछ करने की ज़रूरत नहीं। सहायक सही नाम खोजकर फिर से कोशिश कर सकता है।',
+ 'conversations.toolFailure.unsupported.cause': 'OpenHuman अभी इसे अपने आप नहीं कर सकता।',
+ 'conversations.toolFailure.unsupported.next': 'इसे मैन्युअल रूप से करें, या कोई दूसरा विकल्प माँगें।',
'conversations.backgroundTasks.title': 'नेपथ्य कार्य',
'nav.feedback': 'फ़ीडबैक साझा करें',
'feedback.board': 'फ़ीडबैक बोर्ड',
diff --git a/app/src/lib/i18n/id.ts b/app/src/lib/i18n/id.ts
index f5f3fab69e..3276592b8b 100644
--- a/app/src/lib/i18n/id.ts
+++ b/app/src/lib/i18n/id.ts
@@ -215,6 +215,10 @@ const messages: TranslationMap = {
'conversations.toolFailure.unknown.cause': 'Terjadi kesalahan pada tindakan ini.',
'conversations.toolFailure.unknown.next':
'Coba lagi; jika terus gagal, jalankan diagnostik dari Pengaturan.',
+ 'conversations.toolFailure.notFound.cause': 'Yang diminta tindakan ini tidak ada atau tidak tersedia di sini.',
+ 'conversations.toolFailure.notFound.next': 'Tidak perlu melakukan apa pun. Asisten dapat mencari nama yang benar dan mencoba lagi.',
+ 'conversations.toolFailure.unsupported.cause': 'OpenHuman belum bisa melakukan ini secara otomatis.',
+ 'conversations.toolFailure.unsupported.next': 'Lakukan secara manual, atau minta opsi lain.',
'conversations.backgroundTasks.title': 'Tugas latar belakang',
'nav.feedback': 'Bagikan masukan',
'feedback.board': 'Papan masukan',
diff --git a/app/src/lib/i18n/it.ts b/app/src/lib/i18n/it.ts
index 5aab7d099e..cca5379d85 100644
--- a/app/src/lib/i18n/it.ts
+++ b/app/src/lib/i18n/it.ts
@@ -218,6 +218,10 @@ const messages: TranslationMap = {
'conversations.toolFailure.unknown.cause': 'Qualcosa è andato storto con questa azione.',
'conversations.toolFailure.unknown.next':
'Riprova; se continua a fallire, esegui la diagnostica dalle Impostazioni.',
+ 'conversations.toolFailure.notFound.cause': 'Ciò che questa azione ha richiesto non esiste o non è disponibile qui.',
+ 'conversations.toolFailure.notFound.next': "Non serve fare nulla. L'assistente può cercare il nome corretto e riprovare.",
+ 'conversations.toolFailure.unsupported.cause': 'OpenHuman non può ancora farlo automaticamente.',
+ 'conversations.toolFailure.unsupported.next': "Fallo manualmente o chiedi un'altra opzione.",
'conversations.backgroundTasks.title': 'Attività in background',
'nav.feedback': 'Condividi feedback',
'feedback.board': 'Bacheca dei feedback',
diff --git a/app/src/lib/i18n/ko.ts b/app/src/lib/i18n/ko.ts
index aea323650c..c07372d946 100644
--- a/app/src/lib/i18n/ko.ts
+++ b/app/src/lib/i18n/ko.ts
@@ -204,6 +204,10 @@ const messages: TranslationMap = {
'conversations.toolFailure.unknown.cause': '이 작업에서 문제가 발생했습니다.',
'conversations.toolFailure.unknown.next':
'다시 시도하세요. 계속 실패하면 설정에서 진단을 실행하세요.',
+ 'conversations.toolFailure.notFound.cause': '이 작업이 요청한 항목이 없거나 여기서 사용할 수 없습니다.',
+ 'conversations.toolFailure.notFound.next': '따로 할 일은 없습니다. 어시스턴트가 올바른 이름을 찾아 다시 시도할 수 있습니다.',
+ 'conversations.toolFailure.unsupported.cause': 'OpenHuman은 아직 이 작업을 자동으로 할 수 없습니다.',
+ 'conversations.toolFailure.unsupported.next': '직접 처리하거나 다른 옵션을 요청하세요.',
'conversations.backgroundTasks.title': '백그라운드 작업',
'nav.feedback': '피드백 보내기',
'feedback.board': '피드백 보드',
diff --git a/app/src/lib/i18n/pl.ts b/app/src/lib/i18n/pl.ts
index c9980b44e6..92e8f3465d 100644
--- a/app/src/lib/i18n/pl.ts
+++ b/app/src/lib/i18n/pl.ts
@@ -218,6 +218,10 @@ const messages: TranslationMap = {
'conversations.toolFailure.unknown.cause': 'Coś poszło nie tak z tą czynnością.',
'conversations.toolFailure.unknown.next':
'Spróbuj ponownie; jeśli nadal się nie udaje, uruchom diagnostykę w Ustawieniach.',
+ 'conversations.toolFailure.notFound.cause': 'To, o co prosiła ta akcja, nie istnieje lub nie jest tu dostępne.',
+ 'conversations.toolFailure.notFound.next': 'Nic nie trzeba robić. Asystent może znaleźć właściwą nazwę i spróbować ponownie.',
+ 'conversations.toolFailure.unsupported.cause': 'OpenHuman nie potrafi jeszcze zrobić tego automatycznie.',
+ 'conversations.toolFailure.unsupported.next': 'Zrób to ręcznie lub poproś o inną opcję.',
'conversations.backgroundTasks.title': 'Zadania w tle',
'nav.feedback': 'Podziel się opinią',
'feedback.board': 'Tablica opinii',
diff --git a/app/src/lib/i18n/pt.ts b/app/src/lib/i18n/pt.ts
index 0a079c3fa1..e2736b1865 100644
--- a/app/src/lib/i18n/pt.ts
+++ b/app/src/lib/i18n/pt.ts
@@ -212,6 +212,10 @@ const messages: TranslationMap = {
'conversations.toolFailure.unknown.cause': 'Algo deu errado com esta ação.',
'conversations.toolFailure.unknown.next':
'Tente novamente; se continuar falhando, execute o diagnóstico nas Configurações.',
+ 'conversations.toolFailure.notFound.cause': 'O que esta ação pediu não existe ou não está disponível aqui.',
+ 'conversations.toolFailure.notFound.next': 'Nenhuma ação necessária. O assistente pode procurar o nome certo e tentar de novo.',
+ 'conversations.toolFailure.unsupported.cause': 'O OpenHuman ainda não consegue fazer isso automaticamente.',
+ 'conversations.toolFailure.unsupported.next': 'Faça isso manualmente ou peça outra opção.',
'conversations.backgroundTasks.title': 'Tarefas em segundo plano',
'nav.feedback': 'Enviar feedback',
'feedback.board': 'Quadro de feedback',
diff --git a/app/src/lib/i18n/ru.ts b/app/src/lib/i18n/ru.ts
index e04dcab260..f95b316599 100644
--- a/app/src/lib/i18n/ru.ts
+++ b/app/src/lib/i18n/ru.ts
@@ -213,6 +213,10 @@ const messages: TranslationMap = {
'conversations.toolFailure.unknown.cause': 'С этим действием что-то пошло не так.',
'conversations.toolFailure.unknown.next':
'Повторите попытку; если ошибка повторяется, запустите диагностику в Настройках.',
+ 'conversations.toolFailure.notFound.cause': 'То, что запросило это действие, не существует или недоступно здесь.',
+ 'conversations.toolFailure.notFound.next': 'Ничего делать не нужно. Ассистент может найти правильное название и попробовать снова.',
+ 'conversations.toolFailure.unsupported.cause': 'OpenHuman пока не может сделать это автоматически.',
+ 'conversations.toolFailure.unsupported.next': 'Сделайте это вручную или попросите другой вариант.',
'conversations.backgroundTasks.title': 'Фоновые задачи',
'nav.feedback': 'Поделиться отзывом',
'feedback.board': 'Доска отзывов',
diff --git a/app/src/lib/i18n/zh-CN.ts b/app/src/lib/i18n/zh-CN.ts
index 23c8667243..63a0995222 100644
--- a/app/src/lib/i18n/zh-CN.ts
+++ b/app/src/lib/i18n/zh-CN.ts
@@ -185,6 +185,10 @@ const messages: TranslationMap = {
'conversations.toolFailure.approvalExpired.next': '再次提出以执行它:OpenHuman 不会自行重试。',
'conversations.toolFailure.unknown.cause': '此操作出现了问题。',
'conversations.toolFailure.unknown.next': '请重试;如果持续失败,请在设置中运行诊断。',
+ 'conversations.toolFailure.notFound.cause': '此操作请求的内容不存在,或在此处不可用。',
+ 'conversations.toolFailure.notFound.next': '无需任何操作。助手可以查找正确的名称后重试。',
+ 'conversations.toolFailure.unsupported.cause': 'OpenHuman 目前还无法自动完成此操作。',
+ 'conversations.toolFailure.unsupported.next': '请手动完成,或换一个选项。',
'conversations.backgroundTasks.title': '后台任务',
'nav.feedback': '分享反馈',
'feedback.board': '反馈板',
diff --git a/app/src/store/chatRuntimeSlice.ts b/app/src/store/chatRuntimeSlice.ts
index d4b7852c47..8d16d52193 100644
--- a/app/src/store/chatRuntimeSlice.ts
+++ b/app/src/store/chatRuntimeSlice.ts
@@ -244,7 +244,7 @@ export interface SubagentToolCallEntry {
export interface ToolFailureExplanation {
/** PascalCase failure class, e.g. `MissingPermission`, `Timeout`, `Unknown`. */
class: string;
- /** `Recoverable` | `BlockedByPolicy` | `NeedsUserConfirmation`. */
+ /** `Recoverable` | `BlockedByPolicy` | `NeedsUserConfirmation` | `UserDeclined` | `Permanent`. */
category: string;
/** Whether the core considers the failure automatically recoverable. */
recoverable: boolean;
diff --git a/crates/openhuman-core/src/agent/progress_tracing/journal_projection.rs b/crates/openhuman-core/src/agent/progress_tracing/journal_projection.rs
index f653ddd7ed..a07a779885 100644
--- a/crates/openhuman-core/src/agent/progress_tracing/journal_projection.rs
+++ b/crates/openhuman-core/src/agent/progress_tracing/journal_projection.rs
@@ -233,9 +233,9 @@ fn observation_to_progress(obs: &AgentObservation, state: &mut ReplayState) -> V
// short a whole tool span — a span *count* divergence, not just a
// missing attribute — on every turn the model named a tool it did
// not have. Mirrors `observability/event_projection.rs`'s `UnknownToolCall`
- // arm exactly, including the `Unknown` (recoverable) class.
+ // arm exactly, including the `NotFound` (permanent) class (#6277).
let failure = Some(crate::tools::status::describe(
- crate::tools::status::ToolFailureClass::Unknown,
+ crate::tools::status::ToolFailureClass::NotFound,
));
let label = format!(
"{} (unavailable)",
diff --git a/crates/openhuman-core/src/agent/tinyagents/host/tool_outcome_classifier.rs b/crates/openhuman-core/src/agent/tinyagents/host/tool_outcome_classifier.rs
index aee2e8d833..59436ec9cb 100644
--- a/crates/openhuman-core/src/agent/tinyagents/host/tool_outcome_classifier.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/host/tool_outcome_classifier.rs
@@ -161,7 +161,8 @@ impl OpenHumanToolOutcomeClassifier {
/// permissions, a missing app, and bad credentials need a human to act, so
/// an identical re-dispatch just burns an iteration; `BlockedByPolicy`,
/// `Denied`, and `ApprovalExpired` are refusals that auto-retrying would
- /// actively subvert (#4459); and `Unknown` is the case where OpenHuman has
+ /// actively subvert (#4459); `NotFound` and `Unsupported` fail identically
+ /// on every repeat (#6277); and `Unknown` is the case where OpenHuman has
/// no basis to promise a repeat is safe.
fn class_of(failure: ToolFailureClass, retry_safe: bool) -> OutcomeClass {
match failure {
@@ -178,6 +179,8 @@ impl OpenHumanToolOutcomeClassifier {
| ToolFailureClass::BlockedByPolicy
| ToolFailureClass::Denied
| ToolFailureClass::ApprovalExpired
+ | ToolFailureClass::NotFound
+ | ToolFailureClass::Unsupported
| ToolFailureClass::Unknown => OutcomeClass::PermanentFailure,
}
}
diff --git a/crates/openhuman-core/src/agent/tinyagents/host/tool_outcome_classifier_tests.rs b/crates/openhuman-core/src/agent/tinyagents/host/tool_outcome_classifier_tests.rs
index 0e8f93a1cb..c43afe112e 100644
--- a/crates/openhuman-core/src/agent/tinyagents/host/tool_outcome_classifier_tests.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/host/tool_outcome_classifier_tests.rs
@@ -130,6 +130,8 @@ fn no_failure_class_ever_maps_to_success() {
ToolFailureClass::BlockedByPolicy,
ToolFailureClass::Denied,
ToolFailureClass::ApprovalExpired,
+ ToolFailureClass::NotFound,
+ ToolFailureClass::Unsupported,
ToolFailureClass::Unknown,
] {
assert!(
diff --git a/crates/openhuman-core/src/agent/tinyagents/observability/event_projection.rs b/crates/openhuman-core/src/agent/tinyagents/observability/event_projection.rs
index 7d5bef62d2..ebf386ff3e 100644
--- a/crates/openhuman-core/src/agent/tinyagents/observability/event_projection.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/observability/event_projection.rs
@@ -304,11 +304,13 @@ impl EventListener for OpenhumanEventBridge {
// recovers the call without ever emitting Started/Completed for it,
// so nothing else in this bridge projects it. Two rows (start +
// failed-complete) keyed by the same call_id, mirroring a real
- // tool call. Classified `Unknown` (recoverable) — the model got the
- // "valid tools: [...]" corrective and can retry a real tool.
+ // tool call. Classified `NotFound` (permanent) from the typed
+ // event itself (#6277): the identical call can never succeed, so
+ // "try again / run diagnostics" copy would be wrong. The model
+ // still got the "valid tools: [...]" corrective.
let iteration = self.iteration();
let failure = Some(crate::tools::status::describe(
- crate::tools::status::ToolFailureClass::Unknown,
+ crate::tools::status::ToolFailureClass::NotFound,
));
let label = format!("{} (unavailable)", humanize_tool_name(requested_name));
match &self.scope {
diff --git a/crates/openhuman-core/src/agent/tinyagents/observability_tests.rs b/crates/openhuman-core/src/agent/tinyagents/observability_tests.rs
index dda17d48af..001000c176 100644
--- a/crates/openhuman-core/src/agent/tinyagents/observability_tests.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/observability_tests.rs
@@ -223,15 +223,34 @@ async fn unknown_tool_call_projects_attempted_name_as_failed_timeline_row() {
let mut started_name = None;
let mut completed: Option<(String, bool)> = None;
+ let mut failure = None;
while let Ok(p) = rx.try_recv() {
match p {
AgentProgress::ToolCallStarted { tool_name, .. } => started_name = Some(tool_name),
AgentProgress::ToolCallCompleted {
- tool_name, success, ..
- } => completed = Some((tool_name, success)),
+ tool_name,
+ success,
+ failure: f,
+ ..
+ } => {
+ completed = Some((tool_name, success));
+ failure = f;
+ }
_ => {}
}
}
+ // #6277: a tool the agent does not have fails identically on every retry,
+ // so the timeline must not tell the user to "try again / run diagnostics".
+ let failure = failure.expect("the failed row carries a classified failure");
+ assert_eq!(
+ failure.class,
+ crate::tools::status::ToolFailureClass::NotFound,
+ "an unavailable tool must be classified NotFound, not Unknown"
+ );
+ assert!(
+ !failure.recoverable,
+ "an unavailable tool is not recoverable by retrying"
+ );
assert_eq!(
started_name.as_deref(),
Some("search_files"),
diff --git a/crates/openhuman-core/src/skills/catalog/ops.rs b/crates/openhuman-core/src/skills/catalog/ops.rs
index 880a0aa887..c575a99fd7 100644
--- a/crates/openhuman-core/src/skills/catalog/ops.rs
+++ b/crates/openhuman-core/src/skills/catalog/ops.rs
@@ -366,7 +366,7 @@ pub async fn install_from_catalog(
"[skill_registry] installing from catalog"
);
- if entry.download_url.trim().is_empty() {
+ if !entry.has_direct_download() {
let where_to_find = entry
.source_url
.as_deref()
diff --git a/crates/openhuman-core/src/skills/catalog/tools.rs b/crates/openhuman-core/src/skills/catalog/tools.rs
index 35116fd3c4..499d919740 100644
--- a/crates/openhuman-core/src/skills/catalog/tools.rs
+++ b/crates/openhuman-core/src/skills/catalog/tools.rs
@@ -10,6 +10,7 @@ use async_trait::async_trait;
use serde_json::json;
use crate::config::Config;
+use crate::tools::status::{NOT_FOUND_MARKER, UNSUPPORTED_MARKER};
use crate::tools::traits::{PermissionLevel, Tool, ToolResult};
use super::ops;
@@ -191,7 +192,7 @@ impl Tool for SkillRegistryInstallTool {
let entry = catalog.iter().find(|e| e.id == entry_id).ok_or_else(|| {
anyhow::anyhow!(
- "skill '{entry_id}' not found in catalog. \
+ "{NOT_FOUND_MARKER} skill '{entry_id}' not found in catalog. \
Run skill_registry_browse first to refresh."
)
})?;
@@ -203,9 +204,18 @@ impl Tool for SkillRegistryInstallTool {
"stderr": outcome.stderr,
"new_skills": outcome.new_skills,
}))?)),
- Err(e) => Ok(ToolResult::error(format!(
- "Failed to install skill '{entry_id}': {e}"
- ))),
+ Err(e) => {
+ // Tagged from the entry, not sniffed from `e`: an entry with no
+ // direct download can never install, whatever the message says.
+ let tag = if entry.has_direct_download() {
+ String::new()
+ } else {
+ format!("{UNSUPPORTED_MARKER} ")
+ };
+ Ok(ToolResult::error(format!(
+ "{tag}Failed to install skill '{entry_id}': {e}"
+ )))
+ }
}
}
}
diff --git a/crates/openhuman-core/src/skills/catalog/types.rs b/crates/openhuman-core/src/skills/catalog/types.rs
index 7c3d6487d1..63610500e8 100644
--- a/crates/openhuman-core/src/skills/catalog/types.rs
+++ b/crates/openhuman-core/src/skills/catalog/types.rs
@@ -43,3 +43,11 @@ pub struct CatalogEntry {
/// Software license.
pub license: Option<String>,
}
+
+impl CatalogEntry {
+ /// Whether this entry has a `SKILL.md` that can be fetched directly. An
+ /// entry without one can never be installed automatically.
+ pub fn has_direct_download(&self) -> bool {
+ !self.download_url.trim().is_empty()
+ }
+}
diff --git a/crates/openhuman-core/src/tools/status/mod.rs b/crates/openhuman-core/src/tools/status/mod.rs
index 58908e8474..8a4d7072ef 100644
--- a/crates/openhuman-core/src/tools/status/mod.rs
+++ b/crates/openhuman-core/src/tools/status/mod.rs
@@ -17,4 +17,7 @@ mod ops;
mod types;
pub use ops::{classify, describe};
-pub use types::{ClassifiedFailure, FailureCategory, ToolFailureClass, ToolLifecycleState};
+pub use types::{
+ ClassifiedFailure, FailureCategory, ToolFailureClass, ToolLifecycleState, NOT_FOUND_MARKER,
+ UNSUPPORTED_MARKER,
+};
diff --git a/crates/openhuman-core/src/tools/status/ops.rs b/crates/openhuman-core/src/tools/status/ops.rs
index d015e9f9cf..8cecf61c00 100644
--- a/crates/openhuman-core/src/tools/status/ops.rs
+++ b/crates/openhuman-core/src/tools/status/ops.rs
@@ -58,6 +58,19 @@ fn classify_class(error_text: &str, timed_out: bool) -> ToolFailureClass {
tracing::debug!("[tool_status::classify] matched POLICY_DENIED_MARKER -> Denied");
return ToolFailureClass::Denied;
}
+ // `NOT_FOUND_MARKER` / `UNSUPPORTED_MARKER` — the producer knew the call
+ // named something that is not there, or asked for something the target
+ // can never do (#6277). Ahead of every heuristic for the same reason as
+ // the policy markers: a catalog entry id or a skill description can
+ // contain any of the words sniffed below.
+ if text.contains(super::types::NOT_FOUND_MARKER) {
+ tracing::debug!("[tool_status::classify] matched NOT_FOUND_MARKER -> NotFound");
+ return ToolFailureClass::NotFound;
+ }
+ if text.contains(super::types::UNSUPPORTED_MARKER) {
+ tracing::debug!("[tool_status::classify] matched UNSUPPORTED_MARKER -> Unsupported");
+ return ToolFailureClass::Unsupported;
+ }
// 1. Timeout — the executor's explicit signal wins over any text sniffing.
if timed_out || contains_any(&text, &["timed out", "timeout", "deadline exceeded"]) {
@@ -235,6 +248,14 @@ pub fn describe(class: ToolFailureClass) -> ClassifiedFailure {
"The approval request expired before anyone responded.",
"Ask again to run it — OpenHuman won't retry it on its own.",
),
+ ToolFailureClass::NotFound => (
+ "What this action asked for doesn't exist or isn't available here.",
+ "No action needed. The assistant can look up the right name and try again.",
+ ),
+ ToolFailureClass::Unsupported => (
+ "OpenHuman can't do this automatically yet.",
+ "Do it manually, or ask for a different option.",
+ ),
ToolFailureClass::Unknown => (
"Something went wrong with this action.",
"Try again; if it keeps failing, run diagnostics from Settings.",
diff --git a/crates/openhuman-core/src/tools/status/ops_tests.rs b/crates/openhuman-core/src/tools/status/ops_tests.rs
index 52f0943b64..f8ef4a75b6 100644
--- a/crates/openhuman-core/src/tools/status/ops_tests.rs
+++ b/crates/openhuman-core/src/tools/status/ops_tests.rs
@@ -193,6 +193,8 @@ fn every_class_produces_nonempty_user_copy() {
ToolFailureClass::Timeout,
ToolFailureClass::Denied,
ToolFailureClass::ApprovalExpired,
+ ToolFailureClass::NotFound,
+ ToolFailureClass::Unsupported,
ToolFailureClass::Unknown,
] {
let f = describe(class);
@@ -202,6 +204,27 @@ fn every_class_produces_nonempty_user_copy() {
}
}
+// #6277: failures whose producer knows they cannot succeed on retry are
+// classified from its marker, ahead of any word the message happens to contain.
+#[test]
+fn marked_permanent_failures_are_not_recoverable() {
+ use crate::tools::status::{NOT_FOUND_MARKER, UNSUPPORTED_MARKER};
+
+ let not_found = classify(
+ &format!("Error executing use_skill: {NOT_FOUND_MARKER} skill 'timeout-helper' not found"),
+ false,
+ );
+ assert_eq!(not_found.class, ToolFailureClass::NotFound);
+ assert!(!not_found.recoverable);
+
+ let unsupported = classify(
+ &format!("{UNSUPPORTED_MARKER} Failed to install skill 'x': hosted on skills.sh"),
+ false,
+ );
+ assert_eq!(unsupported.class, ToolFailureClass::Unsupported);
+ assert!(!unsupported.recoverable);
+}
+
#[test]
fn recoverable_flag_matches_category() {
assert!(classify("503 service unavailable", false).recoverable);
diff --git a/crates/openhuman-core/src/tools/status/types.rs b/crates/openhuman-core/src/tools/status/types.rs
index 8bf1dabd70..4a34a45420 100644
--- a/crates/openhuman-core/src/tools/status/types.rs
+++ b/crates/openhuman-core/src/tools/status/types.rs
@@ -64,10 +64,28 @@ pub enum ToolFailureClass {
/// nobody approved, so it must not read as an execution timeout that
/// auto-retries (#4459).
ApprovalExpired,
+ /// What the call named does not exist or is not available to this agent: a
+ /// tool it does not have, a catalog entry that is not there. The identical
+ /// call fails the same way every time (#6277).
+ NotFound,
+ /// The operation is not supported for this target, permanently: e.g. a
+ /// catalog skill with no direct download cannot be installed automatically
+ /// (#6277).
+ Unsupported,
/// Could not be classified into any of the above.
Unknown,
}
+/// Marker prefixing a failure whose target does not exist or is not available
+/// ([`ToolFailureClass::NotFound`]). Emitted by the producer that *knows* the
+/// lookup failed, so the classifier never has to guess from prose. Bracketed
+/// like the policy markers so it survives the `Error executing …` wrapping.
+pub const NOT_FOUND_MARKER: &str = "[not-found]";
+
+/// Marker prefixing a failure the target can never support
+/// ([`ToolFailureClass::Unsupported`]). Same contract as [`NOT_FOUND_MARKER`].
+pub const UNSUPPORTED_MARKER: &str = "[unsupported]";
+
/// The three top-level states the UI separates, per the #4254 acceptance
/// criterion "clear separation between recoverable failure, blocked-by-policy,
/// and action-needs-user-confirmation states".
@@ -86,6 +104,10 @@ pub enum FailureCategory {
/// refused external effect is exactly the bug this category prevents
/// (#4459).
UserDeclined,
+ /// The identical call cannot succeed: what it named does not exist, or the
+ /// operation is not supported. Never retried automatically, and there is
+ /// nothing for the user to approve, grant or sign in to (#6277).
+ Permanent,
}
/// A tool failure rendered for a non-technical user: what class it is, which
@@ -132,6 +154,9 @@ impl ToolFailureClass {
ToolFailureClass::MissingPermission
| ToolFailureClass::MissingApp
| ToolFailureClass::BadCredentials => FailureCategory::NeedsUserConfirmation,
+ ToolFailureClass::NotFound | ToolFailureClass::Unsupported => {
+ FailureCategory::Permanent
+ }
}
}
}
diff --git a/crates/openhuman-core/src/tools/status/types_tests.rs b/crates/openhuman-core/src/tools/status/types_tests.rs
index 2adbe97da6..60bc32cbbe 100644
--- a/crates/openhuman-core/src/tools/status/types_tests.rs
+++ b/crates/openhuman-core/src/tools/status/types_tests.rs
@@ -6,6 +6,7 @@ fn recoverable_iff_recoverable_category() {
assert!(!FailureCategory::BlockedByPolicy.is_recoverable());
assert!(!FailureCategory::NeedsUserConfirmation.is_recoverable());
assert!(!FailureCategory::UserDeclined.is_recoverable());
+ assert!(!FailureCategory::Permanent.is_recoverable());
}
#[test]
@@ -25,6 +26,8 @@ fn every_class_maps_to_expected_category() {
assert_eq!(BadCredentials.category(), NeedsUserConfirmation);
assert_eq!(Denied.category(), UserDeclined);
assert_eq!(ApprovalExpired.category(), UserDeclined);
+ assert_eq!(NotFound.category(), Permanent);
+ assert_eq!(Unsupported.category(), Permanent);
}
#[test]
diff --git a/crates/openhuman-core/src/tools/toolpacks/tools.rs b/crates/openhuman-core/src/tools/toolpacks/tools.rs
index 259c1309d6..3db8564623 100644
--- a/crates/openhuman-core/src/tools/toolpacks/tools.rs
+++ b/crates/openhuman-core/src/tools/toolpacks/tools.rs
@@ -151,7 +151,8 @@ pub fn render_pack_filtered(
// Scoped too: offering a hallucinating model a pack it cannot use is the
// same wrong turn the advertised index used to take, one error later.
return Err(format!(
- "Unknown skill `{skill}`. Available:\n{}",
+ "{} Unknown skill `{skill}`. Available:\n{}",
+ crate::tools::status::NOT_FOUND_MARKER,
registry::pack_index_markdown_filtered(is_callable)
));
};
@@ -419,8 +420,9 @@ impl Tool for UseSkillTool {
let Some((tools, idx)) = self.handle.resolve(skill, name) else {
return Ok(ToolResult::error(format!(
- "No tool `{name}` in skill `{skill}`. Call `use_skill {{ \"skill\": \"{skill}\" }}` \
+ "{} No tool `{name}` in skill `{skill}`. Call `use_skill {{ \"skill\": \"{skill}\" }}` \
to see what it contains.\n\nSkills:\n{}",
+ crate::tools::status::NOT_FOUND_MARKER,
registry::pack_index_markdown()
)));
};