v1.0.5 — tighten silent-empty detector (issue #9)
Diagnostic-tightening patch driven by #9, filed by @eyalRonen1 while real-world-testing the v1.0.4 bash workaround from #8.
The bug
Reporter followed the recommended workaround: 2 parallel grok runs (8KB + 9KB output ✓), then a synthesis call with ~18KB combined prompt. The synthesis returned 1 byte (just a newline), exit 0, empty stderr. The plugin's v1.0.1 `diagnoseEmptySpawnFailure` missed this because the check was `if (!r.stdout && !r.stderr)` and `"\n"` is truthy in JS.
Root cause (per Gemini's triage)
The bash workaround inadvertently performs prompt injection by tool-error patterns: the sample outputs contained `browser_tab failed` text (Grok recovering from tool errors via web_search), which looks like grok's own internal tool-call meta-syntax. When concatenated into the synthesis prompt, the model parser likely treats them as live tool calls and triggers an early stop. A synthetic 28KB English test WITHOUT those patterns produced 815 bytes of legitimate output — length isn't the trigger.
Fixed
- New `isWhitespaceOnly()` helper in `companion.mjs`.
- All 3 `diagnoseEmptySpawnFailure` call sites (`runHeadlessGrok`, `cmdImagine`, `runJob` close handler) now use it instead of `!r.stdout && !r.stderr`.
- Banner text expanded to mention the issue-#9 upstream silent-abort path + point at the eventual `/grok:aggregate-of-n` v1.1.0 fix.
Upstream
Submitted to xAI via grok's built-in `/feedback` channel. Submission id: `94e62200-3fa5-495c-bf4a-e18b107a0b34`. The model-layer fix has to come from xAI.
Tests
6 new behavioral tests covering 1-byte newline triggering across all 3 call sites at both exit codes. 386 tests total (381 passing + 5 integration skipped).
Update
`/plugin` → `Manage installed plugins` → `grok@grok-plugin-cc` → `Update` → `/reload-plugins`.