Skip to main content

Module reexec

Module reexec 

Source
Expand description

Re-exec envelope hygiene.

When a CLI execute handler exec’s a detached child of this CLI (via the SDK’s BinaryExecutor) by copying its own request onto the child, the child must NOT inherit the parent’s output transform or token budget. Only the originating top-level invocation carries those.

The rule, applied identically at every such re-exec:

base fieldchild inherits?why
jqNO (stripped)output transform, parent-only
pythonNO (stripped)output transform, parent-only
max_tokensNO (stripped)token budget, parent-only
timeout_secondsYES (kept)the one cap a child honors

Two deliberate non-participants:

  • tools run / plugins run launch foreign tool/plugin binaries (not a re-exec of this CLI) and pass the envelope through verbatim.
  • tasks run re-enters crate::run with a fired schedule’s own stored argv — that command’s flags are its own configuration, not an inherited parent envelope, so they propagate as-is.

Functions§

strip_inherited
Strip the parent-only envelope fields (jq, python, max_tokens) from a typed child request’s base, leaving timeout_seconds intact. Called at every BinaryExecutor re-exec site on the child request before it’s handed to the executor.