Skip to content

Durable tasks: pluggable task store and application-hosted tasks (4.2.0) - #81

Merged
benoitc merged 2 commits into
mainfrom
task-providers
Sep 29, 2026
Merged

benoitc merged 2 commits into
mainfrom
task-providers

Conversation

@benoitc

@benoitc benoitc commented Sep 29, 2026

Copy link
Copy Markdown
Member

Lets a task outlive the node, for hornbeam's durable executions.

  • barrel_mcp_task_store behaviour (task_store app env, ETS default). With a durable backend, a task left working on a restarted node becomes failed ("Task interrupted by a restart"); a modern input_required task resumes through tasks/update.
  • barrel_mcp_task_provider behaviour: the application owns id, state, input rounds and cancel. A tool registered with task_provider => Module returns {task, TaskId}. tasks/* and subscriptions/listen look in the store first, then ask each provider, so nothing about the id is kept by barrel_mcp.
  • barrel_mcp_tasks:principal/1 (restart-stable id for the owner's principal) and changed/3 (status notifications for a hosted task).
  • barrel_mcp:task_owner/1, task_allowed/1, register_task_provider/1.
  • Fix: terminal tasks with a ttl were never evicted by the sweep.

Default store and no provider: behaviour unchanged. Guide: guides/durable-tasks.md.

@benoitc
benoitc merged commit accd539 into main Sep 29, 2026
13 checks passed
@benoitc
benoitc deleted the task-providers branch September 29, 2026 21:11
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.

1 participant