modelcontextprotocol / modelcontextprotocol/php-sdk
[Server] SEP-2663 Tasks: Handlers return task handles; the application advances the task
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- PHP
- Star
- 1.6k
- Fork
- 173
- Merge trung bình
- 2 ngày 49 phút
- Pull request đã merge (30 ngày)
- 23
Mô tả
Execution model for SEP-2663 for the 2026-07-28 release. Tracked by umbrella #335.
Decision
The SDK owns storage and the tasks/* surface; advancing a task is the application's job. PHP has no in-process background executor to build on, and picking a queue or process model on the user's behalf would be the wrong call for a framework-agnostic SDK.
Scope
- Any tool, prompt or resource handler may return a
CreateTaskResult(viaTaskContext::create()) instead of its usual result; the core handlers pass anyResultInterfacea handler returns through untouched, so no core code knows about tasks. - What happens next is application code: enqueue something a worker picks up, and have the worker call
$store->save($task->with(...))as it progresses.TaskContext::getStore()gives a handler the store for a task it did not create in this request. TaskInputHandlerInterfaceis the hook for what an answer to a parked (input_required) task means;TasksUpdateHandlerdelegatesinputResponsesto it.- No
#[McpTool]task-eligibility marker and no early-return path inReferenceHandler: whether to create a task is the handler's decision, made per request.
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu bằng cách đọc TaskContext::create(), TaskContext::getStore(), TaskInputHandlerInterface và TasksUpdateHandler. Theo dõi cách các handler trả về các giá trị ResultInterface và cách store lưu tiến trình của task; hoàn thành có nghĩa là kết quả của task được truyền qua, input của parked-task được ủy quyền đúng cách và mã ứng dụng có thể tiếp tục các task mà không cần logic dành riêng cho task trong core.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- php
- Lĩnh vực
- api, backend
- Loại issue
- Tính năng
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức độ hoạt động
- Ít trao đổi
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 35/100