Skip to content

Restore automatic execution for Agent task schedules - #773

Merged
1 commit merged into
dataelement:mainfrom
Y1fe1Zh0u:fix/agent-schedule-auto-trigger
Jul 23, 2026
Merged

Restore automatic execution for Agent task schedules#773
1 commit merged into
dataelement:mainfrom
Y1fe1Zh0u:fix/agent-schedule-auto-trigger

Conversation

@Y1fe1Zh0u

Copy link
Copy Markdown
Collaborator

Summary

  • start the legacy AgentSchedule scheduler in worker processes alongside the AgentTrigger daemon
  • allow scheduled execution for active Agent states: creating, running, and idle
  • stop running the one-time AgentSchedule to AgentTrigger migration from restart.sh
  • add regression coverage for worker startup, active and stopped Agent states, and disabled Runtime handling

Root cause

The Agent Tasks UI still saves schedules as AgentSchedule, but worker startup only launched the daemon that scans AgentTrigger. The legacy scheduler was never started, so newly-created Tasks schedules remained stored but had no consumer when they became due. A startup migration could not solve this for schedules created after the service had already started.

Impact

Tasks created from the Agent Tasks page are consumed automatically again. The existing trigger subsystem remains unchanged, and stopped or expired Agents are still excluded from execution.

Timezone interpretation is intentionally not changed in this focused fix and will be handled separately.

Validation

  • pre-fix regression: 3 expected failures reproduced
  • focused scheduler/runtime tests: 18 passed
  • complete backend test suite: 1993 passed
  • Ruff on the changed scheduler and regression tests
  • bash -n restart.sh
  • git diff --check

Not tested

  • deployment and wall-clock execution on the 3010 environment
  • end-user timezone semantics

The Tasks UI still persists legacy AgentSchedule rows, while worker startup only launched the AgentTrigger daemon. Start the existing schedule consumer in the worker role, accept active Agent lifecycle states, and stop auto-migrating schedules during restart.

Constraint: Tasks UI continues to write AgentSchedule in this targeted fix

Rejected: Rely on one-time AgentSchedule migration | schedules created after service startup would remain unconsumed

Confidence: high

Scope-risk: narrow

Directive: Keep timezone semantics out of this fix and address them in the scheduled-task refactor

Tested: 18 focused scheduler/runtime tests; full backend suite with 1993 passing; Ruff on changed scheduler/tests; bash -n restart.sh

Not-tested: 3010 deployment and real wall-clock timezone behavior
Y1fe1Zh0u added a commit that referenced this pull request Jul 22, 2026
The integration branch needs this pull request alongside the other v1.11.2 candidates without changing the original PR state.

Constraint: Preserve the source PR commit and merge in numeric order.
Confidence: high
Scope-risk: moderate
Related: #773
Tested: Git merge completed without unresolved conflicts
Not-tested: Combined backend and frontend suites pending
@Y1fe1Zh0u Y1fe1Zh0u closed this pull request by merging all changes into dataelement:main in 40c1f6b Jul 23, 2026
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