{"record":{"id":"348eb1efd64148e1","repo":"iOfficeAI/OfficeCLI","slug":"plugin-command-failed","errorCode":"plugin_command_failed","errorMessage":"Dump-reader plugin '{plugin.Manifest.Name}' replay aborted: {PluginProcess.LineCallbackError.Message}","messagePattern":"Dump-reader plugin '(.+?)' replay aborted: (.+?)","errorType":"exception","errorClass":"CliException","httpStatus":null,"severity":"error","filePath":"src/officecli/Core/Plugins/DumpReaderInvoker.cs","lineNumber":112,"sourceCode":"                // surface there with the same item-index semantics.\n                bufferedLines.Add(line);\n            }\n\n            var idle = plugin.Manifest.ResolveIdleTimeout(\"dump\");\n            var result = PluginProcess.Run(new PluginProcess.RunOptions\n            {\n                ExecutablePath = plugin.ExecutablePath,\n                Arguments = new[] { \"dump\", sourceFullPath },\n                IdleTimeoutSeconds = idle,\n                OnStdoutLine = OnLine,\n            });\n\n            // Bubble up the per-line callback error first — its message is more\n            // actionable than the generic non-zero exit that follows.\n            if (PluginProcess.LineCallbackError is CliException ce)\n                throw ce;\n            if (PluginProcess.LineCallbackError is not null)\n                throw new CliException(\n                    $\"Dump-reader plugin '{plugin.Manifest.Name}' replay aborted: {PluginProcess.LineCallbackError.Message}\",\n                    PluginProcess.LineCallbackError)\n                { Code = \"plugin_command_failed\" };\n\n            if (result.IdleTimedOut)\n                throw new CliException(\n                    $\"Dump-reader 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 set a longer `idle_timeout_seconds.verbs.dump` in the plugin's manifest.\",\n                };\n\n            if (result.ExitCode != 0)\n                throw new CliException(\n                    $\"Dump-reader plugin '{plugin.Manifest.Name}' failed (exit {result.ExitCode}): {Truncate(result.Stderr, 500)}\")\n                {\n                    Code = result.ExitCode switch\n                    {","sourceCodeStart":94,"sourceCodeEnd":130,"githubUrl":"https://github.com/iOfficeAI/OfficeCLI/blob/1ced45e900782c5083ed550ddf328ee974e425e7/src/officecli/Core/Plugins/DumpReaderInvoker.cs#L94-L130","documentation":"CliException (code 'plugin_command_failed') wrapping any non-CliException error recorded by PluginProcess.LineCallbackError during the dump-reader replay. CliException callbacks are rethrown unwrapped (line 109); this path catches everything else (e.g. IOException, InvalidOperationException from stream parsing).","triggerScenarios":"An exception bubbles up during the OnLine per-line callback that is not a CliException — typically a low-level IO or runtime error in the host's line buffering path.","commonSituations":"Broken pipe between plugin and host; plugin closes stdout mid-stream; runtime serialization infrastructure throws an unexpected non-Cli exception.","solutions":["Inspect the inner exception (PluginProcess.LineCallbackError) in the message to identify the root cause.","Check the plugin process did not crash or close its stdout prematurely.","If reproducible, capture plugin stderr and report against the plugin, not the host."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { DumpReaderInvoker.Run(source, ext); }\ncatch (CliException ex) when (ex.Code == \"plugin_command_failed\" && ex.InnerException is not null)\n{ /* log ex.InnerException for root cause; treat as plugin defect */ }","preventionTips":["Always inspect the inner exception — the outer message is generic.","Capture plugin stderr/stdout to correlate with callback failures.","Treat non-Cli callback errors as plugin defects, not host bugs."],"tags":["plugins","dump-reader","io","cli-exception"],"backgroundTag":null,"analyzedSha":"1ced45e900782c5083ed550ddf328ee974e425e7","analyzedAt":"2026-08-13T13:01:07.193Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}