Skip to content

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

test(components): modules.list Disabled E2E and disabled module status in the Computer card

Steven Enamakel5d78c0f981c3
diff --git a/app/src/components/settings/panels/ComputerStatusCard.test.tsx b/app/src/components/settings/panels/ComputerStatusCard.test.tsx
index e7be47241b..f509228f36 100644
--- a/app/src/components/settings/panels/ComputerStatusCard.test.tsx
+++ b/app/src/components/settings/panels/ComputerStatusCard.test.tsx
@@ -36,6 +36,15 @@ describe('ComputerStatusCard', () => {
);
});
+ it('shows a module switched off by [components] as disabled', async () => {
+ mocks.rpc.mockResolvedValueOnce({
+ ...base,
+ module: { ...base.module, state: 'disabled', detail: 'Switched off by [components]' },
+ });
+ renderWithProviders(<ComputerStatusCard />);
+ expect(await screen.findByText('computer.status.state.disabled')).toBeInTheDocument();
+ });
+
it('checks the module and shows what it reports', async () => {
renderWithProviders(<ComputerStatusCard />);
await screen.findByText('computer.status.state.available');
diff --git a/app/src/components/settings/panels/ComputerStatusCard.tsx b/app/src/components/settings/panels/ComputerStatusCard.tsx
index d8f493cd41..f449714c7d 100644
--- a/app/src/components/settings/panels/ComputerStatusCard.tsx
+++ b/app/src/components/settings/panels/ComputerStatusCard.tsx
@@ -14,7 +14,7 @@ import Badge from '../../ui/Badge';
import Button from '../../ui/Button';
import Card from '../../ui/Card';
-type ModuleState = 'available' | 'loading' | 'ready' | 'failed' | 'unsupported';
+type ModuleState = 'available' | 'loading' | 'ready' | 'failed' | 'unsupported' | 'disabled';
type Route = 'hosted' | 'direct_openrouter' | 'open_jev' | 'sage' | 'unavailable';
export interface ComputerStatus {
@@ -38,7 +38,9 @@ const stateVariant = (state?: ModuleState) =>
? ('success' as const)
: state === 'failed' || state === 'unsupported'
? ('danger' as const)
- : ('neutral' as const);
+ : state === 'disabled'
+ ? ('warning' as const)
+ : ('neutral' as const);
export default function ComputerStatusCard({ refreshKey = 0 }: { refreshKey?: number } = {}) {
const { t } = useT();
diff --git a/app/src/lib/i18n/ar.ts b/app/src/lib/i18n/ar.ts
index cb2c1fa2bb..c27cb01880 100644
--- a/app/src/lib/i18n/ar.ts
+++ b/app/src/lib/i18n/ar.ts
@@ -4365,6 +4365,7 @@ const messages: TranslationMap = {
'computer.status.state.ready': 'جاهزة',
'computer.status.state.failed': 'فشلت',
'computer.status.state.unsupported': 'غير مدعومة على هذا الجهاز',
+ 'computer.status.state.disabled': 'معطّلة في الإعدادات',
'desktop.permission.accessibility': 'إمكانية الوصول',
'desktop.permission.screen_recording': 'تسجيل الشاشة',
'channels.status.configuring': 'جارٍ الضبط',
diff --git a/app/src/lib/i18n/bn.ts b/app/src/lib/i18n/bn.ts
index 4f7578930f..42de9b1b47 100644
--- a/app/src/lib/i18n/bn.ts
+++ b/app/src/lib/i18n/bn.ts
@@ -4458,6 +4458,7 @@ const messages: TranslationMap = {
'computer.status.state.ready': 'প্রস্তুত',
'computer.status.state.failed': 'ব্যর্থ',
'computer.status.state.unsupported': 'এই ডিভাইসে সমর্থিত নয়',
+ 'computer.status.state.disabled': 'কনফিগারেশনে বন্ধ করা আছে',
'desktop.permission.accessibility': 'অ্যাক্সেসিবিলিটি',
'desktop.permission.screen_recording': 'স্ক্রিন রেকর্ডিং',
'channels.status.configuring': 'কনফিগার হচ্ছে',
diff --git a/app/src/lib/i18n/de.ts b/app/src/lib/i18n/de.ts
index 6b7cbd6143..5f7eb1439e 100644
--- a/app/src/lib/i18n/de.ts
+++ b/app/src/lib/i18n/de.ts
@@ -4605,6 +4605,7 @@ const messages: TranslationMap = {
'computer.status.state.ready': 'Bereit',
'computer.status.state.failed': 'Fehlgeschlagen',
'computer.status.state.unsupported': 'Auf diesem Gerät nicht unterstützt',
+ 'computer.status.state.disabled': 'In der Konfiguration deaktiviert',
'desktop.permission.accessibility': 'Bedienungshilfen',
'desktop.permission.screen_recording': 'Bildschirmaufnahme',
'channels.status.configuring': 'Konfigurieren',
diff --git a/app/src/lib/i18n/en.ts b/app/src/lib/i18n/en.ts
index 06e4697023..b6267a6a05 100644
--- a/app/src/lib/i18n/en.ts
+++ b/app/src/lib/i18n/en.ts
@@ -4699,6 +4699,7 @@ const en: TranslationMap = {
'computer.status.state.ready': 'Ready',
'computer.status.state.failed': 'Failed',
'computer.status.state.unsupported': 'Unsupported on this device',
+ 'computer.status.state.disabled': 'Switched off in settings',
'desktop.permission.accessibility': 'Accessibility',
'desktop.permission.screen_recording': 'Screen Recording',
'channels.status.configuring': 'Configuring',
diff --git a/app/src/lib/i18n/es.ts b/app/src/lib/i18n/es.ts
index efee757df7..353e8103d4 100644
--- a/app/src/lib/i18n/es.ts
+++ b/app/src/lib/i18n/es.ts
@@ -4554,6 +4554,7 @@ const messages: TranslationMap = {
'computer.status.state.ready': 'Listo',
'computer.status.state.failed': 'Error',
'computer.status.state.unsupported': 'No compatible con este dispositivo',
+ 'computer.status.state.disabled': 'Desactivado en la configuración',
'desktop.permission.accessibility': 'Accesibilidad',
'desktop.permission.screen_recording': 'Grabación de pantalla',
'channels.status.configuring': 'Configurando',
diff --git a/app/src/lib/i18n/fr.ts b/app/src/lib/i18n/fr.ts
index d54b90fd62..5d28e0765a 100644
--- a/app/src/lib/i18n/fr.ts
+++ b/app/src/lib/i18n/fr.ts
@@ -4580,6 +4580,7 @@ const messages: TranslationMap = {
'computer.status.state.ready': 'Prêt',
'computer.status.state.failed': 'Échec',
'computer.status.state.unsupported': 'Non pris en charge sur cet appareil',
+ 'computer.status.state.disabled': 'Désactivé dans la configuration',
'desktop.permission.accessibility': 'Accessibilité',
'desktop.permission.screen_recording': 'Enregistrement de l’écran',
'channels.status.configuring': 'Configuration en cours',
diff --git a/app/src/lib/i18n/hi.ts b/app/src/lib/i18n/hi.ts
index c5422a08a2..391c1f03b9 100644
--- a/app/src/lib/i18n/hi.ts
+++ b/app/src/lib/i18n/hi.ts
@@ -4504,6 +4504,7 @@ const messages: TranslationMap = {
'computer.status.state.ready': 'तैयार',
'computer.status.state.failed': 'विफल',
'computer.status.state.unsupported': 'इस डिवाइस पर समर्थित नहीं',
+ 'computer.status.state.disabled': 'कॉन्फ़िगरेशन में बंद',
'desktop.permission.accessibility': 'एक्सेसिबिलिटी',
'desktop.permission.screen_recording': 'स्क्रीन रिकॉर्डिंग',
'channels.status.configuring': 'कॉन्फिगर हो रहा है',
diff --git a/app/src/lib/i18n/id.ts b/app/src/lib/i18n/id.ts
index 02d3d3e7ff..08fee49e9b 100644
--- a/app/src/lib/i18n/id.ts
+++ b/app/src/lib/i18n/id.ts
@@ -4500,6 +4500,7 @@ const messages: TranslationMap = {
'computer.status.state.ready': 'Siap',
'computer.status.state.failed': 'Gagal',
'computer.status.state.unsupported': 'Tidak didukung di perangkat ini',
+ 'computer.status.state.disabled': 'Dinonaktifkan di konfigurasi',
'desktop.permission.accessibility': 'Aksesibilitas',
'desktop.permission.screen_recording': 'Perekaman layar',
'channels.status.configuring': 'Mengonfigurasi',
diff --git a/app/src/lib/i18n/it.ts b/app/src/lib/i18n/it.ts
index 6265af75f8..54373ad8a3 100644
--- a/app/src/lib/i18n/it.ts
+++ b/app/src/lib/i18n/it.ts
@@ -4579,6 +4579,7 @@ const messages: TranslationMap = {
'computer.status.state.ready': 'Pronto',
'computer.status.state.failed': 'Non riuscito',
'computer.status.state.unsupported': 'Non supportato su questo dispositivo',
+ 'computer.status.state.disabled': 'Disattivato nella configurazione',
'desktop.permission.accessibility': 'Accessibilità',
'desktop.permission.screen_recording': 'Registrazione schermo',
'channels.status.configuring': 'Configurazione',
diff --git a/app/src/lib/i18n/ja.ts b/app/src/lib/i18n/ja.ts
index 71fea112de..4646890e9d 100644
--- a/app/src/lib/i18n/ja.ts
+++ b/app/src/lib/i18n/ja.ts
@@ -4771,6 +4771,7 @@ const messages: TranslationMap = {
'computer.status.state.ready': '準備完了',
'computer.status.state.failed': '失敗',
'computer.status.state.unsupported': 'このデバイスではサポートされていません',
+ 'computer.status.state.disabled': '設定でオフになっています',
'desktop.permission.accessibility': 'アクセシビリティ',
'desktop.permission.screen_recording': '画面収録',
'channels.status.configuring': '設定中',
diff --git a/app/src/lib/i18n/ko.ts b/app/src/lib/i18n/ko.ts
index 4242e37efe..56e9d0dca6 100644
--- a/app/src/lib/i18n/ko.ts
+++ b/app/src/lib/i18n/ko.ts
@@ -4406,6 +4406,7 @@ const messages: TranslationMap = {
'computer.status.state.ready': '준비됨',
'computer.status.state.failed': '실패',
'computer.status.state.unsupported': '이 기기에서 지원되지 않음',
+ 'computer.status.state.disabled': '설정에서 꺼짐',
'desktop.permission.accessibility': '손쉬운 사용',
'desktop.permission.screen_recording': '화면 기록',
'channels.status.configuring': '구성 중',
diff --git a/app/src/lib/i18n/pl.ts b/app/src/lib/i18n/pl.ts
index d0d6559a54..2e6c054512 100644
--- a/app/src/lib/i18n/pl.ts
+++ b/app/src/lib/i18n/pl.ts
@@ -4523,6 +4523,7 @@ const messages: TranslationMap = {
'computer.status.state.ready': 'Gotowy',
'computer.status.state.failed': 'Błąd',
'computer.status.state.unsupported': 'Nieobsługiwane na tym urządzeniu',
+ 'computer.status.state.disabled': 'Wyłączony w konfiguracji',
'desktop.permission.accessibility': 'Dostępność',
'desktop.permission.screen_recording': 'Nagrywanie ekranu',
'channels.status.configuring': 'Konfigurowanie',
diff --git a/app/src/lib/i18n/pt.ts b/app/src/lib/i18n/pt.ts
index cead94a1b4..27e7e93ad2 100644
--- a/app/src/lib/i18n/pt.ts
+++ b/app/src/lib/i18n/pt.ts
@@ -4528,6 +4528,7 @@ const messages: TranslationMap = {
'computer.status.state.ready': 'Pronto',
'computer.status.state.failed': 'Falhou',
'computer.status.state.unsupported': 'Não compatível com este dispositivo',
+ 'computer.status.state.disabled': 'Desativado na configuração',
'desktop.permission.accessibility': 'Acessibilidade',
'desktop.permission.screen_recording': 'Gravação de tela',
'channels.status.configuring': 'Configurando',
diff --git a/app/src/lib/i18n/ru.ts b/app/src/lib/i18n/ru.ts
index d265d3cc40..efd53ac951 100644
--- a/app/src/lib/i18n/ru.ts
+++ b/app/src/lib/i18n/ru.ts
@@ -4511,6 +4511,7 @@ const messages: TranslationMap = {
'computer.status.state.ready': 'Готов',
'computer.status.state.failed': 'Ошибка',
'computer.status.state.unsupported': 'Не поддерживается на этом устройстве',
+ 'computer.status.state.disabled': 'Отключён в конфигурации',
'desktop.permission.accessibility': 'Универсальный доступ',
'desktop.permission.screen_recording': 'Запись экрана',
'channels.status.configuring': 'Настройка',
diff --git a/app/src/lib/i18n/tr.ts b/app/src/lib/i18n/tr.ts
index ff328c5b7a..a1268f0972 100644
--- a/app/src/lib/i18n/tr.ts
+++ b/app/src/lib/i18n/tr.ts
@@ -4466,6 +4466,7 @@ const messages: TranslationMap = {
'computer.status.state.ready': 'Hazır',
'computer.status.state.failed': 'Başarısız',
'computer.status.state.unsupported': 'Bu cihazda desteklenmiyor',
+ 'computer.status.state.disabled': 'Yapılandırmada kapatıldı',
'desktop.permission.accessibility': 'Erişilebilirlik',
'desktop.permission.screen_recording': 'Ekran Kaydı',
'channels.status.configuring': 'Yapılandırılıyor',
diff --git a/app/src/lib/i18n/zh-CN.ts b/app/src/lib/i18n/zh-CN.ts
index f31642f64b..0d38b56d90 100644
--- a/app/src/lib/i18n/zh-CN.ts
+++ b/app/src/lib/i18n/zh-CN.ts
@@ -4195,6 +4195,7 @@ const messages: TranslationMap = {
'computer.status.state.ready': '就绪',
'computer.status.state.failed': '失败',
'computer.status.state.unsupported': '此设备不支持',
+ 'computer.status.state.disabled': '已在配置中关闭',
'desktop.permission.accessibility': '辅助功能',
'desktop.permission.screen_recording': '屏幕录制',
'channels.status.configuring': '配置中',
diff --git a/crates/openhuman-core/src/platform/about_app/ops_tests.rs b/crates/openhuman-core/src/platform/about_app/ops_tests.rs
index fb7e5ad911..2b9b6f06d0 100644
--- a/crates/openhuman-core/src/platform/about_app/ops_tests.rs
+++ b/crates/openhuman-core/src/platform/about_app/ops_tests.rs
@@ -33,3 +33,13 @@ fn domain_mapping_names_real_components() {
}
}
}
+
+#[test]
+fn every_mapped_domain_shows_disabled_when_its_component_is_off() {
+ for cap in super::super::all_capabilities() {
+ if let Some(name) = component_for_domain(cap.domain) {
+ let marked = apply_components(*cap, &off(name));
+ assert_eq!(marked.status, CapabilityStatus::Disabled, "{}", cap.id);
+ }
+ }
+}
diff --git a/tests/components_e2e.rs b/tests/components_e2e.rs
index 893225ed8e..fade89593d 100644
--- a/tests/components_e2e.rs
+++ b/tests/components_e2e.rs
@@ -83,6 +83,27 @@ fn disabled_component_answers_component_disabled_over_json_rpc() {
Some("mcp")
);
+ // `modules.list` reports the same module as Disabled, and only it.
+ let listed = rpc(&base, "openhuman.modules_list").await;
+ let modules = listed
+ .pointer("/result/modules")
+ .or_else(|| listed.pointer("/result/result/modules"))
+ .and_then(Value::as_array)
+ .unwrap_or_else(|| panic!("want modules array: {listed}"));
+ let state_of = |id: &str| {
+ modules
+ .iter()
+ .find(|m| m.get("id").and_then(Value::as_str) == Some(id))
+ .and_then(|m| m.get("state").and_then(Value::as_str))
+ .map(str::to_owned)
+ };
+ assert_eq!(state_of("tinymcp").as_deref(), Some("disabled"), "{listed}");
+ assert_ne!(
+ state_of("tinydocs").as_deref(),
+ Some("disabled"),
+ "{listed}"
+ );
+
// A component left on is untouched.
let on = rpc(&base, "openhuman.config_get").await;
let msg = on