Root-causes the Grok CLI empty-response bug: readline close no longer finalizes the session before the subprocess close event can attach exit code/stderr diagnostics, so failures were silently swallowed as empty assistant messages.
- Wait for subprocess close/error (not readline close) to finalize the Grok CLI session, so non-zero exits can attach stderr before callers inspect the result
- Add GrokSession.state.errorMessage to carry concrete diagnostics (spawn failure, process error, non-zero exit + stderr, or NDJSON error event) through the resolve-never-reject runtime contract
- Track whether any text was received so error diagnostics are only recorded when the run actually produced nothing
- Add a changeset documenting the fix for @runfusion/fusion
- Extend runtime-adapter tests to cover spawn failure, process error, non-zero exit with/without stderr, and NDJSON error-event diagnostics
Files changed:
.changeset/fn-7782-grok-cli-no-response.md | 7 ++
.../src/__tests__/runtime-adapter.test.ts | 98 ++++++++++++++++++++--
.../src/runtime-adapter.ts | 75 +++++++++++++----
plugins/fusion-plugin-grok-runtime/src/types.ts | 1 +
4 files changed, 161 insertions(+), 20 deletions(-)
Fusion-Task-Id: FN-7782
Fusion-Task-Lineage: c2907a70-0556-488f-bda3-132657b64071
Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>