You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor: Extract getTaskOrThrow helper for task handlers (#1069)
## Summary
- Addresses one item from the checklist in #1066 ("getTaskOrThrow
helper").
- `GetTaskRequestSchema`, `GetTaskPayloadRequestSchema`, and
`CancelTaskRequestSchema` each duplicated the same "fetch task, softFail
+ throw McpError if missing" block, differing only in the log tag used
for the softFail call.
- Extracted a single private `getTaskOrThrow(taskId, mcpSessionId,
logTag)` helper and call it from all three handlers.
No behavior change — same softFail log call, same error code/message,
same control flow, just de-duplicated.
## Test plan
- [x] `pnpm run type-check`
- [x] `pnpm run lint` (0 warnings/errors)
- [x] `pnpm run test:unit` (1023 passed, 2 skipped)
- [x] `pnpm run format`
- [x] `pnpm run check:agents`
Co-authored-by: Chris Brown <albatrossflyon1@gmail.com>
0 commit comments