{"record":{"id":"e4d1aea56a998012","repo":"google-gemini/gemini-cli","slug":"error-executing-tool-event-name-displaytext","errorCode":null,"errorMessage":"Error executing tool ${event.name}: ${displayText || errorMsg}","messagePattern":"Error executing tool (.+?): (.+?)","errorType":"exception","errorClass":"FatalToolExecutionError","httpStatus":null,"severity":"critical","filePath":"packages/cli/src/nonInteractiveCliAgentSession.ts","lineNumber":537,"sourceCode":"              const displayText = displayContentToString(display);\n              const errorMsg = getTextContent(event.content) ?? 'Tool error';\n\n              if (event.data?.['errorType'] === ToolErrorType.STOP_EXECUTION) {\n                if (\n                  config.getOutputFormat() === OutputFormat.JSON &&\n                  !responseText &&\n                  preToolResponseText\n                ) {\n                  responseText = preToolResponseText;\n                }\n                const stopMessage = `Agent execution stopped: ${errorMsg}`;\n                if (config.getOutputFormat() === OutputFormat.TEXT) {\n                  process.stderr.write(`${stopMessage}\\n`);\n                }\n              }\n\n              if (event.data?.['errorType'] === ToolErrorType.NO_SPACE_LEFT) {\n                throw new FatalToolExecutionError(\n                  'Error executing tool ' +\n                    event.name +\n                    ': ' +\n                    (displayText || errorMsg),\n                );\n              }\n              handleToolError(\n                event.name,\n                new Error(errorMsg),\n                config,\n                typeof event.data?.['errorType'] === 'string'\n                  ? event.data['errorType']\n                  : undefined,\n                displayText,\n              );\n            }\n            break;\n          }","sourceCodeStart":519,"sourceCodeEnd":555,"githubUrl":"https://github.com/google-gemini/gemini-cli/blob/5024443c7217464a66e98f80d73172a26440bd8f/packages/cli/src/nonInteractiveCliAgentSession.ts#L519-L555","documentation":"Thrown when a tool event carries errorType === ToolErrorType.NO_SPACE_LEFT. This is the only tool error type classified as fatal (see isFatalToolError), because disk-full is an unrecoverable system state. It becomes a FatalToolExecutionError (exit code 54) and the CLI exits immediately rather than letting the model retry.","triggerScenarios":"A tool (typically write-file, edit, or shell) performed a filesystem write that failed with ENOSPC; the tool sets errorType = NO_SPACE_LEFT, which the agent-session loop detects on the tool event and re-throws as FatalToolExecutionError.","commonSituations":"Target disk/partition is full; writing into a tmpfs/overlay with a low size cap (containers, CI); a runaway log/output filled the volume mid-session.","solutions":["Free disk space on the working volume (delete temp files, clear caches, prune docker) and confirm with `df -h`.","Move the workspace/target directory to a volume with adequate free space.","Raise the size limit if running inside a capped container/overlay/tmpfs.","Re-run the session once free space is confirmed; partial writes from the failed turn should be cleaned up."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"import fs from 'node:fs';\n\nfunction freeBytesForPath(p: string): number {\n  return fs.statfsSync(p).bavail * fs.statfsSync(p).bsize;\n}\n// guard before long write-heavy sessions\nif (freeBytesForPath(workspaceRoot) < 500 * 1024 * 1024) {\n  throw new Error('Less than 500MB free; tool writes may fail with NO_SPACE_LEFT');\n}","typeGuard":"import { ToolErrorType } from '@google/gemini-cli-core';\nfunction isNoSpaceLeft(errorType?: string): boolean {\n  return errorType === ToolErrorType.NO_SPACE_LEFT;\n}","tryCatchPattern":"try {\n  await runAgentSession(input);\n} catch (e) {\n  if (e instanceof FatalToolExecutionError) {\n    // exit code 54: disk full (NO_SPACE_LEFT). Free space then re-run.\n    console.error('Disk full. Free space on', workspaceRoot, 'and retry.');\n    process.exit(54);\n  }\n  throw e;\n}","preventionTips":["Ensure the working volume has ample free space before write-heavy sessions.","In containers/CI, raise tmpfs/overlay size caps to exceed expected output.","Monitor disk usage in long-running loops and clean intermediate artifacts."],"tags":["tool","filesystem","disk-full","enospc","fatal"],"backgroundTag":null,"analyzedSha":"5024443c7217464a66e98f80d73172a26440bd8f","analyzedAt":"2026-08-12T06:01:53.711Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}