Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .omc/state/hud-state.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"timestamp": "2026-02-27T09:41:29.668Z",
"backgroundTasks": [],
"sessionStartTimestamp": "2026-02-27T08:56:19.621Z",
"sessionId": "06550954-0d4b-4961-8ccd-af4f724d7078"
}
1 change: 1 addition & 0 deletions .omc/state/hud-stdin-cache.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"session_id":"06550954-0d4b-4961-8ccd-af4f724d7078","transcript_path":"/home/ubuntu/.claude/projects/-home-ubuntu/06550954-0d4b-4961-8ccd-af4f724d7078.jsonl","cwd":"/home/ubuntu/ccbot-fork","model":{"id":"claude-sonnet-4-6","display_name":"Sonnet 4.6"},"workspace":{"current_dir":"/home/ubuntu/ccbot-fork","project_dir":"/home/ubuntu","added_dirs":[]},"version":"2.1.62","output_style":{"name":"default"},"cost":{"total_cost_usd":7.7672263,"total_duration_ms":1261862,"total_api_duration_ms":560088,"total_lines_added":17,"total_lines_removed":5},"context_window":{"total_input_tokens":166531,"total_output_tokens":25798,"context_window_size":200000,"current_usage":{"input_tokens":160,"output_tokens":722,"cache_creation_input_tokens":0,"cache_read_input_tokens":146816},"used_percentage":73,"remaining_percentage":27},"exceeds_200k_tokens":false}
Empty file added .ultra/queues/.gitkeep
Empty file.
Empty file added .ultra/routines/.gitkeep
Empty file.
37 changes: 37 additions & 0 deletions .ultra/schemas/autoloop.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Autoloop State",
"type": "object",
"required": ["active", "lastHeartbeat", "currentCycle"],
"properties": {
"active": {"type": "boolean"},
"startedAt": {"type": "string", "format": "date-time"},
"lastHeartbeat": {"type": "string", "format": "date-time"},
"currentCycle": {"type": "number"},
"cycleTime": {"type": "number"},
"queues": {
"type": "object",
"properties": {
"intake": {"type": "number"},
"inProgress": {"type": "number"},
"review": {"type": "number"},
"completed": {"type": "number"},
"failed": {"type": "number"}
}
},
"health": {
"type": "object",
"properties": {
"status": {"type": "string"},
"diskUsagePercent": {"type": "number"},
"memoryUsagePercent": {"type": "number"},
"testsPassing": {"type": "boolean"},
"gitClean": {"type": "boolean"}
}
},
"lastActions": {
"type": "array",
"items": {"type": "string"}
}
}
}
70 changes: 70 additions & 0 deletions .ultra/schemas/domain.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Domain Configuration",
"type": "object",
"required": ["domain", "workspace", "autoloop"],
"properties": {
"domainId": {"type": "string"},
"domain": {
"type": "object",
"required": ["id", "name", "type"],
"properties": {
"id": {"type": "string"},
"name": {"type": "string"},
"type": {"type": "string"},
"description": {"type": "string"}
}
},
"workspace": {
"type": "object",
"required": ["language", "framework"],
"properties": {
"language": {"type": "string"},
"framework": {"type": "string"},
"packageManager": {"type": "string"},
"testing": {"type": "string"},
"versionControl": {"type": "string"}
}
},
"agents": {
"type": "array",
"items": {"type": "string"}
},
"routing": {
"type": "object",
"properties": {
"rules": {
"type": "array",
"items": {
"type": "object",
"properties": {
"pattern": {"type": "string"},
"agent": {"type": "string"}
}
}
}
}
},
"routines": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {"type": "string"},
"schedule": {"type": "string"},
"enabled": {"type": "boolean"},
"command": {"type": "string"}
},
"required": ["name", "schedule", "enabled"]
}
},
"autoloop": {
"type": "object",
"properties": {
"cycleTime": {"type": "number"},
"enabled": {"type": "boolean"},
"concurrentTasks": {"type": "number"}
}
}
}
}
29 changes: 29 additions & 0 deletions .ultra/schemas/queue.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Task Queue",
"type": "object",
"required": ["intake", "in_progress", "review", "completed", "failed"],
"properties": {
"intake": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {"type": "string"},
"type": {"type": "string"},
"title": {"type": "string"},
"description": {"type": "string"},
"priority": {"type": "string"},
"status": {"type": "string"},
"createdAt": {"type": "string", "format": "date-time"},
"owner": {"type": "string"},
"assignedAt": {"type": "string", "format": "date-time"}
}
}
},
"in_progress": {"type": "array"},
"review": {"type": "array"},
"completed": {"type": "array"},
"failed": {"type": "array"}
}
}
19 changes: 19 additions & 0 deletions .ultra/schemas/routine.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Routine Task",
"type": "object",
"required": ["name", "schedule", "enabled", "command"],
"properties": {
"name": {"type": "string"},
"schedule": {"type": "string"},
"enabled": {"type": "boolean"},
"command": {"type": "string"},
"timeout": {"type": "number"},
"retryOnFailure": {"type": "boolean"},
"maxRetries": {"type": "number"},
"alertOnFailure": {"type": "boolean"},
"continueOnFailure": {"type": "boolean"},
"lastRun": {"type": "string", "format": "date-time"},
"lastResult": {"type": "string"}
}
}
Empty file added .ultra/state/.gitkeep
Empty file.
87 changes: 87 additions & 0 deletions TROUBLESHOOTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# Troubleshooting Guide

## Session Not Being Tracked

### Symptom: "No active users for session" in logs

This means ccbot is tracking the session but can't find users to deliver messages to. Check:

1. **session_map.json format** - Must be object format, not string:
```json
{
"ccbot:@8": {
"session_id": "uuid-here",
"cwd": "/home/ubuntu",
"window_name": "ubuntu"
}
}
```

**Wrong format (string value):**
```json
{
"ccbot:@8": "uuid-here"
}
```

2. **state.json window_states must have cwd populated:**
```json
{
"window_states": {
"@8": {
"session_id": "uuid-here",
"cwd": "/home/ubuntu", ← MUST be set
"window_name": "ubuntu"
}
}
}
```

The `resolve_session_for_window()` function returns `None` when `cwd` is empty.

### How to Fix

1. Find the correct session ID:
```bash
ls -lt ~/.claude/projects/-home-ubuntu/*.jsonl | head -5
```

2. Update session_map.json with correct format:
```bash
nano ~/.ccbot/session_map.json
```

3. Restart ccbot:
```bash
killall ccbot && ccbot run &
```

## Status Messages "Brewing" / "Forging"

These are from `status_polling.py` which polls the terminal status line every 1 second.

To disable: Edit `src/ccbot/bot.py` line 1545-1546 and comment out:
```python
# _status_poll_task = asyncio.create_task(status_poll_loop(application.bot))
# logger.info("Status polling task started")
logger.info("Status polling DISABLED")
```

## Thinking Messages in Telegram

Internal Claude thinking blocks have `content_type="thinking"`. The fix in `handle_new_message()` skips these:

```python
if msg.content_type == "thinking":
logger.debug(f"Skipping thinking message for session {msg.session_id}")
return
```

## Wrong Session Tracked

If ccbot is tracking the wrong session:
1. Check which session is active in your tmux window
2. Find the session file with the actual content you're working on
3. Update session_map.json with the correct session_id
4. Clear monitor_state.json: `echo '{"tracked_sessions": {}}' > ~/.ccbot/monitor_state.json`
5. Restart ccbot
Loading
Loading