v4.2.6 — PTC supports parallel execution (delegation tools fan out from program scripts)#86
Merged
Merged
Conversation
…s out
The program/PTC VM runs on a nested single-thread runtime, so parallel_task's
child agents couldn't actually run in parallel — delegation in a script was
broken (and was blocked in 4.2.3). Now execute_host_tool_json captures the
OUTER multi-threaded session runtime Handle and spawns the tool there, so
ctx.tool('parallel_task', …) fans out child agents in parallel. Re-allow
task/parallel_task in script_allowed_tools. Bumps to 4.2.6.
3f09dfb to
7bf4f0d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Makes
ctx.tool('parallel_task', …)inside aprogram/PTC script actually fan out child agents in parallel — the missing piece for script-driven dynamic workflows.Root cause: the PTC VM runs on a nested
new_current_threadruntime (insidespawn_blocking), soparallel_task'stokio::spawned child agent loops ran cooperatively on that single thread — no real parallelism. 4.2.3 worked around it by strippingtask/parallel_taskfrom PTC scripts.Fix:
run_quickjs_scriptcaptures the OUTER multi-threaded session runtimeHandle::current();execute_host_tool_jsonnowouter.spawn(...)s the tool there, so a tool's child agents run on the multi-thread runtime and fan out. Re-allowedtask/parallel_taskinscript_allowed_tools.Test:
program_tool_allows_delegation_tools_in_scripts; builds clean (Send-safe). Bumps to 4.2.6 (versions aligned). Unblocks the CLI's script-driven ultracode workflows.