{"record":{"id":"7059fb4214eaef9a","repo":"iOfficeAI/OfficeCLI","slug":"plugin-idle-timeout-7059fb","errorCode":"plugin_idle_timeout","errorMessage":"Exporter plugin '{plugin.Manifest.Name}' produced no output for {idle}s — likely hung.","messagePattern":"Exporter plugin '(.+?)' produced no output for (.+?)s — likely hung\\.","errorType":"exception","errorClass":"CliException","httpStatus":null,"severity":"error","filePath":"src/officecli/Core/Plugins/ExporterInvoker.cs","lineNumber":56,"sourceCode":"            };\n\n        bool residentClosed = false;\n        if (ResidentClient.TryConnect(sourceFullPath, out _))\n        {\n            if (ResidentClient.SendCloseWithResponse(sourceFullPath, out _))\n                residentClosed = true;\n        }\n\n        var idle = plugin.Manifest.ResolveIdleTimeout(\"export\");\n        var result = PluginProcess.Run(new PluginProcess.RunOptions\n        {\n            ExecutablePath = plugin.ExecutablePath,\n            Arguments = new[] { \"export\", sourceFullPath, \"--out\", outPath },\n            IdleTimeoutSeconds = idle,\n        });\n\n        if (result.IdleTimedOut)\n            throw new CliException(\n                $\"Exporter plugin '{plugin.Manifest.Name}' produced no output for {idle}s — likely hung.\")\n            {\n                Code = \"plugin_idle_timeout\",\n                Suggestion = \"Override with --timeout 0 or raise `idle_timeout_seconds.verbs.export` in the plugin's manifest. \" +\n                             \"Long-running exporters should also emit `{\\\"heartbeat\\\":true}` on stderr periodically.\",\n            };\n\n        if (result.ExitCode != 0)\n            throw new CliException(\n                $\"Exporter plugin '{plugin.Manifest.Name}' failed (exit {result.ExitCode}): {Truncate(result.Stderr, 500)}\")\n            {\n                Code = result.ExitCode switch\n                {\n                    2 => \"corrupt_input\",\n                    3 => \"unsupported_feature\",\n                    4 => \"license_expired\",\n                    5 => \"protocol_mismatch\",\n                    6 => \"plugin_idle_timeout\",","sourceCodeStart":38,"sourceCodeEnd":74,"githubUrl":"https://github.com/iOfficeAI/OfficeCLI/blob/1ced45e900782c5083ed550ddf328ee974e425e7/src/officecli/Core/Plugins/ExporterInvoker.cs#L38-L74","documentation":"CliException (code 'plugin_idle_timeout') thrown when the exporter's PluginProcess.Run reports IdleTimedOut — no stdout/stderr activity for `idle` seconds during an export. Idle budget comes from the manifest's idle_timeout_seconds.verbs.export; long-running exporters are expected to emit {\"heartbeat\":true} on stderr to reset the timer.","triggerScenarios":"Exporter plugin stalls mid-export without emitting heartbeats; deadlock; slow network-attached output target.","commonSituations":"Large workbook/presentation export with no progress signalling; plugin blocked on a remote render service; default idle budget too tight for big files.","solutions":["Raise idle_timeout_seconds.verbs.export in the manifest, or pass --timeout 0.","Add periodic {\"heartbeat\":true} writes to stderr in the exporter.","Investigate plugin stalls on the specific source file."],"exampleFix":"// plugin: emit heartbeats during long work\nwhile (working) {\n    Console.Error.WriteLine(\"{\\\"heartbeat\\\":true}\");\n    DoChunk();\n}","handlingStrategy":"retry","validationCode":"var idle = plugin.Manifest.ResolveIdleTimeout(\"export\");\nif (idle > 0 && estimatedSeconds > idle)\n    Console.Error.WriteLine($\"Export may exceed idle budget {idle}s; consider --timeout 0.\");","typeGuard":null,"tryCatchPattern":"try { ExporterInvoker.Run(source, targetExt, outPath); }\ncatch (CliException ex) when (ex.Code == \"plugin_idle_timeout\")\n{ /* retry with raised idle_timeout_seconds.verbs.export or --timeout 0 */ }","preventionTips":["Have exporters emit {\"heartbeat\":true} on stderr during long work.","Size idle_timeout_seconds.verbs.export to the largest expected file.","Use --timeout 0 for known-long unattended exports."],"tags":["plugins","exporter","timeout","idle","cli-exception"],"backgroundTag":null,"analyzedSha":"1ced45e900782c5083ed550ddf328ee974e425e7","analyzedAt":"2026-08-13T13:01:07.193Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}