Skip to content

fix(runner): a terminal process result always persists as valid content - #66

Merged
wolfy-j merged 1 commit into
masterfrom
fix/terminal-result-persistable
Aug 8, 2026
Merged

fix(runner): a terminal process result always persists as valid content#66
wolfy-j merged 1 commit into
masterfrom
fix/terminal-result-persistable

Conversation

@wolfy-j

@wolfy-j wolfy-j commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

A node process that dies with a non-plain-data value (a raw error object, userdata, a coroutine) had that value queued verbatim as node.result content. The persist layer binds it as SQL NULL, dataflow_data.content is NOT NULL, and the violation fails the entire completion batch — which is then retained and retried forever, ending in runtime_owner_lost with the run stranded and its error routing never executed.

handle_process_exit now normalizes: strings/numbers/booleans/tables persist as-is, anything else as tostring(), nil falls back to Completed/Failed. Failures therefore persist, error targets route, and downstream retry surfaces see a real failure instead of a stuck run.

Observed in production: an OpenAI 400 (non-retryable) killed an agent process with a raw error value; the run hung indefinitely.

Tests: 963 sqlite suite green (two new cases: non-encodable terminal result, poison table).

A process can exit with any value the runtime hands back — a raw error,
userdata, a coroutine. Persisting such a value as node.result content
binds SQL NULL, which poisons the whole completion batch and strands the
run as runtime_owner_lost. Anything that is not plain data now persists
as its string form.
@wolfy-j
wolfy-j merged commit bc50465 into master Aug 8, 2026
8 checks passed
@wolfy-j
wolfy-j deleted the fix/terminal-result-persistable branch August 8, 2026 19:58
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.

1 participant