feat(sdk/agent): Handoff DSL; deprecate sdk-internal tool implementations (4/4)#77
Merged
Merged
Conversation
…ions
- sdk/agent.Handoff: declarative inter-agent control transfer.
- Handoff / HandoffArgs / HandoffEvent value types.
- HandoffTool builds an LLM-callable tool.Tool from a Handoff entry.
- HandoffTools(ctx, req, hs) filters available handoffs per request.
- HandoffDecider observes BeforeFinalize, detects the first matching
handoff tool call, records HandoffEvent on the board, and signals
finalize via HandoffFinalizeReason.
- HandoffFromResult retrieves the recorded event from a Result.
- DefaultHandoffToolName(agentID) gives the canonical tool naming.
- Deprecate sdk-internal LLM tool implementations (scheduled for v0.3.0
migration to sdkx/tool/...):
- sdk/knowledge: NewSearchServiceTool, NewPutServiceTool.
- sdk/kanban: SubmitTool, TaskContextTool, WithKanban, KanbanFrom.
- sdk/history: ToolDeps, RegisterTools.
All keep their current behavior; only // Deprecated: comments are added.
sdk/agent.Handoff is intentionally NOT deprecated — it is an internal
agent-orchestration primitive that belongs in sdk.
- docs/migrations/v0.3.0.md: migration guide covering the sdk <-> sdkx
layering rule, the tool relocation table, and the sdk/workflow removal.
- .gitignore: allow docs/migrations/** under the existing whitelist.
Additive only; no behavior changes. This is the final PR of the v0.2.x
batch and intentionally omits the [skip-tag:sdk] marker so the cumulative
sdk/v0.2.9 tag is cut on merge.
Co-authored-by: Cursor <cursoragent@cursor.com>
Previous version only listed the tool-relocation table and the sdk/workflow deletion. v0.3.0 actually removes deprecated surface across many more packages — sdk/llm round helpers, sdk/graph runner shims, sdk/script/bindings workflow couplings, sdk/knowledge legacy storage and search types, sdk/history closers and manifest helpers, sdk/retrieval debug fields, plus the chat-application Var* constants. Restructure the document around per-package sections, point each one at its canonical deprecated.go index, and call out the new sdkx/tool packages that will land in parallel. Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Final PR (4 of 4) in the v0.2.x additive SDK batch. No
[skip-tag:sdk]marker — merging this PR triggers the cumulative
sdk/v0.2.9tag coveringPRs #74, #75, #76, and this one.
sdk/agent — Handoff DSL
Declarative inter-agent control transfer that surfaces as an LLM-callable tool:
Handoff/HandoffArgs/HandoffEventvalue types describing intent.HandoffTool(h)— builds atool.Toolfrom aHandoffentry; the toolsignals intent only and never mutates the board directly.
HandoffTools(ctx, req, hs)— request-scoped filter over available handoffs(per-Request
Filtercallback, agent allow-listing, etc.).HandoffDecider(hs)—agent.Deciderthat observesBeforeFinalize,detects the first matching handoff tool call, records the event on the
board under
HandoffStateKey, and triggers finalize viaHandoffFinalizeReason.HandoffFromResult(res)retrieves the event from anagent.Result.DefaultHandoffToolName(agentID)for canonical naming.Handoffstays insdk/agentrather thansdkx/tool/...because it is aninternal agent-orchestration primitive — it has no external protocol surface
and is consumed by
agent.Runitself.Deprecation: sdk-internal LLM tool implementations
Marked
// Deprecated:(no behaviour change) and scheduled for migration tosdkx/tool/...in v0.3.0:sdk/knowledgeNewSearchServiceTool,NewPutServiceToolsdkx/tool/knowledgesdk/kanbanSubmitTool,TaskContextTool,WithKanban,KanbanFromsdkx/tool/kanbansdk/historyToolDeps,RegisterToolssdkx/tool/historyRationale:
sdkshould host stable interfaces and engine primitives; concreteLLM tool implementations belong in
sdkx, mirroring the existingsdkx/llm/...provider layout. Migration guide in
docs/migrations/v0.3.0.md.docs/migrations/v0.3.0.md
Walks through:
sdk↔sdkxlayering rule and why these tools relocate.sdk/agent.Handoffstays insdk.sdkx/tool/memory(Anthropic-compatible) andsdkx/tool/mcpclients.sdk/workflowdeletion (already deprecated)..gitignore
Adds
!docs/migrations/and!docs/migrations/**to the whitelist so thenew migration doc tracks.
docs/roadmap.mdremains intentionally ignored.Test plan
go vet ./sdk/agent/... ./sdk/history/... ./sdk/kanban/... ./sdk/knowledge/...go test ./sdk/agent/... ./sdk/history/... ./sdk/kanban/... ./sdk/knowledge/... -count=1sdk/agent/handoff_test.gocoversDefaultHandoffToolName,HandoffTooldefinition + panic handling,OnInvokecallback,HandoffToolsfilter behaviour,HandoffDeciderfirst-match-wins andno-match paths, and
HandoffFromResultsafety on missing state.existing tests in
sdk/{knowledge,kanban,history}remain green.Release notes
This PR is additive only. Merging it cuts
sdk/v0.2.9(cumulative acrossPRs #74, #75, #76, and this one). All v0.2.x changes are backwards-compatible;
breaking changes land in v0.3.0 per the migration guide.
Made with Cursor