Repository navigation
Conversation
Only sessionTtlMs, allowedOrigins and taskMaxRetainedPerPrincipal were checked at registration; taskLeaseMs, taskDefaultTtlMs and taskMaxTtlMs were used as given. A zero lease lapsed immediately and failed every task, and a NaN or negative ttl (e.g. Number(process.env.X) when unset) made every task expire at once, all surfacing only at runtime. Registration now requires each of them to be a positive safe integer and throws a TypeError naming the option otherwise. An explicit taskDefaultTtlMs above the resolved taskMaxTtlMs (default 1 hour) is also rejected, since it would be silently capped. Validation runs before any Redis connection is opened. Fixes #302 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UF4S3w7iA83V9DVsasLJzM
Throwing when the default ttl exceeds the ceiling rejects configurations that work today (the default is silently capped), which would make this a breaking change. Keep the existing capping here and only reject values that already broke every task; enforcing the ceiling is left to a separate change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UF4S3w7iA83V9DVsasLJzM
This branch has not been deployed
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.
Only
sessionTtlMs,allowedOriginsandtaskMaxRetainedPerPrincipalwere validated at registration.taskLeaseMs,taskDefaultTtlMsandtaskMaxTtlMswere used as given, sotaskLeaseMs: 0failed every task within milliseconds andtaskDefaultTtlMs: NaNor-5made every task expire at once. These errors only showed up at runtime.Changes:
taskLeaseMs,taskDefaultTtlMsandtaskMaxTtlMsmust be positive safe integers. Otherwise registration throws aTypeErrornaming the option. This check runs whether or notenableTasksis set, and before any Redis connection is opened.undefinedstill means "use the default".taskDefaultTtlMsabovetaskMaxTtlMsis still accepted and capped, as before, so working configurations keep loading. Rejecting it is a separate, breaking change.test/task-options-validation.test.ts.The values now rejected (zero, negative,
NaN,Infinity) already broke tasks at runtime. Non-numbers such as numeric strings were already type errors underMCPPluginOptions.The issue also lists
taskShutdownTimeoutMs,taskMaxConcurrent,taskMaxPerPrincipalandtaskStoreMaxTasks. None of these exist inMCPPluginOptions. The per-principal cap istaskMaxRetainedPerPrincipal, which was already validated and now has tests. The in-memory store's 1000-task cap cannot be configured.Fixes #302
🤖 Generated with Claude Code
https://claude.ai/code/session_01UF4S3w7iA83V9DVsasLJzM