Repository navigation
fix(mcpx/tasks): preserve backing-task retention floor under maxAge (#6249) - #8131
Conversation
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 49 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
What
Fixes #6249:
tasks.maxAgecould override the two-poll-interval retention floor thatStartWithDeadlinedeliberately sets for internal backing (deadline) tasks.The bug, re-verified at current main
StartWithDeadlinefloors a deadline task's TTL at 2× the poll interval (Codex on #2869), butarmRetentionLockedrecomputed expiry throughdeadline()whose maxAge ceiling has no floor — withtasks.maxAge=100msagainst a 1s poll, a finished backing result was deleted before the ask wrapper's next poll, whose 404 recorded a successful call as failed (Codex finding on PR #5754, never answered; this PR does not touch that thread, per the issue's scope).The fix
Taskgains an unexportedretentionFloor(2× poll interval), set byStartWithDeadlinefor deadline tasks only.Task.retentionDeadline()wrapsdeadline(): the maxAge ceiling still bounds retention above the floor, but never below it. Used at both arming sites (armRetentionLocked,touchLocked).TestTaskMaxAgeStartsAtTerminalTransitionAndReadCannotReviveExpirystill passes).Tests
New
TestAMaxAgeClampCannotOverrideDeadlineRetentionFloor(oracle: PollInterval 400ms + maxAge 100ms — a finished backing task's expiry is ≥ terminal+800ms and the result is collectable past the ceiling; a plain task under the same maxAge keeps the exact 100ms ceiling).go test ./internal/tasks/ -count=1— full package pass on the laptop, plus the four retention tests run individually.Task 14487 (queue repo-health-code-pilot), lane code-w.
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.