iOfficeAI/OfficeCLI · error · CliException

plugin_command_failed

plugin_command_failed

Error message

Dump-reader plugin '{plugin.Manifest.Name}' replay aborted: {PluginProcess.LineCallbackError.Message}

What it means

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).

Source

Thrown at src/officecli/Core/Plugins/DumpReaderInvoker.cs:112

                // surface there with the same item-index semantics.
                bufferedLines.Add(line);
            }

            var idle = plugin.Manifest.ResolveIdleTimeout("dump");
            var result = PluginProcess.Run(new PluginProcess.RunOptions
            {
                ExecutablePath = plugin.ExecutablePath,
                Arguments = new[] { "dump", sourceFullPath },
                IdleTimeoutSeconds = idle,
                OnStdoutLine = OnLine,
            });

            // Bubble up the per-line callback error first — its message is more
            // actionable than the generic non-zero exit that follows.
            if (PluginProcess.LineCallbackError is CliException ce)
                throw ce;
            if (PluginProcess.LineCallbackError is not null)
                throw new CliException(
                    $"Dump-reader plugin '{plugin.Manifest.Name}' replay aborted: {PluginProcess.LineCallbackError.Message}",
                    PluginProcess.LineCallbackError)
                { Code = "plugin_command_failed" };

            if (result.IdleTimedOut)
                throw new CliException(
                    $"Dump-reader plugin '{plugin.Manifest.Name}' produced no output for {idle}s — likely hung.")
                {
                    Code = "plugin_idle_timeout",
                    Suggestion = $"Override with --timeout 0 or set a longer `idle_timeout_seconds.verbs.dump` in the plugin's manifest.",
                };

            if (result.ExitCode != 0)
                throw new CliException(
                    $"Dump-reader plugin '{plugin.Manifest.Name}' failed (exit {result.ExitCode}): {Truncate(result.Stderr, 500)}")
                {
                    Code = result.ExitCode switch
                    {

View on GitHub (pinned to 1ced45e900)

Solutions

  1. Inspect the inner exception (PluginProcess.LineCallbackError) in the message to identify the root cause.
  2. Check the plugin process did not crash or close its stdout prematurely.
  3. If reproducible, capture plugin stderr and report against the plugin, not the host.
Defensive patterns

Strategy: try-catch

Try / catch

try { DumpReaderInvoker.Run(source, ext); }
catch (CliException ex) when (ex.Code == "plugin_command_failed" && ex.InnerException is not null)
{ /* log ex.InnerException for root cause; treat as plugin defect */ }

Prevention

When it happens

Trigger: 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.

Common situations: Broken pipe between plugin and host; plugin closes stdout mid-stream; runtime serialization infrastructure throws an unexpected non-Cli exception.

Related errors


AI-assisted analysis of iOfficeAI/OfficeCLI@1ced45e900 (2026-08-13). Data as JSON: /api/errors/348eb1efd64148e1. Report an issue: GitHub.