ticket: close tool execution context

This commit is contained in:
Keisuke Hirata 2026-06-09 19:47:01 +09:00
parent 89e768a658
commit c5a022bbdf
No known key found for this signature in database
3 changed files with 76 additions and 2 deletions

View File

@ -1,8 +1,8 @@
---
title: 'Tool実行にToolExecutionContextを渡す'
state: 'inprogress'
state: 'closed'
created_at: '2026-06-09T09:30:50Z'
updated_at: '2026-06-09T10:43:02Z'
updated_at: '2026-06-09T10:46:50Z'
assignee: null
queued_by: 'workspace-panel'
queued_at: '2026-06-09T10:01:00Z'

View File

@ -0,0 +1,29 @@
Implemented, reviewed, merged, and validated.
Summary:
- Added `ToolExecutionContext` with `call_id`, `batch_id`, and `call_index`.
- Changed Tool execution APIs so `Tool::execute` / `ToolServer::call_tool` receive execution context.
- Worker assigns one response-local batch id per approved tool-call batch and preserves LLM-returned call order with `call_index`.
- Approved tool calls still execute in parallel; no scheduler, same-file mutex, mutation queue, conflict solver, or `parallel_tool_calls=false` behavior was added.
- `ToolCallInfo` / `ToolResultInfo` expose context metadata.
- Macro-generated tools can receive `ToolExecutionContext` as a non-schema parameter; context is not exposed as an LLM JSON argument.
- Built-in tools and tests were migrated to the new API.
Implementation:
- Coder commit: `d8aed7b tool: add execution context`
- Reviewer approved with no blocking findings.
- Merge commit: `4744548 merge: add tool execution context`
Validation after merge:
- `cargo test -p llm-worker --test parallel_execution_test test_tool_execution_context -- --nocapture`
- `cargo test -p llm-worker --test parallel_execution_test test_parallel_tool_execution -- --nocapture`
- `cargo test -p llm-worker --test tool_macro_test -- --nocapture`
- `cargo check -p llm-worker -p tools -p ticket`
- `cargo fmt --check`
- `git diff --check`
- `cargo run -q -p yoi -- ticket doctor`
- `cargo check --workspace`
- `nix build .#yoi`
Residual note:
- `batch_id` is Worker-local and not a durable/global external artifact key.

View File

@ -221,3 +221,48 @@ Reviewer validation:
All passed. Residual note: `batch_id` is Worker-local (`tool-batch-{n}`), not a durable/global identity across process/session reconstruction. This is acceptable for this Ticket but should not be treated as a persistent external artifact key without a future design.
---
<!-- event: state_changed author: hare at: 2026-06-09T10:46:50Z from: inprogress to: closed reason: closed field: state -->
## State changed
Ticket を closed にしました。
---
<!-- event: close author: hare at: 2026-06-09T10:46:50Z status: closed -->
## 完了
Implemented, reviewed, merged, and validated.
Summary:
- Added `ToolExecutionContext` with `call_id`, `batch_id`, and `call_index`.
- Changed Tool execution APIs so `Tool::execute` / `ToolServer::call_tool` receive execution context.
- Worker assigns one response-local batch id per approved tool-call batch and preserves LLM-returned call order with `call_index`.
- Approved tool calls still execute in parallel; no scheduler, same-file mutex, mutation queue, conflict solver, or `parallel_tool_calls=false` behavior was added.
- `ToolCallInfo` / `ToolResultInfo` expose context metadata.
- Macro-generated tools can receive `ToolExecutionContext` as a non-schema parameter; context is not exposed as an LLM JSON argument.
- Built-in tools and tests were migrated to the new API.
Implementation:
- Coder commit: `d8aed7b tool: add execution context`
- Reviewer approved with no blocking findings.
- Merge commit: `4744548 merge: add tool execution context`
Validation after merge:
- `cargo test -p llm-worker --test parallel_execution_test test_tool_execution_context -- --nocapture`
- `cargo test -p llm-worker --test parallel_execution_test test_parallel_tool_execution -- --nocapture`
- `cargo test -p llm-worker --test tool_macro_test -- --nocapture`
- `cargo check -p llm-worker -p tools -p ticket`
- `cargo fmt --check`
- `git diff --check`
- `cargo run -q -p yoi -- ticket doctor`
- `cargo check --workspace`
- `nix build .#yoi`
Residual note:
- `batch_id` is Worker-local and not a durable/global external artifact key.
---