Run serial-flagged tool calls in order while others fan out #44

Merged
weichen merged 1 commits from feature/serial-tools-partition into main 2026-10-10 09:01:03 +00:00
Owner

并行执行下仅靠互斥不保序(backend 流式卡测试实测乱序)。新增 Config.SerialTools:并行模式中命中集合的调用按模型声明顺序在调用方 goroutine 逐个执行,其余并发;空集合=原全并行,sequential 模式不变。附保序回归测试(s1→s2→s3);go test ./... 全绿。

Refs: Dev 任务 feature/agent-e1-parallel-fixes(F5)。

并行执行下仅靠互斥不保序(backend 流式卡测试实测乱序)。新增 Config.SerialTools:并行模式中命中集合的调用按模型声明顺序在调用方 goroutine 逐个执行,其余并发;空集合=原全并行,sequential 模式不变。附保序回归测试(s1→s2→s3);go test ./... 全绿。 Refs: Dev 任务 feature/agent-e1-parallel-fixes(F5)。
weichen added 1 commit 2026-10-10 08:59:06 +00:00
Run serial-flagged tool calls in order while others fan out
ci / vet-and-test (pull_request) Successful in 54s
ci / docker-checkout-hostgateway (pull_request) Successful in 1s
7f60baeaf8
Why: Mutual exclusion alone does not preserve order. With parallel
execution the host cannot keep order-sensitive tools (card streaming
begin/append/commit, plan updates) correct by locking a mutex, because
whichever goroutine grabs the lock first is not necessarily the first
declared call - a real failure observed in the backend card-stream test.

Evidence: go test ./... green; TestLoopSerialToolsKeepOrder asserts the
serial calls execute in declaration order (s1->s2->s3) while parallel
calls still fan out.

Impact: New Config.SerialTools set. In parallel mode, matching calls run
sequentially on the caller goroutine in model-declared order; others
stay concurrent. Empty set keeps the previous all-parallel behavior;
sequential mode is untouched.

Refs: Dev task feature/agent-e1-parallel-fixes (F5).
weichen merged commit c348441691 into main 2026-10-10 09:01:03 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: weichen/Agent-Native#44