feat(kanban): support scheduled task start times via scheduled_at#24429
Closed
Interstellar-code wants to merge 3 commits into
Closed
feat(kanban): support scheduled task start times via scheduled_at#24429Interstellar-code wants to merge 3 commits into
Interstellar-code wants to merge 3 commits into
Conversation
Adds scheduled_at (INTEGER, unix epoch) to the tasks table so tasks can be deferred until a specific time. The dispatcher skips tasks whose scheduled_at has not yet arrived. Changes: - Schema: scheduled_at INTEGER column + partial index - Task dataclass: scheduled_at field + from_row parsing - Migration: _add_column_if_missing for existing databases - create_task: accepts scheduled_at parameter - dispatch_once: gates ready-tasks SELECT on scheduled_at <= now - claim_task: gates CAS UPDATE on scheduled_at <= now - kanban_create tool: scheduled_at parameter in schema + handler Backward compatible: NULL scheduled_at = existing behavior unchanged. Refs: NousResearch#24299
f42f606 to
475c2ff
Compare
Contributor
Author
|
The failing |
Prevents ValueError crash in dashboard get_board() when a task has an ISO timestamp (e.g. "2026-05-10T15:00:00Z") instead of a unix epoch int. Adds _to_epoch() helper that normalises both formats.
Contributor
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.
Summary
Adds optional
scheduled_at(INTEGER, unix epoch) column to the Kanbantaskstable. When set, the dispatcher and claim path skip the task untilscheduled_at <= now. WhenNULL(default), existing behavior is unchanged.Closes #24299
Changes
hermes_cli/kanban_db.pyscheduled_at INTEGERcolumn added toCREATE TABLE tasksidx_tasks_scheduled_atpartial index onscheduled_at WHERE scheduled_at IS NOT NULLscheduled_at: Optional[int] = Nonefield +from_rowparsingALTER TABLE tasks ADD COLUMN scheduled_at INTEGER(idempotent)scheduled_atparam, INSERT includes columnAND (scheduled_at IS NULL OR scheduled_at <= ?)guard clausenowadded to param tupletools/kanban_tools.pyscheduled_atfrom args tocreate_task()scheduled_atparameter definitionDesign decisions
created_at,started_at,completed_atconventionreadyin status, just invisible to dispatch until dueAND (scheduled_at IS NULL OR scheduled_at <= ?)applied in bothdispatch_onceandclaim_taskTesting
Live-tested against a running Hermes Agent gateway (v2.3.0-based):
python3 -m py_compile)ALTER TABLEapplied successfully, column appears inPRAGMA table_infoscheduled_atset 2min and 3min in the futurestatus=readywithstarted_at=NULLwhilenow < scheduled_atscheduled_atelapsed, both tasks were picked up by the dispatcher and completed normally (status=done)