Skip to content

v4.2.6 — PTC supports parallel execution (delegation tools fan out from program scripts)#86

Merged
ZhiXiao-Lin merged 1 commit into
mainfrom
fix/ptc-parallel
Jun 26, 2026
Merged

v4.2.6 — PTC supports parallel execution (delegation tools fan out from program scripts)#86
ZhiXiao-Lin merged 1 commit into
mainfrom
fix/ptc-parallel

Conversation

@ZhiXiao-Lin

Copy link
Copy Markdown
Contributor

Makes ctx.tool('parallel_task', …) inside a program/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_thread runtime (inside spawn_blocking), so parallel_task's tokio::spawned child agent loops ran cooperatively on that single thread — no real parallelism. 4.2.3 worked around it by stripping task/parallel_task from PTC scripts.

Fix: run_quickjs_script captures the OUTER multi-threaded session runtime Handle::current(); execute_host_tool_json now outer.spawn(...)s the tool there, so a tool's child agents run on the multi-thread runtime and fan out. Re-allowed task/parallel_task in script_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.

…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.
@ZhiXiao-Lin ZhiXiao-Lin merged commit 6286ec4 into main Jun 26, 2026
2 checks passed
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