Skip to content

fix(batch): preserve per-item warnings across CLI and MCP - #355

Open
y4ho0 wants to merge 1 commit into
iOfficeAI:mainfrom
y4ho0:fix/batch-warning-propagation
Open

fix(batch): preserve per-item warnings across CLI and MCP#355
y4ho0 wants to merge 1 commit into
iOfficeAI:mainfrom
y4ho0:fix/batch-warning-propagation

Conversation

@y4ho0

@y4ho0 y4ho0 commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Summary

  • capture WarningContext diagnostics separately for each batch item
  • propagate Word add/set advisories, including dangling-style warnings, into the corresponding results[] entry
  • print per-item warnings in text mode and preserve them in the large-output spill response

The capture happens in the shared batch loop, so non-resident CLI, resident, MCP, and in-process batch execution inherit the same behavior.

Why

Batch items call the shared document handlers directly and bypass the standalone add/set wrappers that normally add handler warnings to their output. A successful mutation could therefore silently lose an advisory that the equivalent standalone command exposed.

Scope

This PR only restores warning propagation. It does not materialize missing Word styles or add downstream dangling-style validation.

Validation

  • dotnet build src/officecli/officecli.csproj -c Release --no-restore — passed with 0 errors; only the pre-existing nullable warning in ExcelHandler.SheetShift.cs
  • plain and JSON DOCX batch add — advisory visible, exit 0
  • JSON batch set — advisory visible on the corresponding result, exit 0
  • resident batch — advisory preserved
  • MCP batch — warning present in the returned text content with isError=false
  • 180-item JSON batch — triggered the outputFile spill path and retained the warning in the slim response
  • git diff --check — passed

Fixes #350

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docx: batch drops the dangling-style warning (stdout, --json, MCP); the resulting pStyle passes validate and view issues

1 participant