The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
fix: a chat whose working folder is gone says so instead of "model request failed"
Teknium2c27f97cb56b
diff --git a/agent/error_surface.py b/agent/error_surface.pyindex 6f9d16d6206..2096ed6d9b6 100644--- a/agent/error_surface.py+++ b/agent/error_surface.py@@ -37,7 +37,7 @@ LAYER_DISK = "disk"_REASON_TO_LAYER = {"auth": LAYER_AUTH, "auth_permanent": LAYER_AUTH, "billing": LAYER_BILLING, "billing_unverified": LAYER_BILLING,"loop_error": LAYER_GATEWAY, "interpreter_shutdown": LAYER_GATEWAY, "session_busy": LAYER_GATEWAY,- "gateway_connection": LAYER_GATEWAY, "host_error": LAYER_GATEWAY,+ "gateway_connection": LAYER_GATEWAY, "host_error": LAYER_GATEWAY, "workspace_unavailable": LAYER_GATEWAY,"truncated": LAYER_PROVIDER, "empty_response": LAYER_PROVIDER, "invalid_response": LAYER_PROVIDER,"context_overflow": LAYER_PROVIDER, # a bigger-window model IS the fix, so Switch provider applies}diff --git a/apps/desktop/src/i18n/ar_assistant.ts b/apps/desktop/src/i18n/ar_assistant.tsindex 08899b17d10..7576eaab83e 100644--- a/apps/desktop/src/i18n/ar_assistant.ts+++ b/apps/desktop/src/i18n/ar_assistant.ts@@ -60,6 +60,10 @@ export const arAssistant = {cron_session_read_only: {title: 'هذه المحادثة تابعة لمهمة مجدولة',body: 'إنها تشغّل تلك المهمة فقط، لذا لم تُنفَّذ رسالتك. ابدأ محادثة جديدة لإرسالها.'+ },+ workspace_unavailable: {+ title: 'مجلد هذه المحادثة غير موجود',+ body: 'نُقل المجلد الذي تعمل فيه هذه المحادثة أو حُذف، لذا لم تُنفَّذ رسالتك. أعد إنشاء المجلد، أو استخدم «Move to project» لتعيين مجلد آخر للمحادثة، ثم أعد المحاولة.'}},errorRetry: 'إعادة المحاولة',diff --git a/apps/desktop/src/i18n/de.ts b/apps/desktop/src/i18n/de.tsindex e0e68eb8e79..5292f2001c4 100644--- a/apps/desktop/src/i18n/de.ts+++ b/apps/desktop/src/i18n/de.ts@@ -4,6 +4,7 @@ import { deBoot } from './de_boot'import { deClarify } from './de_clarify'import { deConnectorAccounts } from './de_connector_accounts'import { deConnectorCard } from './de_connector_card'+import { deErrorLayers } from './de_error_layers'import { deFirstRun } from './de_first_run'import { deLocalModels } from './de_local_models'import { deModelMenu } from './de_model_menu'@@ -4875,35 +4876,7 @@ export const deOverrides = {react: 'Reagieren',dismissError: 'Fehler schließen',responseStopped: 'Antwort gestoppt',- errorLayers: {- auth: 'Authentifizierungsfehler',- billing: 'Keine Credits mehr',- disk: 'Festplatte voll',- endpoint: 'Benutzerdefinierter Endpunktfehler',- gateway: 'Gateway-Fehler',- generic: 'Turn fehlgeschlagen',- provider: 'Anbieterfehler',- runtime: 'Lokaler Laufzeitfehler',- streaming: 'Streaming-Verbindungsfehler'- },- errorLayerBodies: {- auth: 'Der KI-Dienst hat Ihre Anmeldung abgelehnt. Prüfen Sie die Zugangsdaten für diesen Anbieter und senden Sie Ihre Nachricht erneut.',- billing:- 'Ihr Konto hat bei diesem Anbieter kein Guthaben mehr. Laden Sie Guthaben auf oder wechseln Sie den Anbieter und senden Sie erneut.',- disk: 'Ihre Festplatte ist voll, daher konnte Hermes dieses Gespräch nicht speichern. Geben Sie Speicherplatz frei und versuchen Sie es erneut.',- endpoint:- 'Hermes erreicht Ihren eigenen Modellserver nicht. Prüfen Sie, ob er läuft, und senden Sie Ihre Nachricht erneut.',- gateway:- 'Beim Starten dieser Antwort ist in Hermes ein internes Problem aufgetreten. Senden Sie Ihre Nachricht erneut; wenn es bestehen bleibt, senden Sie Diagnosedaten.',- generic:- 'Beim Antworten ist etwas schiefgelaufen. Versuchen Sie es erneut oder kopieren Sie die Details, wenn es bestehen bleibt.',- provider:- 'Der KI-Dienst konnte diese Anfrage nicht abschließen. Versuchen Sie es gleich erneut oder wechseln Sie den Anbieter.',- runtime:- 'Beim Starten dieser Antwort ist in Hermes ein internes Problem aufgetreten. Senden Sie Ihre Nachricht erneut; wenn es bestehen bleibt, senden Sie Diagnosedaten.',- streaming:- 'Die Verbindung ist abgebrochen, bevor die Antwort fertig war. Versuchen Sie es erneut, um sie noch einmal zu senden.'- },+ ...deErrorLayers,errorCodes: {auth: {title: provider => `${provider} hat Ihre Anmeldung abgelehnt`,@@ -5012,6 +4985,10 @@ export const deOverrides = {title: 'Dieser Chat gehört zu einer geplanten Aufgabe',body: 'Er führt nur diese Aufgabe aus, daher wurde Ihre Nachricht nicht ausgeführt. Starten Sie einen neuen Chat, um sie zu senden.'},+ workspace_unavailable: {+ title: 'Der Ordner dieses Chats fehlt',+ body: 'Der Ordner, in dem dieser Chat arbeitet, wurde verschoben oder gelöscht, daher wurde Ihre Nachricht nicht ausgeführt. Legen Sie den Ordner neu an oder geben Sie dem Chat mit „In Projekt verschieben“ einen anderen, und versuchen Sie es dann erneut.'+ },SESSION_NOT_OWNED: {title: 'Dieser Chat ist woanders offen',body: 'Dieser Chat ist gerade in einem anderen Hermes-Fenster oder Terminal geöffnet. Schließen Sie ihn dort und senden Sie Ihre Nachricht erneut, oder starten Sie hier einen neuen Chat.'diff --git a/apps/desktop/src/i18n/de_error_layers.ts b/apps/desktop/src/i18n/de_error_layers.tsnew file mode 100644index 00000000000..689e92d067d--- /dev/null+++ b/apps/desktop/src/i18n/de_error_layers.ts@@ -0,0 +1,36 @@+import type { Translations } from './types'++type ThreadCopy = Translations['assistant']['thread']++// The error card's layer fallbacks (lib/error-surface-copy.ts): used when a failure code has no own entry.+export const deErrorLayers: Pick<ThreadCopy, 'errorLayerBodies' | 'errorLayers'> = {+ errorLayers: {+ auth: 'Authentifizierungsfehler',+ billing: 'Keine Credits mehr',+ disk: 'Festplatte voll',+ endpoint: 'Benutzerdefinierter Endpunktfehler',+ gateway: 'Gateway-Fehler',+ generic: 'Turn fehlgeschlagen',+ provider: 'Anbieterfehler',+ runtime: 'Lokaler Laufzeitfehler',+ streaming: 'Streaming-Verbindungsfehler'+ },+ errorLayerBodies: {+ auth: 'Der KI-Dienst hat Ihre Anmeldung abgelehnt. Prüfen Sie die Zugangsdaten für diesen Anbieter und senden Sie Ihre Nachricht erneut.',+ billing:+ 'Ihr Konto hat bei diesem Anbieter kein Guthaben mehr. Laden Sie Guthaben auf oder wechseln Sie den Anbieter und senden Sie erneut.',+ disk: 'Ihre Festplatte ist voll, daher konnte Hermes dieses Gespräch nicht speichern. Geben Sie Speicherplatz frei und versuchen Sie es erneut.',+ endpoint:+ 'Hermes erreicht Ihren eigenen Modellserver nicht. Prüfen Sie, ob er läuft, und senden Sie Ihre Nachricht erneut.',+ gateway:+ 'Beim Starten dieser Antwort ist in Hermes ein internes Problem aufgetreten. Senden Sie Ihre Nachricht erneut; wenn es bestehen bleibt, senden Sie Diagnosedaten.',+ generic:+ 'Beim Antworten ist etwas schiefgelaufen. Versuchen Sie es erneut oder kopieren Sie die Details, wenn es bestehen bleibt.',+ provider:+ 'Der KI-Dienst konnte diese Anfrage nicht abschließen. Versuchen Sie es gleich erneut oder wechseln Sie den Anbieter.',+ runtime:+ 'Beim Starten dieser Antwort ist in Hermes ein internes Problem aufgetreten. Senden Sie Ihre Nachricht erneut; wenn es bestehen bleibt, senden Sie Diagnosedaten.',+ streaming:+ 'Die Verbindung ist abgebrochen, bevor die Antwort fertig war. Versuchen Sie es erneut, um sie noch einmal zu senden.'+ }+}diff --git a/apps/desktop/src/i18n/en.ts b/apps/desktop/src/i18n/en.tsindex 74f7c4f039c..dbd69480776 100644--- a/apps/desktop/src/i18n/en.ts+++ b/apps/desktop/src/i18n/en.ts@@ -9,6 +9,7 @@ import { enClarify } from './en_clarify'import { enConnectorAccounts } from './en_connector_accounts'import { enConnectorCard } from './en_connector_card'import { enGatewayGroupOpen, enSkillDeepLink } from './en_deep_links'+import { enErrorCodes } from './en_error_codes'import { enErrorLayers } from './en_error_layers'import { enExternalOpenFailed } from './en_external_open'import { enFirstRun } from './en_first_run'@@ -4459,154 +4460,7 @@ export const en: Translations = {dismissError: 'Dismiss error',responseStopped: 'Response stopped',...enErrorLayers,- errorCodes: {- auth: {- title: provider => `${provider} rejected your sign-in`,- body: provider =>- `The credentials saved for ${provider} were not accepted. Fix them in Settings or switch provider, then send your message again.`- },- auth_permanent: {- title: provider => `${provider} rejected your sign-in`,- body: provider =>- `The credentials saved for ${provider} are invalid or were revoked. Update them or switch provider, then send your message again.`- },- billing: {- title: 'Out of credits',- body: provider => `Your ${provider} account has no credits left. Top up or switch provider, then send again.`- },- rate_limit: {- title: 'The AI service is busy',- body: provider => `${provider} is limiting requests right now. Wait a minute, then retry.`- },- upstream_rate_limit: {- title: 'The AI service is busy',- body: provider => `${provider} is limiting requests right now. Wait a minute, then retry.`- },- overloaded: {- title: 'The AI service is overloaded',- body: provider => `${provider} is having problems right now. Retry in a moment or switch provider.`- },- server_error: {- title: 'The AI service had a problem',- body: provider => `${provider} returned a server error. Retry in a moment or switch provider.`- },- timeout: {- title: 'Could not reach the AI service',- body: provider =>- `${provider} could not be reached or did not answer in time. Check your internet connection, then retry.`- },- stream_drop: {- title: 'The reply was cut off',- body: 'The connection dropped before the reply finished. Retry to send it again.'- },- no_reply: {- title: "The reply didn't finish",- body: 'Hermes ended this turn without a reply. Retry to send it again.'- },- upstream_blocked: {- title: 'A firewall blocked the request',- body: provider =>- `A firewall or CDN in front of ${provider} blocked the request before it reached the model — your key is probably fine. Set a User-Agent header via the provider's extra_headers in Settings, or switch provider, then send your message again.`- },- ssl_cert_verification: {- title: 'Secure connection failed',- body: provider =>- `Hermes could not verify the secure connection to ${provider}. Check your network or proxy settings, or switch provider, then send your message again.`- },- context_overflow: {- title: 'This conversation is too long',- body: 'The conversation no longer fits the model. Compress it or start a new chat, then send again.'- },- payload_too_large: {- title: 'This message is too large',- body: 'The request was too big for the model. Compress the conversation or start a new chat, then send again.'- },- model_not_found: {- title: 'This model is not available',- body: provider =>- `${provider} does not offer this model on your account. Choose another model, then send your message again.`- },- provider_policy_blocked: {- title: 'This model is blocked by your account settings',- body: provider =>- `${provider} would not route this request under your account's data or privacy settings. Choose another model or switch provider.`- },- content_policy_blocked: {- title: 'The AI service declined this request',- body: provider => `${provider} would not answer this message. Edit it and send again.`- },- format_error: {- title: 'The AI service rejected the request',- body: provider =>- `${provider} did not accept how this request was built. Switch provider or send diagnostics so we can look into it.`- },- truncated: {- title: 'The reply was cut short',- body: 'The model stopped before finishing. Retry to get a complete reply.'- },- invalid_response: {- title: 'The AI service sent an unreadable reply',- body: provider => `${provider} returned something Hermes could not read. Retry in a moment.`- },- empty_response: {- title: 'The AI service sent an empty reply',- body: provider => `${provider} returned nothing for this message. Retry in a moment.`- },- loop_error: {- title: 'Hermes got stuck in a loop',- body: 'The reply kept repeating the same steps, so Hermes stopped it. Retry, or start a new chat if it happens again.'- },- SESSION_OWNER_BUSY: {- title: 'Hermes is busy in this chat',- body: 'Another turn is running here and your message could not join its queue. Nothing was sent. Retry once that turn ends.'- },- cron_session_read_only: {- title: 'This chat belongs to a scheduled job',- body: 'It only runs that job, so your message was not run. Start a new chat to send it.'- },- SESSION_OWNER_UNCONFIRMED: {- title: 'Your message may already be queued',- body: 'The gateway did not confirm your message in time. If it was queued, it runs once the earlier turn finishes or is resolved. Check the chat before sending it again.'- },- SESSION_NOT_OWNED: {- title: 'This chat is open somewhere else',- body: 'This chat is currently open in another Hermes window or terminal. Close it there and send your message again, or start a new chat here.'- },- disk_full: {- title: 'Disk full',- body: 'Your disk is full, so Hermes could not save this conversation. Free some space, then retry.'- },- // Nous free tier. The body is normally the backend's own sentence (it names the wait- // and the way forward); these bodies stand in for an older backend that sent none.- free_tier_disabled: {- title: 'Using Hermes without signing in is switched off right now',- body: "Sign in with a Nous account to keep chatting, it's free."- },- free_tier_rate_limited: {- title: "You've used up the allowance for chatting without signing in",- body: "It refreshes shortly. Sign in with a Nous account for a bigger allowance, it's free."- },- free_tier_at_capacity: {- title: 'Chatting without signing in is really busy right now',- body: "Sign in to skip the queue, it's free, or try again in a little while."- },- free_tier_model_not_free: {- title: "That model isn't available without signing in",- body: "Hermes uses the free model for now. Sign in with a Nous account for more models, it's free."- },- free_tier_route: {- title: "Hermes couldn't reach the free model on this route",- body: "Sign in with a Nous account, it's free, or check the NOUS_INFERENCE_BASE_URL setting."- },- free_tier_outage: {- title: 'The free model is having trouble responding right now',- body: 'Try sending your message again in a minute.'- },- free_tier_refused: {- title: "Hermes couldn't send that without signing in",- body: 'Signing in with a Nous account is free.'- }- },+ errorCodes: enErrorCodes,errorAuthKinds: {api_key: {title: provider => `${provider} rejected your API key`,diff --git a/apps/desktop/src/i18n/en_error_codes.ts b/apps/desktop/src/i18n/en_error_codes.tsnew file mode 100644index 00000000000..11d950e6839--- /dev/null+++ b/apps/desktop/src/i18n/en_error_codes.ts@@ -0,0 +1,157 @@+import type { Translations } from './types'++type ThreadCopy = Translations['assistant']['thread']++// The error card's per-code title and body (lib/error-surface-copy.ts), keyed by error_surface.code.+export const enErrorCodes: ThreadCopy['errorCodes'] = {+ auth: {+ title: provider => `${provider} rejected your sign-in`,+ body: provider =>+ `The credentials saved for ${provider} were not accepted. Fix them in Settings or switch provider, then send your message again.`+ },+ auth_permanent: {+ title: provider => `${provider} rejected your sign-in`,+ body: provider =>+ `The credentials saved for ${provider} are invalid or were revoked. Update them or switch provider, then send your message again.`+ },+ billing: {+ title: 'Out of credits',+ body: provider => `Your ${provider} account has no credits left. Top up or switch provider, then send again.`+ },+ rate_limit: {+ title: 'The AI service is busy',+ body: provider => `${provider} is limiting requests right now. Wait a minute, then retry.`+ },+ upstream_rate_limit: {+ title: 'The AI service is busy',+ body: provider => `${provider} is limiting requests right now. Wait a minute, then retry.`+ },+ overloaded: {+ title: 'The AI service is overloaded',+ body: provider => `${provider} is having problems right now. Retry in a moment or switch provider.`+ },+ server_error: {+ title: 'The AI service had a problem',+ body: provider => `${provider} returned a server error. Retry in a moment or switch provider.`+ },+ timeout: {+ title: 'Could not reach the AI service',+ body: provider =>+ `${provider} could not be reached or did not answer in time. Check your internet connection, then retry.`+ },+ stream_drop: {+ title: 'The reply was cut off',+ body: 'The connection dropped before the reply finished. Retry to send it again.'+ },+ no_reply: {+ title: "The reply didn't finish",+ body: 'Hermes ended this turn without a reply. Retry to send it again.'+ },+ upstream_blocked: {+ title: 'A firewall blocked the request',+ body: provider =>+ `A firewall or CDN in front of ${provider} blocked the request before it reached the model — your key is probably fine. Set a User-Agent header via the provider's extra_headers in Settings, or switch provider, then send your message again.`+ },+ ssl_cert_verification: {+ title: 'Secure connection failed',+ body: provider =>+ `Hermes could not verify the secure connection to ${provider}. Check your network or proxy settings, or switch provider, then send your message again.`+ },+ context_overflow: {+ title: 'This conversation is too long',+ body: 'The conversation no longer fits the model. Compress it or start a new chat, then send again.'+ },+ payload_too_large: {+ title: 'This message is too large',+ body: 'The request was too big for the model. Compress the conversation or start a new chat, then send again.'+ },+ model_not_found: {+ title: 'This model is not available',+ body: provider =>+ `${provider} does not offer this model on your account. Choose another model, then send your message again.`+ },+ provider_policy_blocked: {+ title: 'This model is blocked by your account settings',+ body: provider =>+ `${provider} would not route this request under your account's data or privacy settings. Choose another model or switch provider.`+ },+ content_policy_blocked: {+ title: 'The AI service declined this request',+ body: provider => `${provider} would not answer this message. Edit it and send again.`+ },+ format_error: {+ title: 'The AI service rejected the request',+ body: provider =>+ `${provider} did not accept how this request was built. Switch provider or send diagnostics so we can look into it.`+ },+ truncated: {+ title: 'The reply was cut short',+ body: 'The model stopped before finishing. Retry to get a complete reply.'+ },+ invalid_response: {+ title: 'The AI service sent an unreadable reply',+ body: provider => `${provider} returned something Hermes could not read. Retry in a moment.`+ },+ empty_response: {+ title: 'The AI service sent an empty reply',+ body: provider => `${provider} returned nothing for this message. Retry in a moment.`+ },+ loop_error: {+ title: 'Hermes got stuck in a loop',+ body: 'The reply kept repeating the same steps, so Hermes stopped it. Retry, or start a new chat if it happens again.'+ },+ SESSION_OWNER_BUSY: {+ title: 'Hermes is busy in this chat',+ body: 'Another turn is running here and your message could not join its queue. Nothing was sent. Retry once that turn ends.'+ },+ cron_session_read_only: {+ title: 'This chat belongs to a scheduled job',+ body: 'It only runs that job, so your message was not run. Start a new chat to send it.'+ },+ workspace_unavailable: {+ title: "This chat's folder is gone",+ body: 'The folder this chat works in was moved or deleted, so your message was not run. Recreate the folder, or use Move to project to give the chat another one, then retry.'+ },+ SESSION_OWNER_UNCONFIRMED: {+ title: 'Your message may already be queued',+ body: 'The gateway did not confirm your message in time. If it was queued, it runs once the earlier turn finishes or is resolved. Check the chat before sending it again.'+ },+ SESSION_NOT_OWNED: {+ title: 'This chat is open somewhere else',+ body: 'This chat is currently open in another Hermes window or terminal. Close it there and send your message again, or start a new chat here.'+ },+ disk_full: {+ title: 'Disk full',+ body: 'Your disk is full, so Hermes could not save this conversation. Free some space, then retry.'+ },+ // Nous free tier. The body is normally the backend's own sentence (it names the wait+ // and the way forward); these bodies stand in for an older backend that sent none.+ free_tier_disabled: {+ title: 'Using Hermes without signing in is switched off right now',+ body: "Sign in with a Nous account to keep chatting, it's free."+ },+ free_tier_rate_limited: {+ title: "You've used up the allowance for chatting without signing in",+ body: "It refreshes shortly. Sign in with a Nous account for a bigger allowance, it's free."+ },+ free_tier_at_capacity: {+ title: 'Chatting without signing in is really busy right now',+ body: "Sign in to skip the queue, it's free, or try again in a little while."+ },+ free_tier_model_not_free: {+ title: "That model isn't available without signing in",+ body: "Hermes uses the free model for now. Sign in with a Nous account for more models, it's free."+ },+ free_tier_route: {+ title: "Hermes couldn't reach the free model on this route",+ body: "Sign in with a Nous account, it's free, or check the NOUS_INFERENCE_BASE_URL setting."+ },+ free_tier_outage: {+ title: 'The free model is having trouble responding right now',+ body: 'Try sending your message again in a minute.'+ },+ free_tier_refused: {+ title: "Hermes couldn't send that without signing in",+ body: 'Signing in with a Nous account is free.'+ }+}diff --git a/apps/desktop/src/i18n/es.ts b/apps/desktop/src/i18n/es.tsindex 3a74b2c4c21..ad95e62b194 100644--- a/apps/desktop/src/i18n/es.ts+++ b/apps/desktop/src/i18n/es.ts@@ -5,6 +5,7 @@ import { esBoot } from './es_boot'import { esClarify } from './es_clarify'import { esConnectorAccounts } from './es_connector_accounts'import { esConnectorCard } from './es_connector_card'+import { esErrorLayers } from './es_error_layers'import { esFirstRun } from './es_first_run'import { esLocalModels } from './es_local_models'import { esModelMenu } from './es_model_menu'@@ -4873,32 +4874,7 @@ export const esOverrides = {react: 'Reaccionar',dismissError: 'Descartar error',responseStopped: 'Respuesta detenida',- errorLayers: {- auth: 'Problema de inicio de sesión',- billing: 'Créditos agotados',- disk: 'Disco lleno',- endpoint: 'No se puede conectar con tu servidor de modelos',- gateway: 'Hermes tuvo un problema',- generic: 'Hermes no pudo terminar esta respuesta',- provider: 'El servicio de IA devolvió un error',- runtime: 'Hermes tuvo un problema',- streaming: 'La respuesta se cortó'- },- errorLayerBodies: {- auth: 'El servicio de IA rechazó tu inicio de sesión. Revisa las credenciales de este proveedor y vuelve a enviar el mensaje.',- billing: 'Tu cuenta no tiene créditos para este proveedor. Recarga o cambia de proveedor y vuelve a enviarlo.',- disk: 'Tu disco está lleno, así que Hermes no pudo guardar esta conversación. Libera espacio y reinténtalo.',- endpoint:- 'Hermes no puede conectar con tu servidor de modelos personalizado. Comprueba que esté en ejecución y vuelve a enviar el mensaje.',- gateway:- 'Hermes tuvo un problema interno al iniciar esta respuesta. Vuelve a enviar el mensaje; si sigue ocurriendo, envía un diagnóstico.',- generic: 'Algo salió mal mientras Hermes respondía. Reinténtalo o copia los detalles si sigue ocurriendo.',- provider:- 'El servicio de IA no pudo completar esta solicitud. Reinténtalo en un momento o cambia de proveedor.',- runtime:- 'Hermes tuvo un problema interno al iniciar esta respuesta. Vuelve a enviar el mensaje; si sigue ocurriendo, envía un diagnóstico.',- streaming: 'La conexión se cortó antes de que terminara la respuesta. Reinténtalo para enviarla de nuevo.'- },+ ...esErrorLayers,errorCodes: {auth: {title: (provider: string) => `${provider} rechazó tu inicio de sesión`,@@ -5005,6 +4981,10 @@ export const esOverrides = {title: 'Este chat pertenece a una tarea programada',body: 'Solo ejecuta esa tarea, así que tu mensaje no se ejecutó. Empieza un chat nuevo para enviarlo.'},+ workspace_unavailable: {+ title: 'La carpeta de este chat ya no existe',+ body: 'La carpeta en la que trabaja este chat se movió o se eliminó, así que tu mensaje no se ejecutó. Vuelve a crear la carpeta o usa «Mover a proyecto» para darle otra al chat, y vuelve a intentarlo.'+ },SESSION_NOT_OWNED: {title: 'Este chat está abierto en otro sitio',body: 'Este chat está abierto en otra ventana de Hermes o en un terminal. Ciérralo allí y vuelve a enviar el mensaje, o empieza un chat nuevo aquí.'diff --git a/apps/desktop/src/i18n/es_error_layers.ts b/apps/desktop/src/i18n/es_error_layers.tsnew file mode 100644index 00000000000..75c5bf1b88f--- /dev/null+++ b/apps/desktop/src/i18n/es_error_layers.ts@@ -0,0 +1,32 @@+import type { Translations } from './types'++type ThreadCopy = Translations['assistant']['thread']++// The error card's layer fallbacks (lib/error-surface-copy.ts): used when a failure code has no own entry.+export const esErrorLayers: Pick<ThreadCopy, 'errorLayerBodies' | 'errorLayers'> = {+ errorLayers: {+ auth: 'Problema de inicio de sesión',+ billing: 'Créditos agotados',+ disk: 'Disco lleno',+ endpoint: 'No se puede conectar con tu servidor de modelos',+ gateway: 'Hermes tuvo un problema',+ generic: 'Hermes no pudo terminar esta respuesta',+ provider: 'El servicio de IA devolvió un error',+ runtime: 'Hermes tuvo un problema',+ streaming: 'La respuesta se cortó'+ },+ errorLayerBodies: {+ auth: 'El servicio de IA rechazó tu inicio de sesión. Revisa las credenciales de este proveedor y vuelve a enviar el mensaje.',+ billing: 'Tu cuenta no tiene créditos para este proveedor. Recarga o cambia de proveedor y vuelve a enviarlo.',+ disk: 'Tu disco está lleno, así que Hermes no pudo guardar esta conversación. Libera espacio y reinténtalo.',+ endpoint:+ 'Hermes no puede conectar con tu servidor de modelos personalizado. Comprueba que esté en ejecución y vuelve a enviar el mensaje.',+ gateway:+ 'Hermes tuvo un problema interno al iniciar esta respuesta. Vuelve a enviar el mensaje; si sigue ocurriendo, envía un diagnóstico.',+ generic: 'Algo salió mal mientras Hermes respondía. Reinténtalo o copia los detalles si sigue ocurriendo.',+ provider: 'El servicio de IA no pudo completar esta solicitud. Reinténtalo en un momento o cambia de proveedor.',+ runtime:+ 'Hermes tuvo un problema interno al iniciar esta respuesta. Vuelve a enviar el mensaje; si sigue ocurriendo, envía un diagnóstico.',+ streaming: 'La conexión se cortó antes de que terminara la respuesta. Reinténtalo para enviarla de nuevo.'+ }+}diff --git a/apps/desktop/src/i18n/fr.ts b/apps/desktop/src/i18n/fr.tsindex a97f38da6e5..dd97615ea5a 100644--- a/apps/desktop/src/i18n/fr.ts+++ b/apps/desktop/src/i18n/fr.ts@@ -5,6 +5,7 @@ import { frBoot } from './fr_boot'import { frClarify } from './fr_clarify'import { frConnectorAccounts } from './fr_connector_accounts'import { frConnectorCard } from './fr_connector_card'+import { frErrorLayers } from './fr_error_layers'import { frFirstRun } from './fr_first_run'import { frLocalModels } from './fr_local_models'import { frModelMenu } from './fr_model_menu'@@ -4886,34 +4887,7 @@ export const frOverrides = {react: 'Réagir',dismissError: "Ignorer l'erreur",responseStopped: 'Réponse interrompue',- errorLayers: {- auth: "Erreur d'authentification",- billing: 'Crédits épuisés',- disk: 'Disque plein',- endpoint: 'Erreur du point de terminaison personnalisé',- gateway: 'Erreur du gateway',- generic: 'Échec du tour',- provider: 'Erreur du fournisseur',- runtime: "Erreur d'exécution locale",- streaming: 'Erreur de connexion au flux'- },- errorLayerBodies: {- auth: "Le service d'IA a refusé votre connexion. Vérifiez les identifiants de ce fournisseur, puis renvoyez votre message.",- billing:- "Votre compte n'a plus de crédits chez ce fournisseur. Rechargez-le ou changez de fournisseur, puis réessayez.",- disk: "Votre disque est plein ; Hermes n'a pas pu enregistrer cette conversation. Libérez de l'espace, puis réessayez.",- endpoint:- "Hermes ne parvient pas à joindre votre serveur de modèle personnalisé. Vérifiez qu'il fonctionne, puis renvoyez votre message.",- gateway:- 'Hermes a rencontré un problème interne au démarrage de cette réponse. Renvoyez votre message ; si cela persiste, envoyez les diagnostics.',- generic:- "Une erreur s'est produite pendant la réponse de Hermes. Réessayez ou copiez les détails si cela persiste.",- provider:- "Le service d'IA n'a pas pu traiter cette demande. Réessayez dans un instant ou changez de fournisseur.",- runtime:- 'Hermes a rencontré un problème interne au démarrage de cette réponse. Renvoyez votre message ; si cela persiste, envoyez les diagnostics.',- streaming: 'La connexion a été interrompue avant la fin de la réponse. Réessayez pour la renvoyer.'- },+ ...frErrorLayers,errorCodes: {auth: {title: provider => `${provider} a refusé votre connexion`,@@ -5018,6 +4992,10 @@ export const frOverrides = {title: 'Cette conversation appartient à une tâche planifiée',body: 'Elle n’exécute que cette tâche ; votre message n’a donc pas été exécuté. Démarrez une nouvelle conversation pour l’envoyer.'},+ workspace_unavailable: {+ title: 'Le dossier de cette conversation a disparu',+ body: "Le dossier dans lequel travaille cette conversation a été déplacé ou supprimé ; votre message n'a donc pas été exécuté. Recréez le dossier ou utilisez « Déplacer vers un projet » pour lui en attribuer un autre, puis réessayez."+ },SESSION_NOT_OWNED: {title: 'Cette conversation est ouverte ailleurs',body: 'Cette conversation est déjà ouverte dans une autre fenêtre Hermes ou un terminal. Fermez-la là-bas puis réessayez, ou démarrez-en une nouvelle ici.'diff --git a/apps/desktop/src/i18n/fr_error_layers.ts b/apps/desktop/src/i18n/fr_error_layers.tsnew file mode 100644index 00000000000..f302dc0ee69--- /dev/null+++ b/apps/desktop/src/i18n/fr_error_layers.ts@@ -0,0 +1,34 @@+import type { Translations } from './types'++type ThreadCopy = Translations['assistant']['thread']++// The error card's layer fallbacks (lib/error-surface-copy.ts): used when a failure code has no own entry.+export const frErrorLayers: Pick<ThreadCopy, 'errorLayerBodies' | 'errorLayers'> = {+ errorLayers: {+ auth: "Erreur d'authentification",+ billing: 'Crédits épuisés',+ disk: 'Disque plein',+ endpoint: 'Erreur du point de terminaison personnalisé',+ gateway: 'Erreur du gateway',+ generic: 'Échec du tour',+ provider: 'Erreur du fournisseur',+ runtime: "Erreur d'exécution locale",+ streaming: 'Erreur de connexion au flux'+ },+ errorLayerBodies: {+ auth: "Le service d'IA a refusé votre connexion. Vérifiez les identifiants de ce fournisseur, puis renvoyez votre message.",+ billing:+ "Votre compte n'a plus de crédits chez ce fournisseur. Rechargez-le ou changez de fournisseur, puis réessayez.",+ disk: "Votre disque est plein ; Hermes n'a pas pu enregistrer cette conversation. Libérez de l'espace, puis réessayez.",+ endpoint:+ "Hermes ne parvient pas à joindre votre serveur de modèle personnalisé. Vérifiez qu'il fonctionne, puis renvoyez votre message.",+ gateway:+ 'Hermes a rencontré un problème interne au démarrage de cette réponse. Renvoyez votre message ; si cela persiste, envoyez les diagnostics.',+ generic:+ "Une erreur s'est produite pendant la réponse de Hermes. Réessayez ou copiez les détails si cela persiste.",+ provider: "Le service d'IA n'a pas pu traiter cette demande. Réessayez dans un instant ou changez de fournisseur.",+ runtime:+ 'Hermes a rencontré un problème interne au démarrage de cette réponse. Renvoyez votre message ; si cela persiste, envoyez les diagnostics.',+ streaming: 'La connexion a été interrompue avant la fin de la réponse. Réessayez pour la renvoyer.'+ }+}diff --git a/apps/desktop/src/i18n/ja.ts b/apps/desktop/src/i18n/ja.tsindex fe58a7c477a..1542c4e401f 100644--- a/apps/desktop/src/i18n/ja.ts+++ b/apps/desktop/src/i18n/ja.ts@@ -6,6 +6,7 @@ import { jaBoot } from './ja_boot'import { jaCatalog, jaSkillDeepLink } from './ja_catalog'import { jaClarify } from './ja_clarify'import { jaConnectors } from './ja_connectors'+import { jaErrorLayers } from './ja_error_layers'import { jaFirstRun } from './ja_first_run'import { jaLocalModels } from './ja_local_models'import { jaModelMenu } from './ja_model_menu'@@ -19,7 +20,6 @@ import { jaThemePicker } from './ja_theme_picker'import { jaUpdateChannel } from './ja_update_channel'export const jaOverrides = {-catalog: jaCatalog,connectors: jaConnectors.connectors,externalOpenFailed: {@@ -3308,15 +3308,7 @@ export const jaOverrides = {react: 'リアクション',dismissError: 'エラーを閉じる',errorGenericProvider: 'AI サービス',- errorLayerBodies: {- generic:- 'Hermes の返信中に問題が発生しました。再試行してください。問題が続く場合はエラー詳細をコピーしてください。',- provider:- 'AI サービスがリクエストを完了できませんでした。少し待って再試行するか、プロバイダーを切り替えてください。',- endpoint:- 'カスタムモデルサーバーに接続できません。サーバーが起動しているか確認し、メッセージを再送してください。',- streaming: '返信が完了する前に接続が切れました。再試行してもう一度送信してください。'- },+ ...jaErrorLayers,errorCodes: {provider_policy_blocked: {title: 'アカウント設定によりこのモデルはブロックされています',@@ -3371,19 +3363,12 @@ export const jaOverrides = {cron_session_read_only: {title: 'このチャットはスケジュールされたジョブ用です',body: 'このチャットはそのジョブの実行専用のため、メッセージは実行されませんでした。送信するには新しいチャットを開始してください。'+ },+ workspace_unavailable: {+ title: 'このチャットのフォルダーが見つかりません',+ body: 'このチャットの作業フォルダーが移動または削除されたため、メッセージは実行されませんでした。フォルダーを作り直すか、「Move to project」で別のフォルダーを割り当ててから、もう一度お試しください。'}},- errorLayers: {- auth: '認証エラー',- billing: 'クレジット不足',- disk: 'ディスク容量不足',- endpoint: 'カスタムエンドポイントのエラー',- gateway: 'ゲートウェイのエラー',- generic: 'ターンが失敗しました',- provider: 'プロバイダーのエラー',- runtime: 'ローカルランタイムのエラー',- streaming: 'ストリーミング接続のエラー'- },errorRetry: '再試行',errorLimitResets: time => `制限は ${time} にリセットされます`,errorRetryAtReset: time => `制限のリセット時に再試行(${time})`,diff --git a/apps/desktop/src/i18n/ja_error_layers.ts b/apps/desktop/src/i18n/ja_error_layers.tsnew file mode 100644index 00000000000..c48e77ca8c7--- /dev/null+++ b/apps/desktop/src/i18n/ja_error_layers.ts@@ -0,0 +1,29 @@+import type { Translations } from './types'++type ThreadCopy = Translations['assistant']['thread']++// The error card's layer fallbacks (lib/error-surface-copy.ts): used when a failure code has no own entry.+// Partial like the rest of this locale: an untranslated layer falls back to English.+export const jaErrorLayers: {+ [K in 'errorLayerBodies' | 'errorLayers']: Partial<ThreadCopy[K]>+} = {+ errorLayers: {+ auth: '認証エラー',+ billing: 'クレジット不足',+ disk: 'ディスク容量不足',+ endpoint: 'カスタムエンドポイントのエラー',+ gateway: 'ゲートウェイのエラー',+ generic: 'ターンが失敗しました',+ provider: 'プロバイダーのエラー',+ runtime: 'ローカルランタイムのエラー',+ streaming: 'ストリーミング接続のエラー'+ },+ errorLayerBodies: {+ generic:+ 'Hermes の返信中に問題が発生しました。再試行してください。問題が続く場合はエラー詳細をコピーしてください。',+ provider:+ 'AI サービスがリクエストを完了できませんでした。少し待って再試行するか、プロバイダーを切り替えてください。',+ endpoint: 'カスタムモデルサーバーに接続できません。サーバーが起動しているか確認し、メッセージを再送してください。',+ streaming: '返信が完了する前に接続が切れました。再試行してもう一度送信してください。'+ }+}diff --git a/apps/desktop/src/i18n/ru.ts b/apps/desktop/src/i18n/ru.tsindex b55df0fa3ef..eab07212123 100644--- a/apps/desktop/src/i18n/ru.ts+++ b/apps/desktop/src/i18n/ru.ts@@ -5,6 +5,7 @@ import { ruBoot } from './ru_boot'import { ruCatalog, ruSkillDeepLink } from './ru_catalog'import { ruClarify } from './ru_clarify'import { ruConnectors } from './ru_connectors'+import { ruErrorCodes } from './ru_error_codes'import { ruFirstRun } from './ru_first_run'import { ruModelMenu } from './ru_model_menu'import { ruModelSettings } from './ru_model_settings'@@ -38,7 +39,6 @@ const RU_NOUN = (count: number | string, one: string, few: string, many: string)}export const ruOverrides = {-catalog: ruCatalog,connectors: ruConnectors.connectors,sharedMetrics: ruSharedMetrics,@@ -3547,12 +3547,7 @@ export const ruOverrides = {branchNewChat: 'Ветка в новый чат',react: 'Реакция',dismissError: 'Скрыть ошибку',- errorCodes: {- cron_session_read_only: {- title: 'Этот чат относится к запланированной задаче',- body: 'Он только выполняет эту задачу, поэтому ваше сообщение не было выполнено. Начните новый чат, чтобы отправить его.'- }- },+ errorCodes: ruErrorCodes,filesChanged: count => `${count} ${RU_PLURAL(count, 'файл изменён', 'файла изменено', 'файлов изменено')}`,reviewChanges: 'Проверить',readAloudFailed: 'Не удалось зачитать вслух',diff --git a/apps/desktop/src/i18n/ru_error_codes.ts b/apps/desktop/src/i18n/ru_error_codes.tsnew file mode 100644index 00000000000..14024deb62c--- /dev/null+++ b/apps/desktop/src/i18n/ru_error_codes.ts@@ -0,0 +1,15 @@+import type { Translations } from './types'++type ThreadCopy = Translations['assistant']['thread']++// The error card's per-code title and body (lib/error-surface-copy.ts), keyed by error_surface.code.+export const ruErrorCodes: Partial<ThreadCopy['errorCodes']> = {+ cron_session_read_only: {+ title: 'Этот чат относится к запланированной задаче',+ body: 'Он только выполняет эту задачу, поэтому ваше сообщение не было выполнено. Начните новый чат, чтобы отправить его.'+ },+ workspace_unavailable: {+ title: 'Папка этого чата пропала',+ body: 'Папка, в которой работает этот чат, была перемещена или удалена, поэтому ваше сообщение не было выполнено. Создайте папку заново или назначьте чату другую через «Переместить в проект», затем повторите попытку.'+ }+}diff --git a/apps/desktop/src/i18n/zh-hant_assistant.ts b/apps/desktop/src/i18n/zh-hant_assistant.tsindex 8384fce5f7b..e435313b281 100644--- a/apps/desktop/src/i18n/zh-hant_assistant.ts+++ b/apps/desktop/src/i18n/zh-hant_assistant.ts@@ -100,6 +100,10 @@ export const zhHantAssistant = {cron_session_read_only: {title: '此聊天屬於一個排程工作',body: '它只會執行該工作,因此你的訊息未被執行。請開始新的聊天後再傳送。'+ },+ workspace_unavailable: {+ title: '此聊天的資料夾已不存在',+ body: '此聊天使用的資料夾已被移動或刪除,因此你的訊息未被執行。請重新建立該資料夾,或使用「Move to project」為聊天指定其他資料夾,然後重試。'}},errorLayers: {diff --git a/apps/desktop/src/i18n/zh.ts b/apps/desktop/src/i18n/zh.tsindex b84bf226769..7d07e1f6cbb 100644--- a/apps/desktop/src/i18n/zh.ts+++ b/apps/desktop/src/i18n/zh.ts@@ -5,6 +5,7 @@ import { introZh } from './intro-zh'import { zhCatalog, zhSkillDeepLink } from './zh_catalog'import { zhClarify } from './zh_clarify'import { zhConnectorCard } from './zh_connector_card'+import { zhErrorLayers } from './zh_error_layers'import { zhFirstRun } from './zh_first_run'import { zhLocalModels } from './zh_local_models'import { zhModelMenu } from './zh_model_menu'@@ -17,7 +18,6 @@ import { zhThemePicker } from './zh_theme_picker'import { zhUpdateChannel } from './zh_update_channel'export const zhOverrides = {-catalog: zhCatalog,externalOpenFailed: {title: '无法打开此链接',@@ -4299,12 +4299,7 @@ export const zhOverrides = {react: '回应',dismissError: '关闭错误',errorGenericProvider: 'AI 服务',- errorLayerBodies: {- generic: 'Hermes 回复时出现问题。请重试;若问题持续,请复制错误详情。',- provider: 'AI 服务无法完成此请求。请稍后重试或切换服务商。',- endpoint: 'Hermes 无法连接到你的自定义模型服务器。请确认它正在运行,然后重新发送消息。',- streaming: '回复完成前连接已断开。请重试以重新发送。'- },+ ...zhErrorLayers,errorCodes: {provider_policy_blocked: {title: '账户设置阻止了此模型',@@ -4353,19 +4348,12 @@ export const zhOverrides = {cron_session_read_only: {title: '此聊天属于一个定时任务',body: '它只运行该任务,因此你的消息未被执行。请新建聊天后再发送。'+ },+ workspace_unavailable: {+ title: '此聊天的文件夹已不存在',+ body: '此聊天使用的文件夹已被移动或删除,因此你的消息未被执行。请重新创建该文件夹,或使用“移动到项目”为聊天指定其他文件夹,然后重试。'}},- errorLayers: {- auth: '认证错误',- billing: '额度不足',- disk: '磁盘已满',- endpoint: '自定义端点错误',- gateway: '网关错误',- generic: '本轮失败',- provider: '模型服务商错误',- runtime: '本地运行时错误',- streaming: '流式连接错误'- },errorRetry: '重试',errorLimitResets: time => `限额将于 ${time} 重置`,errorRetryAtReset: time => `限额重置后重试(${time})`,diff --git a/apps/desktop/src/i18n/zh_error_layers.ts b/apps/desktop/src/i18n/zh_error_layers.tsnew file mode 100644index 00000000000..f2b41929922--- /dev/null+++ b/apps/desktop/src/i18n/zh_error_layers.ts@@ -0,0 +1,27 @@+import type { Translations } from './types'++type ThreadCopy = Translations['assistant']['thread']++// The error card's layer fallbacks (lib/error-surface-copy.ts): used when a failure code has no own entry.+// Partial like the rest of this locale: an untranslated layer falls back to English.+export const zhErrorLayers: {+ [K in 'errorLayerBodies' | 'errorLayers']: Partial<ThreadCopy[K]>+} = {+ errorLayers: {+ auth: '认证错误',+ billing: '额度不足',+ disk: '磁盘已满',+ endpoint: '自定义端点错误',+ gateway: '网关错误',+ generic: '本轮失败',+ provider: '模型服务商错误',+ runtime: '本地运行时错误',+ streaming: '流式连接错误'+ },+ errorLayerBodies: {+ generic: 'Hermes 回复时出现问题。请重试;若问题持续,请复制错误详情。',+ provider: 'AI 服务无法完成此请求。请稍后重试或切换服务商。',+ endpoint: 'Hermes 无法连接到你的自定义模型服务器。请确认它正在运行,然后重新发送消息。',+ streaming: '回复完成前连接已断开。请重试以重新发送。'+ }+}diff --git a/apps/desktop/src/lib/error-surface.ts b/apps/desktop/src/lib/error-surface.tsindex 7228ee8184a..50da0512506 100644--- a/apps/desktop/src/lib/error-surface.ts+++ b/apps/desktop/src/lib/error-surface.ts@@ -53,6 +53,9 @@ export const ERROR_CODE_KEYS = ['SESSION_OWNER_BUSY',// The chat is a scheduled job's session: it only runs that job, so a typed message never runs there.'cron_session_read_only',+ // The chat's working folder was moved or deleted: nothing ran, and nothing will until it is back+ // or the chat moves to another folder.+ 'workspace_unavailable',// The owner did not confirm a forwarded send in time; it may already be queued: no Retry.'SESSION_OWNER_UNCONFIRMED','disk_full',@@ -276,6 +279,8 @@ const CODE_PLANS: Partial<Record<ErrorCodeKey, Partial<ErrorRecoveryPlan>>> = {SESSION_OWNER_BUSY: { retry: true, startNewSession: false },SESSION_OWNER_UNCONFIRMED: { retry: false, startNewSession: false },cron_session_read_only: { retry: false, startNewSession: true },+ // Retry is the next click once the folder is back or the chat was moved (Move to project).+ workspace_unavailable: { retry: true, startNewSession: true },content_policy_blocked: { editMessage: true, retry: false },context_overflow: { compress: true, retry: false, startNewSession: true },disk_full: { openHermesFolder: true, retry: true },diff --git a/gateway/run_turn_runner.py b/gateway/run_turn_runner.pyindex 126c30273c5..8fe66327199 100644--- a/gateway/run_turn_runner.py+++ b/gateway/run_turn_runner.py@@ -171,6 +171,17 @@ def _resolution_failure_reply(exc: Exception, platform: Platform) -> tuple[str,return t("gateway.errors.no_credentials"), auth_permanent, False+def _workspace_unavailable_result(policy) -> dict:+ """A failed, never-run turn for a session whose frozen working directory is gone. Nothing ran+ and an unchanged resend fails the same way, so the reply names the folder and the way out+ instead of the generic "something went wrong" apology."""+ from agent.turn_failure_copy import stamp_failure+ text = t("gateway.errors.workspace_unavailable", path=policy.cwd)+ return stamp_failure({"final_response": text, "messages": [], "api_calls": 0, "tools": [],+ "failed": True, "completed": False, "error": text},+ "workspace_unavailable", False)++class TurnRunner(GatewayTurnProgressMixin, GatewaySessionAgentMixin):"""Per-turn collaborator carrying ``GatewayRunner._run_agent_inner``'s tool-progress callbacks."""@@ -1160,13 +1171,23 @@ class TurnRunner(GatewayTurnProgressMixin, GatewaySessionAgentMixin):return final_response + "\n" + "\n".join(unique_tags)def run_sync(self):+ from contextlib import ExitStackfrom gateway.session_policy import bind_turn_workspace, policy_for_source, policy_scopefrom gateway.session_api_turn import api_policy_scopefrom gateway.session_authorities import active_authority+ from hermes_state_runtime import RuntimeStoreErrorpolicy = policy_for_source(self._runner, self._ctx.source)- with policy_scope(policy, authority=active_authority(self._runner)), api_policy_scope():- bind_turn_workspace(policy, self._ctx.session_id)- result = self._run_sync_scoped()+ with ExitStack() as scope:+ try:+ scope.enter_context(policy_scope(policy, authority=active_authority(self._runner)))+ except RuntimeStoreError as exc:+ if exc.reason != 'workspace_unavailable':+ raise+ result = _workspace_unavailable_result(policy)+ else:+ scope.enter_context(api_policy_scope())+ bind_turn_workspace(policy, self._ctx.session_id)+ result = self._run_sync_scoped()from gateway.session_results import execution_resultcaptured = execution_result.get()if captured is not None:diff --git a/gateway/session_policy.py b/gateway/session_policy.pyindex 78449444bb4..66778913d7e 100644--- a/gateway/session_policy.py+++ b/gateway/session_policy.py@@ -1052,7 +1052,7 @@ def policy_scope(policy, *, authority=None):# Readiness, not structure: a removed workspace keeps the chat readable and movable, but no# turn runs in a missing directory.if not Path(policy.cwd).is_dir():- raise RuntimeStoreError('workspace_unavailable')+ raise RuntimeStoreError('workspace_unavailable', field='cwd', detail=policy.cwd)from agent.runtime_cwd import set_session_cwdfrom tools.terminal_scope import set_terminal_scope, reset_terminal_scopeterminal = json.loads(policy.terminal_json)diff --git a/locales/_keys.desktop.json b/locales/_keys.desktop.jsonindex a2b068fe445..2e8913e52b4 100644--- a/locales/_keys.desktop.json+++ b/locales/_keys.desktop.json@@ -272,6 +272,8 @@"assistant.thread.errorCodes.upstream_blocked.title","assistant.thread.errorCodes.upstream_rate_limit.body","assistant.thread.errorCodes.upstream_rate_limit.title",+ "assistant.thread.errorCodes.workspace_unavailable.body",+ "assistant.thread.errorCodes.workspace_unavailable.title","assistant.thread.errorCompressConversation","assistant.thread.errorCompressFailed","assistant.thread.errorCopyDiagnostics",diff --git a/locales/af.yaml b/locales/af.yamlindex 949b8febedb..8281a7abe06 100644--- a/locales/af.yaml+++ b/locales/af.yaml@@ -692,6 +692,7 @@ gateway:history_unavailable: "⚠️ Hierdie sessie se geskiedenis is tydelik onbeskikbaar, so hierdie boodskap is nie verwerk nie. Vra die operateur om state.db na te gaan en stuur dit weer sodra dit gesond is. Gebruik /reset slegs as jy doelbewus 'n nuwe gesprek wil begin."no_credentials: "⚠️ Ek kon nie met die KI-modeldiens verbind nie, so hierdie boodskap is nie verwerk nie. Gebruik /login om weer aan te meld, of /model om 'n ander model te kies. As dit aanhou misluk, voer `hermes doctor` op die gasheer uit."cron_session_read_only: "⚠️ Hierdie klets behoort aan 'n geskeduleerde taak en voer net daardie taak uit, so jou boodskap is nie uitgevoer nie. Begin 'n nuwe klets om dit te stuur."+ workspace_unavailable: "⚠️ Hierdie klets se werkvouer bestaan nie meer nie ({path}), so jou boodskap is nie uitgevoer nie. Skep die vouer weer, of skuif die klets na 'n ander een (`/worktree new` in die CLI, “Move to project” in die rekenaarprogram), en stuur dan jou boodskap weer."skills:disabled: "Die **{name}**-vaardigheid is geïnstalleer, maar gedeaktiveer.\nAktiveer dit met: `hermes skills config`"not_installed: "Die **{name}**-vaardigheid is beskikbaar, maar nie geïnstalleer nie.\nInstalleer dit met: `hermes skills install {install_name}`"diff --git a/locales/ar.yaml b/locales/ar.yamlindex 3ed3446315e..3468bb0cb3b 100644--- a/locales/ar.yaml+++ b/locales/ar.yaml@@ -692,6 +692,7 @@ gateway:history_unavailable: "⚠️ سجل هذه الجلسة غير متاح مؤقتًا، لذا لم تُعالج هذه الرسالة. اطلب من المشغّل فحص state.db، ثم أعد الإرسال بعد أن يعود سليمًا. استخدم /reset فقط إن كنت تريد فعلًا بدء محادثة جديدة."no_credentials: "⚠️ تعذّر الاتصال بخدمة نموذج الذكاء الاصطناعي، لذا لم تُعالج هذه الرسالة. استخدم /login لتسجيل الدخول مجددًا، أو /model لاختيار نموذج آخر. إن استمرّ الفشل، شغّل `hermes doctor` على المضيف."cron_session_read_only: "⚠️ هذه المحادثة تابعة لمهمة مجدولة ولا تشغّل سوى تلك المهمة، لذا لم تُنفَّذ رسالتك. ابدأ محادثة جديدة لإرسالها."+ workspace_unavailable: "⚠️ لم يعد مجلد عمل هذه المحادثة موجوداً ({path})، لذا لم تُنفَّذ رسالتك. أعد إنشاء المجلد، أو انقل المحادثة إلى مجلد آخر (`/worktree new` في واجهة سطر الأوامر، أو «Move to project» في تطبيق سطح المكتب)، ثم أرسل رسالتك مجدداً."skills:disabled: "مهارة **{name}** مثبّتة لكنها معطّلة.\nفعّلها بـ: `hermes skills config`"not_installed: "مهارة **{name}** متاحة لكنها غير مثبّتة.\nثبّتها بـ: `hermes skills install {install_name}`"diff --git a/locales/de.yaml b/locales/de.yamlindex f1ebd5d14a1..0cb234f8578 100644--- a/locales/de.yaml+++ b/locales/de.yaml@@ -692,6 +692,7 @@ gateway:history_unavailable: "⚠️ Der Verlauf dieser Sitzung ist vorübergehend nicht verfügbar, daher wurde diese Nachricht nicht verarbeitet. Bitten Sie den Betreiber, state.db zu prüfen, und senden Sie erneut, sobald alles in Ordnung ist. Verwenden Sie /reset nur, wenn Sie bewusst eine neue Konversation beginnen möchten."no_credentials: "⚠️ Ich konnte keine Verbindung zum KI-Modelldienst herstellen, daher wurde diese Nachricht nicht verarbeitet. Verwenden Sie /login, um sich erneut anzumelden, oder /model, um ein anderes Modell zu wählen. Falls es weiterhin fehlschlägt, führen Sie `hermes doctor` auf dem Host aus."cron_session_read_only: "⚠️ Dieser Chat gehört zu einer geplanten Aufgabe und führt nur diese aus, daher wurde deine Nachricht nicht ausgeführt. Starte einen neuen Chat, um sie zu senden."+ workspace_unavailable: "⚠️ Der Arbeitsordner dieses Chats existiert nicht mehr ({path}), daher wurde deine Nachricht nicht ausgeführt. Lege den Ordner neu an oder verschiebe den Chat in einen anderen (`/worktree new` in der CLI, „In Projekt verschieben“ in der Desktop-App) und sende deine Nachricht dann erneut."skills:disabled: "Der Skill **{name}** ist installiert, aber deaktiviert.\nAktivieren Sie ihn mit: `hermes skills config`"not_installed: "Der Skill **{name}** ist verfügbar, aber nicht installiert.\nInstallieren Sie ihn mit: `hermes skills install {install_name}`"diff --git a/locales/en.yaml b/locales/en.yamlindex d760a0e7715..58899b78e16 100644--- a/locales/en.yaml+++ b/locales/en.yaml@@ -700,6 +700,7 @@ gateway:history_unavailable: "⚠️ This session's history is temporarily unavailable, so this message was not processed. Ask the operator to inspect state.db, then resend after it is healthy. Use /reset only if you intentionally want to start a new conversation."no_credentials: "⚠️ I couldn't connect to the AI model service, so this message wasn't processed. Use /login to sign in again, or /model to pick a different model. If it keeps failing, run `hermes doctor` on the host."cron_session_read_only: "⚠️ This chat belongs to a scheduled job and only runs that job, so your message was not run. Start a new chat to send it."+ workspace_unavailable: "⚠️ This chat's working folder no longer exists ({path}), so your message was not run. Recreate the folder, or move the chat to another one (`/worktree new` in the CLI, Move to project in the desktop app), then send your message again."skills:disabled: "The **{name}** skill is installed but disabled.\nEnable it with: `hermes skills config`"diff --git a/locales/es.yaml b/locales/es.yamlindex c49122067a3..044da5d956b 100644--- a/locales/es.yaml+++ b/locales/es.yaml@@ -692,6 +692,7 @@ gateway:history_unavailable: "⚠️ El historial de esta sesión no está disponible temporalmente, así que este mensaje no se procesó. Pide al operador que revise state.db y reenvíalo cuando esté en buen estado. Usa /reset solo si realmente quieres empezar una conversación nueva."no_credentials: "⚠️ No pude conectar con el servicio del modelo de IA, así que este mensaje no se procesó. Usa /login para iniciar sesión de nuevo, o /model para elegir otro modelo. Si sigue fallando, ejecuta `hermes doctor` en el host."cron_session_read_only: "⚠️ Este chat pertenece a una tarea programada y solo ejecuta esa tarea, así que tu mensaje no se ejecutó. Empieza un chat nuevo para enviarlo."+ workspace_unavailable: "⚠️ La carpeta de trabajo de este chat ya no existe ({path}), así que tu mensaje no se ejecutó. Vuelve a crear la carpeta o mueve el chat a otra (`/worktree new` en la CLI, «Mover a proyecto» en la app de escritorio) y vuelve a enviar tu mensaje."skills:disabled: "La skill **{name}** está instalada pero desactivada.\nActívala con: `hermes skills config`"not_installed: "La skill **{name}** está disponible pero no instalada.\nInstálala con: `hermes skills install {install_name}`"diff --git a/locales/fr.yaml b/locales/fr.yamlindex 5b9776f3ffe..c016f349294 100644--- a/locales/fr.yaml+++ b/locales/fr.yaml@@ -803,6 +803,7 @@ gateway:history_unavailable: "⚠️ L'historique de cette session est temporairement indisponible ; ce message n'a donc pas été traité. Demandez à l'opérateur d'inspecter state.db, puis renvoyez-le une fois le problème réglé. N'utilisez /reset que si vous voulez vraiment démarrer une nouvelle conversation."no_credentials: "⚠️ Je n'ai pas pu me connecter au service de modèle IA ; ce message n'a donc pas été traité. Utilisez /login pour vous reconnecter, ou /model pour choisir un autre modèle. Si l'échec persiste, lancez `hermes doctor` sur l'hôte."cron_session_read_only: "⚠️ Cette conversation appartient à une tâche planifiée et n'exécute que cette tâche ; votre message n'a donc pas été exécuté. Démarrez une nouvelle conversation pour l'envoyer."+ workspace_unavailable: "⚠️ Le dossier de travail de cette conversation n'existe plus ({path}) ; votre message n'a donc pas été exécuté. Recréez le dossier ou déplacez la conversation vers un autre (`/worktree new` dans la CLI, « Déplacer vers un projet » dans l'application de bureau), puis renvoyez votre message."skills:disabled: |-La skill **{name}** est installée mais désactivée.diff --git a/locales/ga.yaml b/locales/ga.yamlindex f47c648e812..292ea98d7ba 100644--- a/locales/ga.yaml+++ b/locales/ga.yaml@@ -692,6 +692,7 @@ gateway:history_unavailable: "⚠️ Níl stair an tseisiúin seo ar fáil go sealadach, mar sin níor próiseáladh an teachtaireacht seo. Iarr ar an oibreoir state.db a scrúdú, ansin seol arís í nuair a bheidh sé folláin. Ná húsáid /reset ach amháin más mian leat comhrá nua a thosú d'aon ghnó."no_credentials: "⚠️ Níorbh fhéidir liom ceangal le seirbhís na samhla AI, mar sin níor próiseáladh an teachtaireacht seo. Úsáid /login chun síniú isteach arís, nó /model chun samhail eile a roghnú. Má leanann sé ag teip, rith `hermes doctor` ar an óstach."cron_session_read_only: "⚠️ Baineann an comhrá seo le jab sceidealaithe agus ní ritheann sé ach an jab sin, mar sin níor ritheadh do theachtaireacht. Tosaigh comhrá nua chun í a sheoladh."+ workspace_unavailable: "⚠️ Níl fillteán oibre an chomhrá seo ann a thuilleadh ({path}), mar sin níor ritheadh do theachtaireacht. Athchruthaigh an fillteán, nó bog an comhrá go ceann eile (`/worktree new` sa CLI, “Move to project” san aip deisce), agus ansin seol do theachtaireacht arís."skills:disabled: "Tá an scil **{name}** suiteáilte ach díchumasaithe.\nCumasaigh í le: `hermes skills config`"not_installed: "Tá an scil **{name}** ar fáil ach níl sí suiteáilte.\nSuiteáil í le: `hermes skills install {install_name}`"diff --git a/locales/hu.yaml b/locales/hu.yamlindex 505e1edaca0..cda9efa151c 100644--- a/locales/hu.yaml+++ b/locales/hu.yaml@@ -702,6 +702,7 @@ gateway:history_unavailable: "⚠️ Ennek a munkamenetnek az előzményei átmenetileg nem érhetők el, ezért ez az üzenet nem lett feldolgozva. Kérd meg az üzemeltetőt, hogy nézze meg a state.db fájlt, majd küldd el újra, amikor rendben van. A /reset parancsot csak akkor használd, ha szándékosan új beszélgetést akarsz kezdeni."no_credentials: "⚠️ Nem tudtam kapcsolódni az AI-modellszolgáltatáshoz, ezért ez az üzenet nem lett feldolgozva. Jelentkezz be újra a /login paranccsal, vagy válassz másik modellt a /model paranccsal. Ha továbbra is hibázik, futtasd a `hermes doctor` parancsot a gépen."cron_session_read_only: "⚠️ Ez a csevegés egy ütemezett feladathoz tartozik, és csak azt futtatja, ezért az üzeneted nem futott le. Indíts új csevegést az elküldéséhez."+ workspace_unavailable: "⚠️ Ennek a csevegésnek a munkamappája már nem létezik ({path}), ezért az üzeneted nem futott le. Hozd létre újra a mappát, vagy helyezd át a csevegést egy másikba (`/worktree new` a CLI-ben, „Move to project” az asztali alkalmazásban), majd küldd el újra az üzenetet."skills:disabled: "A(z) **{name}** skill telepítve van, de ki van kapcsolva.\nBekapcsolás: `hermes skills config`"not_installed: "A(z) **{name}** skill elérhető, de nincs telepítve.\nTelepítés: `hermes skills install {install_name}`"diff --git a/locales/it.yaml b/locales/it.yamlindex ac41eeb6072..9740bc2a2d4 100644--- a/locales/it.yaml+++ b/locales/it.yaml@@ -692,6 +692,7 @@ gateway:history_unavailable: "⚠️ La cronologia di questa sessione è temporaneamente non disponibile, quindi questo messaggio non è stato elaborato. Chiedi all'operatore di controllare state.db, poi invialo di nuovo quando è di nuovo integro. Usa /reset solo se vuoi davvero iniziare una nuova conversazione."no_credentials: "⚠️ Non sono riuscito a connettermi al servizio del modello AI, quindi questo messaggio non è stato elaborato. Usa /login per accedere di nuovo, oppure /model per scegliere un altro modello. Se continua a fallire, esegui `hermes doctor` sull'host."cron_session_read_only: "⚠️ Questa chat appartiene a un'attività pianificata ed esegue solo quella, quindi il tuo messaggio non è stato eseguito. Avvia una nuova chat per inviarlo."+ workspace_unavailable: "⚠️ La cartella di lavoro di questa chat non esiste più ({path}), quindi il tuo messaggio non è stato eseguito. Ricrea la cartella o sposta la chat in un'altra (`/worktree new` nella CLI, «Move to project» nell'app desktop), poi invia di nuovo il messaggio."skills:disabled: "La skill **{name}** è installata ma disattivata.\nAttivala con: `hermes skills config`"not_installed: "La skill **{name}** è disponibile ma non installata.\nInstallala con: `hermes skills install {install_name}`"diff --git a/locales/ja.yaml b/locales/ja.yamlindex 7cd8c0f10b5..8fbe9bbb309 100644--- a/locales/ja.yaml+++ b/locales/ja.yaml@@ -692,6 +692,7 @@ gateway:history_unavailable: "⚠️ このセッションの履歴が一時的に利用できないため、このメッセージは処理されませんでした。運用者に state.db の確認を依頼し、正常になってから再送信してください。/reset は意図的に新しい会話を始めたい場合のみ使ってください。"no_credentials: "⚠️ AI モデルサービスに接続できなかったため、このメッセージは処理されませんでした。/login で再度サインインするか、/model で別のモデルを選んでください。失敗が続く場合は、ホストで `hermes doctor` を実行してください。"cron_session_read_only: "⚠️ このチャットはスケジュールされたジョブ専用で、そのジョブしか実行しないため、メッセージは実行されませんでした。送信するには新しいチャットを開始してください。"+ workspace_unavailable: "⚠️ このチャットの作業フォルダーが見つかりません({path})。そのためメッセージは実行されませんでした。フォルダーを作り直すか、チャットを別のフォルダーへ移動してから(CLI では `/worktree new`、デスクトップアプリでは「Move to project」)、もう一度送信してください。"skills:disabled: "**{name}** スキルはインストールされていますが無効です。\n有効化するには: `hermes skills config`"not_installed: "**{name}** スキルは利用可能ですがインストールされていません。\nインストールするには: `hermes skills install {install_name}`"diff --git a/locales/ko.yaml b/locales/ko.yamlindex ebe9f64e7ad..8949babe11c 100644--- a/locales/ko.yaml+++ b/locales/ko.yaml@@ -692,6 +692,7 @@ gateway:history_unavailable: "⚠️ 이 세션의 기록을 일시적으로 사용할 수 없어서 이 메시지는 처리되지 않았어요. 운영자에게 state.db를 점검해 달라고 요청한 뒤, 정상화되면 다시 보내 주세요. 의도적으로 새 대화를 시작하려는 경우에만 /reset을 사용하세요."no_credentials: "⚠️ AI 모델 서비스에 연결할 수 없어서 이 메시지는 처리되지 않았어요. /login으로 다시 로그인하거나, /model로 다른 모델을 선택하세요. 계속 실패하면 호스트에서 `hermes doctor`를 실행하세요."cron_session_read_only: "⚠️ 이 채팅은 예약된 작업 전용이며 그 작업만 실행하므로 메시지가 실행되지 않았습니다. 보내려면 새 채팅을 시작하세요."+ workspace_unavailable: "⚠️ 이 채팅의 작업 폴더가 더 이상 없습니다({path}). 그래서 메시지가 실행되지 않았습니다. 폴더를 다시 만들거나 채팅을 다른 폴더로 옮긴 뒤(CLI에서는 `/worktree new`, 데스크톱 앱에서는 'Move to project') 메시지를 다시 보내세요."skills:disabled: "**{name}** 스킬은 설치되어 있지만 비활성화되어 있어요.\n활성화 방법: `hermes skills config`"not_installed: "**{name}** 스킬은 사용할 수 있지만 설치되어 있지 않아요.\n설치 방법: `hermes skills install {install_name}`"diff --git a/locales/pt.yaml b/locales/pt.yamlindex 9b0cbcd7d49..daf6d2db8b3 100644--- a/locales/pt.yaml+++ b/locales/pt.yaml@@ -692,6 +692,7 @@ gateway:history_unavailable: "⚠️ O histórico desta sessão está temporariamente indisponível, então esta mensagem não foi processada. Peça ao operador para inspecionar o state.db e reenvie quando estiver íntegro. Use /reset apenas se quiser intencionalmente iniciar uma nova conversa."no_credentials: "⚠️ Não consegui me conectar ao serviço do modelo de IA, então esta mensagem não foi processada. Use /login para entrar novamente ou /model para escolher outro modelo. Se continuar falhando, execute `hermes doctor` no host."cron_session_read_only: "⚠️ Este chat pertence a uma tarefa agendada e só executa essa tarefa, por isso a sua mensagem não foi executada. Inicie um novo chat para enviá-la."+ workspace_unavailable: "⚠️ A pasta de trabalho deste chat já não existe ({path}), por isso a sua mensagem não foi executada. Recrie a pasta ou mova o chat para outra (`/worktree new` na CLI, «Move to project» na aplicação de ambiente de trabalho) e envie a mensagem novamente."skills:disabled: "A skill **{name}** está instalada, mas desativada.\nAtive-a com: `hermes skills config`"not_installed: "A skill **{name}** está disponível, mas não instalada.\nInstale-a com: `hermes skills install {install_name}`"diff --git a/locales/ru.yaml b/locales/ru.yamlindex 8aafd8d396f..69c67e4aafb 100644--- a/locales/ru.yaml+++ b/locales/ru.yaml@@ -692,6 +692,7 @@ gateway:history_unavailable: "⚠️ История этого сеанса временно недоступна, поэтому сообщение не было обработано. Попросите оператора проверить state.db, а затем отправьте сообщение снова, когда всё восстановится. Используйте /reset только если действительно хотите начать новый разговор."no_credentials: "⚠️ Мне не удалось подключиться к сервису ИИ-модели, поэтому сообщение не было обработано. Используйте /login, чтобы войти заново, или /model, чтобы выбрать другую модель. Если ошибка повторяется, выполните `hermes doctor` на хосте."cron_session_read_only: "⚠️ Этот чат относится к запланированной задаче и выполняет только её, поэтому ваше сообщение не было выполнено. Начните новый чат, чтобы отправить его."+ workspace_unavailable: "⚠️ Рабочая папка этого чата больше не существует ({path}), поэтому ваше сообщение не было выполнено. Создайте папку заново или перенесите чат в другую (`/worktree new` в CLI, «Переместить в проект» в настольном приложении), затем отправьте сообщение ещё раз."skills:disabled: "Навык **{name}** установлен, но выключен.\nВключите его командой: `hermes skills config`"not_installed: "Навык **{name}** доступен, но не установлен.\nУстановите его командой: `hermes skills install {install_name}`"diff --git a/locales/tr.yaml b/locales/tr.yamlindex f36fe119976..b47f3038d75 100644--- a/locales/tr.yaml+++ b/locales/tr.yaml@@ -692,6 +692,7 @@ gateway:history_unavailable: "⚠️ Bu oturumun geçmişi geçici olarak kullanılamıyor; bu nedenle mesaj işlenmedi. Operatörden state.db dosyasını incelemesini isteyin, düzeldikten sonra yeniden gönderin. /reset komutunu yalnızca bilinçli olarak yeni bir konuşma başlatmak istiyorsanız kullanın."no_credentials: "⚠️ Yapay zekâ model servisine bağlanamadım; bu nedenle mesaj işlenmedi. Yeniden giriş yapmak için /login, farklı bir model seçmek için /model kullanın. Sorun sürerse ana makinede `hermes doctor` çalıştırın."cron_session_read_only: "⚠️ Bu sohbet zamanlanmış bir göreve ait ve yalnızca o görevi çalıştırıyor, bu yüzden mesajın çalıştırılmadı. Göndermek için yeni bir sohbet başlat."+ workspace_unavailable: "⚠️ Bu sohbetin çalışma klasörü artık yok ({path}), bu yüzden mesajın çalıştırılmadı. Klasörü yeniden oluştur ya da sohbeti başka bir klasöre taşı (CLI'da `/worktree new`, masaüstü uygulamasında “Move to project”), sonra mesajını yeniden gönder."skills:disabled: "**{name}** skill'i kurulu ancak devre dışı.\nEtkinleştirmek için: `hermes skills config`"not_installed: "**{name}** skill'i mevcut ancak kurulu değil.\nKurmak için: `hermes skills install {install_name}`"diff --git a/locales/uk.yaml b/locales/uk.yamlindex 20fdcc8fc6f..8dca315b850 100644--- a/locales/uk.yaml+++ b/locales/uk.yaml@@ -692,6 +692,7 @@ gateway:history_unavailable: "⚠️ Історія цього сеансу тимчасово недоступна, тому це повідомлення не оброблено. Попросіть оператора перевірити state.db, а після відновлення надішліть повідомлення ще раз. Використовуйте /reset лише якщо справді хочете почати нову розмову."no_credentials: "⚠️ Я не зміг з'єднатися із сервісом AI-моделі, тому це повідомлення не оброблено. Скористайтеся /login, щоб увійти знову, або /model, щоб вибрати іншу модель. Якщо помилка повторюється, виконайте `hermes doctor` на хості."cron_session_read_only: "⚠️ Цей чат належить до запланованого завдання й виконує лише його, тому ваше повідомлення не було виконано. Почніть новий чат, щоб надіслати його."+ workspace_unavailable: "⚠️ Робочої теки цього чату більше не існує ({path}), тому ваше повідомлення не було виконано. Створіть теку знову або перенесіть чат до іншої (`/worktree new` у CLI, «Move to project» в настільному застосунку), а потім надішліть повідомлення ще раз."skills:disabled: "Навичку **{name}** встановлено, але вимкнено.\nУвімкніть її командою: `hermes skills config`"not_installed: "Навичка **{name}** доступна, але не встановлена.\nВстановіть її командою: `hermes skills install {install_name}`"diff --git a/locales/zh-hant.yaml b/locales/zh-hant.yamlindex a52f7273971..29738b46ca3 100644--- a/locales/zh-hant.yaml+++ b/locales/zh-hant.yaml@@ -692,6 +692,7 @@ gateway:history_unavailable: "⚠️ 此工作階段的歷史紀錄暫時無法使用,因此這則訊息未被處理。請管理者檢查 state.db,恢復正常後再重新傳送。只有在你確實想開始新對話時才使用 /reset。"no_credentials: "⚠️ 我無法連上 AI 模型服務,因此這則訊息未被處理。請使用 /login 重新登入,或使用 /model 選擇其他模型。若持續失敗,請在主機上執行 `hermes doctor`。"cron_session_read_only: "⚠️ 此聊天屬於一個排程工作,只會執行該工作,因此你的訊息未被執行。請開始新的聊天後再傳送。"+ workspace_unavailable: "⚠️ 此聊天的工作資料夾已不存在({path}),因此你的訊息未被執行。請重新建立該資料夾,或將聊天移至其他資料夾(CLI 中使用 `/worktree new`,桌面應用程式中使用「Move to project」),然後再次傳送訊息。"skills:disabled: "**{name}** 技能已安裝但已停用。\n啟用方式:`hermes skills config`"not_installed: "**{name}** 技能可用但尚未安裝。\n安裝方式:`hermes skills install {install_name}`"diff --git a/locales/zh.yaml b/locales/zh.yamlindex 9e86a2563a8..de3a9259b8f 100644--- a/locales/zh.yaml+++ b/locales/zh.yaml@@ -692,6 +692,7 @@ gateway:history_unavailable: "⚠️ 此会话的历史暂时不可用,因此这条消息未被处理。请让运维人员检查 state.db,恢复正常后再重新发送。只有确实想开始新对话时才使用 /reset。"no_credentials: "⚠️ 我无法连接 AI 模型服务,因此这条消息未被处理。请使用 /login 重新登录,或用 /model 选择其他模型。如果持续失败,请在主机上运行 `hermes doctor`。"cron_session_read_only: "⚠️ 此聊天属于一个定时任务,只会运行该任务,因此你的消息未被执行。请新建聊天后再发送。"+ workspace_unavailable: "⚠️ 此聊天的工作文件夹已不存在({path}),因此你的消息未被执行。请重新创建该文件夹,或将聊天移到其他文件夹(CLI 中使用 `/worktree new`,桌面应用中使用“移动到项目”),然后重新发送消息。"skills:disabled: "**{name}** 技能已安装但被禁用。\n启用方式:`hermes skills config`"not_installed: "**{name}** 技能可用但尚未安装。\n安装方式:`hermes skills install {install_name}`"diff --git a/tests/gateway/test_session_policy_workspace_readiness.py b/tests/gateway/test_session_policy_workspace_readiness.pyindex 2b407b16abe..af3df28a8a8 100644--- a/tests/gateway/test_session_policy_workspace_readiness.py+++ b/tests/gateway/test_session_policy_workspace_readiness.py@@ -25,3 +25,39 @@ async def test_removed_workspace_reads_and_moves_but_refuses_a_turn(tmp_path, mofinally:await owner.close()store.close_all_db_handles()+++async def test_turn_in_removed_workspace_names_the_folder_instead_of_failing_generically(tmp_path, monkeypatch):+ """A turn in a session whose folder is gone settles as a failed, never-run turn that names the+ folder, with its own reason code; it used to escape as an exception every client showed as a+ generic "model request failed" / "something went wrong"."""+ from types import SimpleNamespace++ from agent.error_surface import build_error_surface_from_result+ from gateway.run_turn_runner import TurnRunner+ from gateway.session_results import execution_result+ from tests.gateway.test_session_policy_verbs import _owner++ store, _db, authority, owner, ref = _owner(tmp_path, monkeypatch, None)+ authority.runner.session_authority = authority+ folder = tmp_path / 'project-a'+ try:+ folder.rmdir()+ source = authority.sessions[ref.session_id].source+ ctx = SimpleNamespace(source=source, session_id=ref.session_id, session_key=None)+ token = execution_result.set({})+ try:+ result = TurnRunner(authority.runner, ctx).run_sync()+ captured = execution_result.get()+ finally:+ execution_result.reset(token)+ assert result['failed'] and not result['completed'] and result['api_calls'] == 0, result+ assert result['failure_reason'] == 'workspace_unavailable' and result['failure_retryable'] is False+ assert str(folder) in result['final_response'], result['final_response']+ assert captured['result'] == result # what the classic CLI viewer reads off the receipt+ surface = build_error_surface_from_result(result)+ assert (surface['layer'], surface['code'], surface['retryable']) == ('gateway', 'workspace_unavailable', False)+ finally:+ await owner.close()+ store.close_all_db_handles()