Skip to content

fix: dispatch.zig — surface OOM and spawn failures instead of silent fallback (#430)#435

Open
yxlyx wants to merge 1 commit intomainfrom
fix/430-dispatch-silent-failures
Open

fix: dispatch.zig — surface OOM and spawn failures instead of silent fallback (#430)#435
yxlyx wants to merge 1 commit intomainfrom
fix/430-dispatch-silent-failures

Conversation

@yxlyx
Copy link
Copy Markdown
Collaborator

@yxlyx yxlyx commented Apr 10, 2026

Summary

  • OOM during system prompt concatenation now logs [dispatch] OOM: system prompt dropped via std.debug.print instead of silently degrading
  • dispatch() checks if backend produced any output; writes a sentinel error message if out is unchanged, so MCP callers know the run failed
  • Added 2 unit tests for the sentinel logic (empty output gets sentinel, non-empty output is untouched)

Test plan

  • zig ast-check src/runtime/dispatch.zig passes
  • New: empty output sentinel is written when backend produces nothing
  • New: non-empty output does not get sentinel appended
  • Existing Backend.label test unchanged

Fixes #430

Made with Cursor

- OOM in system prompt concatenation now logs via std.debug.print
  instead of silently dropping the system prompt
- dispatch() writes an error sentinel to out when backend produces
  no output, so the MCP caller knows the run failed
- Added 2 unit tests for the sentinel logic

Fixes #430

Made-with: Cursor
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.

bug: dispatch.zig silently swallows OOM and process spawn failures

1 participant