Inject the active tool call into the Execute context #43

Merged
weichen merged 1 commits from feature/tool-call-context into main 2026-10-10 08:50:13 +00:00
Owner

并行工具执行的前置:runOne 在 Execute 前把当前调用注入 ctx(WithToolCall/ToolCallFromContext,加法),宿主工具包装器据此按调用 ID 配对过程状态。附并行双调用各自读到自己 ID 的回归测试;go test ./... 全绿。

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

并行工具执行的前置:runOne 在 Execute 前把当前调用注入 ctx(WithToolCall/ToolCallFromContext,加法),宿主工具包装器据此按调用 ID 配对过程状态。附并行双调用各自读到自己 ID 的回归测试;go test ./... 全绿。 Refs: Dev 任务 feature/agent-e1-parallel-fixes(F5)。
weichen added 1 commit 2026-10-10 08:48:35 +00:00
Inject the active tool call into the Execute context
ci / vet-and-test (pull_request) Successful in 50s
ci / docker-checkout-hostgateway (pull_request) Successful in 1s
a5da18b710
Why: With parallel tool execution the host-side tool wrapper can no
longer infer which invocation it is serving from a single in-flight
slot; tools need the call identity (ID/name/arguments) to pair process
state and per-call bookkeeping. Context injection keeps the tools
registry signature unchanged.

Evidence: go test ./... green; TestLoopToolSeesOwnCallInContext runs
two parallel calls and asserts each reads its own ID from ctx.

Impact: Additive WithToolCall/ToolCallFromContext helpers; runOne now
wraps the ctx before Execute. Callers that never inject keep ok=false
and are unaffected.

Refs: Dev task feature/agent-e1-parallel-fixes (F5 parallel wiring).
weichen merged commit ef2fa75006 into main 2026-10-10 08:50:13 +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#43