Overview
Implement Phase 4.2 of #1810: add typed ToolDefinition overloads for inline lambda-defined tools.
Before coding
- Do not start any implementation work until this issue is explicitly assigned to the coding agent.
- Base branch for this work:
edburns/1810-java-tool-ergonomics-tool-as-lambda.
- Read this plan file on the branch before coding:
1810-java-tool-ergonomics-tool-as-lambda-remove-before-merge/1810-ignorance-reduction-for-implementation-plan.md
Ordering rule (important)
This issue starts only after 4.1 is merged; all Phase 4 issues are completed in listed order.
Relevant Phase 3 resolutions to apply
- 3.1 API shape: implement v1 overload families and arity decisions from the plan.
- 3.2 ambiguity avoidance: separate sync/async by method families (
from* vs fromAsync*) and use JDK functional interfaces.
- 3.4 behavior parity: support the same parameter-type surface as existing Java tool schema pipeline.
- 3.5 coercion policy: reuse existing ObjectMapper-based conversion behavior.
- 3.6 options flags: options are set via existing immutable fluent modifiers on
ToolDefinition (overridesBuiltInTool, skipPermission, defer) rather than a new options object.
- 3.7 validation boundaries: fail fast with precise
IllegalArgumentException messages.
Scope / deliverables
- Update
java/src/main/java/com/github/copilot/rpc/ToolDefinition.java with the resolved from* overloads.
- Wire overloads to invocation adapter logic so sync/async and context-aware handlers behave correctly.
- Ensure constructed definitions preserve existing runtime contract (
String passthrough, void -> "Success", JSON serialization for non-String, async support).
Gating criteria
- Overloads compile cleanly and are unambiguous at common lambda call sites.
- Invocation paths are ready for unit tests in 4.4.
Constraints
- Keep this issue focused on overload implementation and wiring.
- No unrelated refactors.
Completion bookkeeping
When complete, update the checkbox for Phase 4.2 in:
1810-java-tool-ergonomics-tool-as-lambda-remove-before-merge/1810-ignorance-reduction-for-implementation-plan.md
Overview
Implement Phase 4.2 of #1810: add typed
ToolDefinitionoverloads for inline lambda-defined tools.Before coding
edburns/1810-java-tool-ergonomics-tool-as-lambda.1810-java-tool-ergonomics-tool-as-lambda-remove-before-merge/1810-ignorance-reduction-for-implementation-plan.mdOrdering rule (important)
This issue starts only after 4.1 is merged; all Phase 4 issues are completed in listed order.
Relevant Phase 3 resolutions to apply
from*vsfromAsync*) and use JDK functional interfaces.ToolDefinition(overridesBuiltInTool,skipPermission,defer) rather than a new options object.IllegalArgumentExceptionmessages.Scope / deliverables
java/src/main/java/com/github/copilot/rpc/ToolDefinition.javawith the resolvedfrom*overloads.Stringpassthrough,void -> "Success", JSON serialization for non-String, async support).Gating criteria
Constraints
Completion bookkeeping
When complete, update the checkbox for Phase 4.2 in:
1810-java-tool-ergonomics-tool-as-lambda-remove-before-merge/1810-ignorance-reduction-for-implementation-plan.md