fix(ptc): preserve Python spawning and CPU soft limits

This commit is contained in:
Tianyi Cui committed 2026-10-05 19:14:50 +08:00
1 parent 11a0f85b34
commit d7e3746ea1
11 files changed
+79 -47

No files matched your search

@@ -4,13 +4,12 @@ import { readFileSync } from 'node:fs'
/** Small interpreter entry point; bootstrap sources arrive on stdin before model execution. */
export const PYTHON_BOOTSTRAP_LOADER = [
'import json, sys, types',
'_sources = json.load(sys.stdin)',
'_sources = json.load(sys.stdin.buffer)',
'_protocol = types.ModuleType("protocol")',
'_protocol.__file__ = "<dsh-ptc-protocol>"',
'exec(compile(_sources["protocol"], _protocol.__file__, "exec"), _protocol.__dict__)',
'sys.modules["protocol"] = _protocol',
'__file__ = "<dsh-ptc-bootstrap>"',
'exec(compile(_sources["bootstrap"], __file__, "exec"), globals())',
'exec(compile(_sources["bootstrap"], "<dsh-ptc-bootstrap>", "exec"), globals())',
].join('\n')
/**