Skip to content

fix(runtime): keep PTY tool results JSON-safe - #2209

Merged
Astro-Han merged 1 commit into
mainfrom
fix/runtime-pty-result-json
Aug 5, 2026
Merged

fix(runtime): keep PTY tool results JSON-safe#2209
Astro-Han merged 1 commit into
mainfrom
fix/runtime-pty-result-json

Conversation

@Astro-Han

Copy link
Copy Markdown
Contributor

Summary

  • Omit lastAlternateScreen from projected PTY output when it has no model-visible text instead of materializing the optional field as undefined.
  • Cover a stopped PTY background task result at the durable RuntimeEvent serialization boundary.

Verification

  • node --test packages/runtime/dist/__tests__/shell-run-tool-result.test.js (9 passed)
  • npm run format:check
  • npm run lint
  • npm test -w @maka/runtime (3,156 passed, 9 skipped; 2 unrelated deep-research tests could not open a stale local storage build reporting schema 10 as newer than supported schema 9)

Root cause

projectPtyOutputForModel produced an own lastAlternateScreen: undefined property when a PTY had no alternate-screen text. The durable RuntimeEvent writer correctly rejects nested undefined because it cannot be represented losslessly in JSON, so a successful StopBackgroundTask side effect failed at the T2 outcome commit and left the turn failed.

@Astro-Han
Astro-Han marked this pull request as ready for review August 5, 2026 08:20
@Astro-Han
Astro-Han merged commit bc82c0f into main Aug 5, 2026
11 checks passed
@Astro-Han
Astro-Han deleted the fix/runtime-pty-result-json branch August 5, 2026 08:20
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