CChildHarbor
Product

Product features · Timed Python child execution

01

Review trusted_child.py as a trusted-code process wrapper, checking the return code and direct-child cleanup instead of assuming isolation.

01

Connection

Base URL, credentials and a reachable server.

02

Selection

A model available through the configured endpoint.

03

Capabilities

Context limits and tool support are determined by the model and server.

Timed Python child execution

● ● ●ChildHarbor●
A concrete starting point · Timed Python child execution ×
import math, os, subprocess, sys
from pathlib import Path

def run_trusted_python(script, seconds, folder):
    if type(script) is not str or len(script) > 4096:
        raise ValueError("child.script")
    if type(seconds) not in (int, float) or not .05 <= seconds <= 5 or not math.isfinite(seconds):
        raise ValueError("child.timeout")
    if not isinstance(folder, (str, Path)) or not Path(folder).is_dir():
        raise ValueError("child.folder")
    return subprocess.run([sys.executable, "-I", "-S", "-X", "utf8", "-c", script],
        cwd=folder, timeout=seconds, capture_output=True, text=True,
        encoding="utf-8", check=False,
        creationflags=subprocess.CREATE_NO_WINDOW if os.name == "nt" else 0)
✳Timed Python child execution
✓ ChangesReview before applying ↗
Illustrative workspace
AI coding workspace

Your next change starts here.

Get the Windows app ↗