Skip to content

fix(core): reset task TTL on activity - #331

Open
Amit-Amitt wants to merge 1 commit into
nitrocloudofficial:mainfrom
Amit-Amitt:fix/mcp-task-ttl
Open

fix(core): reset task TTL on activity#331
Amit-Amitt wants to merge 1 commit into
nitrocloudofficial:mainfrom
Amit-Amitt:fix/mcp-task-ttl

Conversation

@Amit-Amitt

Copy link
Copy Markdown

Closes #329

Summary

Task TTL cleanup was measured from createdAt, causing long-running tasks to be removed even when they were actively reporting progress.

This changes TTL cleanup to measure inactivity from lastUpdatedAt instead.

Since updateProgress() updates task status and refreshes lastUpdatedAt, progress now effectively resets the TTL.

Changes

  • Use lastUpdatedAt instead of createdAt when checking task expiration.
  • Add a regression test verifying that progress keeps an active task alive past its original creation-based TTL.
  • Add a test verifying that inactive tasks still expire normally.

Testing

  • npm run build passes.
  • Full core test suite passes: 50 test suites, 579 tests.
  • Added TTL cleanup regression coverage.

Notes

npm run lint could not be run because the current @nitrostack/core package does not define a lint script.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: MCP Task TTL is measured from createdAt, so long-running tasks are deleted while still working

1 participant