Skip to content

Commit 21c376f

Browse files
committed
add project level management
1 parent 3d7d39b commit 21c376f

File tree

13 files changed

+423
-126
lines changed

13 files changed

+423
-126
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ A 24/7 AI assistant daemon that continuously works on tasks via Slack. Uses Clau
1111

1212
## Full Precedure
1313

14-
1. Command arrives via CLI (sle task "...") or Slack (/task ...)
14+
1. Command arrives via CLI (sle think -p project "..." or sle think "...") or Slack (/think --project=project ... or /think ...)
1515
2. TaskQueue stores it in SQLite database with status PENDING
1616
3. Daemon polls every 5 seconds, calling _process_tasks()
1717
4. SmartScheduler decides if task can execute:
1818
- Checks budget (time-based quotas: 90% night, 10% day)
1919
- Checks available parallel slots
20-
- Prioritizes SERIOUS tasks over RANDOM thoughts
20+
- Prioritizes SERIOUS tasks (with -p/--project) over THOUGHT tasks (without -p)
2121
- Returns list of tasks to execute
2222
5. Daemon executes via _execute_task():
2323
- Marks task as IN_PROGRESS

src/sleepless_agent/config.yaml

Lines changed: 48 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ claude_code:
33
model: claude-sonnet-4-5-20250929
44
night_start_hour: 1
55
night_end_hour: 9
6-
threshold_day: 20.0
7-
threshold_night: 80.0
6+
threshold_day: 95.0
7+
threshold_night: 96.0
88
usage_command: claude /usage
99

1010
git:
1111
use_remote_repo: true
12-
remote_repo_url: [email protected]:TimeLovercc/test1.git
12+
remote_repo_url: [email protected]:TimeLovercc/test4.git # !!!CHANGE THIS!!!
1313
auto_create_repo: true
1414

1515
agent:
@@ -38,9 +38,18 @@ auto_generation:
3838
- Active tasks: {task_count} ({pending_count} pending, {in_progress_count} in progress)
3939
- Many tasks are already in progress or pending
4040
41+
## Available Tasks to Refine
42+
{available_tasks}
43+
4144
## Recent Work & Context
4245
{recent_work}
4346
47+
## Workspace Constraints
48+
- Tasks execute in isolated directories: workspace/tasks/<task_id>/
49+
- Each task only has access to its own workspace folder and workspace/shared/
50+
- Do NOT reference workspace/data/ or other system directories in task descriptions
51+
- REFINE tasks reuse existing task workspaces (no new folder created)
52+
4453
## Task Generation
4554
Generate ONE REFINE task to continue or improve existing work:
4655
- Complete partial/incomplete tasks mentioned above
@@ -50,9 +59,13 @@ auto_generation:
5059
- Add missing components to existing implementations
5160
- Expand documentation or analysis from previous tasks
5261
53-
IMPORTANT: Your response MUST start with [REFINE] followed by a specific, actionable task description in 1-2 sentences.
62+
IMPORTANT Format Requirements:
63+
- To refine a specific task: Use [REFINE:#<task_id>] followed by description
64+
Example: [REFINE:#2] Improve error handling and add edge case tests
65+
- For general refinements: Use [REFINE] followed by description
66+
- Your response MUST be 1-2 sentences max
5467
55-
Focus on completing or improving what already exists in the workspace rather than starting new projects.
68+
Focus on completing or improving what already exists rather than starting new projects.
5669
weight: 0.45
5770
- name: balanced
5871
prompt: |-
@@ -61,9 +74,18 @@ auto_generation:
6174
## Current State
6275
- Active tasks: {task_count} ({pending_count} pending, {in_progress_count} in progress)
6376
77+
## Available Tasks to Refine
78+
{available_tasks}
79+
6480
## Recent Work & Context
6581
{recent_work}
6682
83+
## Workspace Constraints
84+
- Tasks execute in isolated directories: workspace/tasks/<task_id>/
85+
- Each task only has access to its own workspace folder and workspace/shared/
86+
- Do NOT reference workspace/data/ or other system directories in task descriptions
87+
- REFINE tasks reuse existing task workspaces (no new folder created)
88+
6789
## Task Generation
6890
Generate ONE valuable task (NEW or REFINE):
6991
- For REFINE: improve existing work, complete partial tasks, enhance current projects
@@ -79,7 +101,12 @@ auto_generation:
79101
- Automation and productivity improvements
80102
- Analysis and evaluation reports
81103
82-
IMPORTANT: Prefix your response with [NEW] or [REFINE] followed by a specific, actionable task description in 1-2 sentences.
104+
IMPORTANT Format Requirements:
105+
- To refine a specific task: Use [REFINE:#<task_id>] followed by description
106+
Example: [REFINE:#1] Add comprehensive testing suite with edge cases
107+
- For general refinements: Use [REFINE] followed by description
108+
- For new tasks: Use [NEW] followed by description
109+
- Your response MUST be 1-2 sentences max
83110
weight: 0.35
84111
- name: new_friendly
85112
prompt: |-
@@ -89,6 +116,15 @@ auto_generation:
89116
- Active tasks: {task_count} ({pending_count} pending, {in_progress_count} in progress)
90117
- Few tasks in queue - good time for new projects!
91118
119+
## Available Tasks to Refine
120+
{available_tasks}
121+
122+
## Workspace Constraints
123+
- Tasks execute in isolated directories: workspace/tasks/<task_id>/
124+
- Each task only has access to its own workspace folder and workspace/shared/
125+
- Do NOT reference workspace/data/ or other system directories in task descriptions
126+
- REFINE tasks reuse existing task workspaces (no new folder created)
127+
92128
## Task Generation
93129
Generate ONE innovative task that creates value.
94130
@@ -106,6 +142,11 @@ auto_generation:
106142
107143
Can be NEW (fresh project) or REFINE (improve existing work) - choose what would be most valuable.
108144
109-
IMPORTANT: Prefix your response with [NEW] or [REFINE] followed by a specific, actionable task description in 1-2 sentences.
145+
IMPORTANT Format Requirements:
146+
- To refine a specific task: Use [REFINE:#<task_id>] followed by description
147+
Example: [REFINE:#3] Expand analysis with performance benchmarks
148+
- For general refinements: Use [REFINE] followed by description
149+
- For new tasks: Use [NEW] followed by description
150+
- Your response MUST be 1-2 sentences max
110151
weight: 0.20
111152

src/sleepless_agent/core/daemon.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ def _signal_handler(self, sig, _frame) -> None:
206206
self.running = False
207207
if self.live_status_tracker:
208208
self.live_status_tracker.clear_all()
209-
self.bot.stop()
209+
# Don't call bot.stop() here - let the finally block handle cleanup
210210
sys.exit(0)
211211

212212
async def run(self) -> None:

0 commit comments

Comments
 (0)