codex-team / codex-team/manager-ai

Task is added again each time being run

Open
#18 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
1
Forks
1
PR merge metrics
No merged PRs in 30d

Description

Each run leads to the repeated insertion of tasks into database and apscheduler.

Before N-th run there is 5 documents:
![](https://capella.pics/83cf76e8-1eda-494b-a934-0a564ed6d5c9.jpg)

After N-th run there is already 7 documents.
```
(39495) 19 Nov 27, 00:33:47 general (line 116) INFO Run manager-ai
(39495) 19 Nov 27, 00:33:47 general (line 119) INFO Found 2 new tasks in manager-ai/config.yml
(39495) 19 Nov 27, 00:33:47 general (line 110) INFO Added new periodic task:
(39495) 19 Nov 27, 00:33:47 general (line 110) INFO Added new periodic task:
```
...
```
Run time of job "Controller.task_handler (trigger: cron[month='*', day='*', day_of_week='*', hour='*', minute='*'], next run at: 2019-11-27 00:34:00 MSK)" was missed by 0:02:46.339675
Run time of job "Controller.task_handler (trigger: cron[month='*', day='*', day_of_week='*', hour='*', minute='*'], next run at: 2019-11-27 00:37:00 MSK)" was missed by 0:01:46.340594
Run time of job "Controller.task_handler (trigger: cron[month='*', day='*', day_of_week='*', hour='*', minute='*'], next run at: 2019-11-27 00:37:00 MSK)" was missed by 0:00:46.340855
Run time of job "Controller.task_handler (trigger: cron[month='*', day='*', day_of_week='*', hour='*', minute='*'], next run at: 2019-11-27 00:34:00 MSK)" was missed by 0:02:46.342260
Run time of job "Controller.task_handler (trigger: cron[month='*', day='*', day_of_week='*', hour='*', minute='*'], next run at: 2019-11-27 00:34:00 MSK)" was missed by 0:01:46.342456
Run time of job "Controller.task_handler (trigger: cron[month='*', day='*', day_of_week='*', hour='*', minute='*'], next run at: 2019-11-27 00:34:00 MSK)" was missed by 0:00:46.342580
Run time of job "Controller.task_handler (trigger: cron[month='*', day='*', day_of_week='*', hour='*', minute='*'], next run at: 2019-11-27 00:34:00 MSK)" was missed by 0:02:46.345722
Run time of job "Controller.task_handler (trigger: cron[month='*', day='*', day_of_week='*', hour='*', minute='*'], next run at: 2019-11-27 00:37:00 MSK)" was missed by 0:01:46.346796
Run time of job "Controller.task_handler (trigger: cron[month='*', day='*', day_of_week='*', hour='*', minute='*'], next run at: 2019-11-27 00:37:00 MSK)" was missed by 0:00:46.347045
Run time of job "Controller.task_handler (trigger: cron[month='*', day='*', day_of_week='*', hour='*', minute='*'], next run at: 2019-11-27 00:34:00 MSK)" was missed by 0:02:46.348511
Run time of job "Controller.task_handler (trigger: cron[month='*', day='*', day_of_week='*', hour='*', minute='*'], next run at: 2019-11-27 00:34:00 MSK)" was missed by 0:01:46.348722
Run time of job "Controller.task_handler (trigger: cron[month='*', day='*', day_of_week='*', hour='*', minute='*'], next run at: 2019-11-27 00:34:00 MSK)" was missed by 0:00:46.348876
Run time of job "Controller.task_handler (trigger: cron[month='*', day='*', day_of_week='*', hour='*', minute='*'], next run at: 2019-11-27 00:34:00 MSK)" was missed by 0:02:46.351673
Run time of job "Controller.task_handler (trigger: cron[month='*', day='*', day_of_week='*', hour='*', minute='*'], next run at: 2019-11-27 00:34:00 MSK)" was missed by 0:01:46.351993
Run time of job "Controller.task_handler (trigger: cron[month='*', day='*', day_of_week='*', hour='*', minute='*'], next run at: 2019-11-27 00:34:00 MSK)" was missed by 0:00:46.352257
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the issue by running manager-ai repeatedly with the tasks in config.yml, then trace Controller.task_handler and the code that logs “Added new periodic task.” Check both database writes and APScheduler registration. Done means repeated runs no longer create duplicate task documents or scheduled jobs, and the missed-job messages are not multiplied.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend, database
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.