feat: Structured task management (MCP 2025-11-25)#88
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3d3c40b798
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
lib/mcp_client/task.rb
Outdated
| progress: json['progress'] || json[:progress], | ||
| total: json['total'] || json[:total], | ||
| message: json['message'] || json[:message], | ||
| result: json['result'] || json[:result], |
There was a problem hiding this comment.
Preserve false task results when parsing task JSON
A completed task can validly return false as its result, but from_json currently uses json['result'] || json[:result], which treats false as missing and stores nil instead. That makes get_task/cancel_task callers unable to distinguish “result is false” from “result not present yet,” which changes task semantics for boolean-returning operations.
Useful? React with 👍 / 👎.
lib/mcp_client/task.rb
Outdated
| result['progress'] = @progress if @progress | ||
| result['total'] = @total if @total | ||
| result['message'] = @message if @message | ||
| result['result'] = @result if @result |
There was a problem hiding this comment.
Preserve false task results when serializing tasks
to_h only emits the result field when @result is truthy, so Task.new(..., result: false) serializes as if no result existed. This drops meaningful data for boolean-returning tasks and can break downstream consumers that rely on the presence of an explicit false result.
Useful? React with 👍 / 👎.
c63080f to
929e43b
Compare
929e43b to
9846b89
Compare
9846b89 to
9ed6c36
Compare
Adds tasks/create, tasks/get, tasks/cancel methods with progress tracking via progressToken.