Skip to content

Commit 3eb5fcc

Browse files
jlia0claude
andcommitted
fix: remove logs pane, simplify heartbeat home, bump telegram watchdog, localize task types
- Remove dedicated logs pane from tmux session (daemon.sh) - Simplify TINYCLAW_HOME detection in heartbeat-cron.sh - Increase telegram polling watchdog timeout from 2m to 5m - Move Task/TaskStatus types from core to server/routes/tasks.ts - Update README with tinyclaw office command Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent e6914f2 commit 3eb5fcc

6 files changed

Lines changed: 27 additions & 38 deletions

File tree

README.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,14 +148,20 @@ TinyClaw includes `tinyoffice/`, a Next.js web portal for operating TinyClaw fro
148148

149149
Start TinyClaw first (API default: `http://localhost:3777`), then:
150150

151+
```bash
152+
tinyclaw office
153+
```
154+
155+
This auto-installs dependencies, builds, and starts the production server on `http://localhost:3000`.
156+
157+
For development with hot-reload:
158+
151159
```bash
152160
cd tinyoffice
153161
npm install
154162
npm run dev
155163
```
156164

157-
Open `http://localhost:3000`.
158-
159165
If TinyClaw API is on a different host/port, set:
160166

161167
```bash
@@ -210,6 +216,7 @@ Commands work with `tinyclaw` (if CLI installed) or `./tinyclaw.sh` (direct scri
210216
| Command | Description | Example |
211217
| ------------------- | --------------------------------------------- | -------------------------- |
212218
| `chatroom <team>` | Real-time TUI viewer with type-to-send | `tinyclaw chatroom dev` |
219+
| `office` | Start TinyOffice web portal on port 3000 | `tinyclaw office` |
213220

214221
Every team has a persistent chat room. Agents post to it using `[#team_id: message]` tags, and messages are broadcast to all teammates. The chatroom viewer polls for new messages in real time — type a message and press Enter to post, or press `q`/Esc to quit.
215222

lib/daemon.sh

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -122,15 +122,9 @@ start_daemon() {
122122
done
123123
echo ""
124124

125-
# Build log tail command
126-
local log_tail_cmd="tail -f $LOG_DIR/queue.log"
127-
for ch in "${ACTIVE_CHANNELS[@]}"; do
128-
log_tail_cmd="$log_tail_cmd $LOG_DIR/${ch}.log"
129-
done
130-
131125
# --- Build tmux session dynamically ---
132-
# Total panes = N channels + 3 (queue, heartbeat, logs)
133-
local total_panes=$(( ${#ACTIVE_CHANNELS[@]} + 3 ))
126+
# Total panes = N channels + 2 (queue, heartbeat)
127+
local total_panes=$(( ${#ACTIVE_CHANNELS[@]} + 2 ))
134128

135129
tmux new-session -d -s "$TMUX_SESSION" -n "tinyclaw" -c "$SCRIPT_DIR"
136130

@@ -169,11 +163,6 @@ start_daemon() {
169163
# Heartbeat pane
170164
tmux send-keys -t "$TMUX_SESSION:${win_base}.$pane_idx" "cd '$SCRIPT_DIR' && ./lib/heartbeat-cron.sh" C-m
171165
tmux select-pane -t "$TMUX_SESSION:${win_base}.$pane_idx" -T "Heartbeat"
172-
pane_idx=$((pane_idx + 1))
173-
174-
# Logs pane
175-
tmux send-keys -t "$TMUX_SESSION:${win_base}.$pane_idx" "cd '$SCRIPT_DIR' && $log_tail_cmd" C-m
176-
tmux select-pane -t "$TMUX_SESSION:${win_base}.$pane_idx" -T "Logs"
177166

178167
echo ""
179168
echo -e "${GREEN}✓ TinyClaw started${NC}"

lib/heartbeat-cron.sh

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,7 @@
33

44
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
55
PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
6-
if [ -z "$TINYCLAW_HOME" ]; then
7-
if [ -f "$PROJECT_ROOT/.tinyclaw/settings.json" ]; then
8-
TINYCLAW_HOME="$PROJECT_ROOT/.tinyclaw"
9-
else
10-
TINYCLAW_HOME="$HOME/.tinyclaw"
11-
fi
12-
fi
6+
TINYCLAW_HOME="${TINYCLAW_HOME:-$HOME/.tinyclaw}"
137
LOG_FILE="$TINYCLAW_HOME/logs/heartbeat.log"
148
SETTINGS_FILE="$TINYCLAW_HOME/settings.json"
159
API_PORT="${TINYCLAW_API_PORT:-3777}"

packages/channels/src/telegram.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -651,10 +651,10 @@ bot.on('polling_error', (error: Error) => {
651651
// Track polling activity — any event from the bot means polling is alive
652652
bot.on('message', () => { lastPollingActivity = Date.now(); });
653653

654-
// Watchdog: if no polling activity for 2 minutes, verify connectivity before restarting
654+
// Watchdog: if no polling activity for 5 minutes, verify connectivity before restarting
655655
setInterval(async () => {
656656
const silentMs = Date.now() - lastPollingActivity;
657-
if (silentMs > 2 * 60 * 1000) {
657+
if (silentMs > 5 * 60 * 1000) {
658658
// Check if the bot can actually reach Telegram before deciding polling is dead
659659
try {
660660
await bot.getMe();

packages/core/src/types.ts

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,6 @@ export interface TeamConfig {
2121
leader_agent: string;
2222
}
2323

24-
export type TaskStatus = 'backlog' | 'in_progress' | 'review' | 'done';
25-
26-
export interface Task {
27-
id: string;
28-
title: string;
29-
description: string;
30-
status: TaskStatus;
31-
assignee: string; // agent or team id, empty = unassigned
32-
assigneeType: 'agent' | 'team' | '';
33-
createdAt: number;
34-
updatedAt: number;
35-
}
36-
3724
export interface ChainStep {
3825
agentId: string;
3926
response: string;

packages/server/src/routes/tasks.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,22 @@
11
import fs from 'fs';
22
import path from 'path';
33
import { Hono } from 'hono';
4-
import { Task, TaskStatus } from '@tinyclaw/core';
54
import { TINYCLAW_HOME } from '@tinyclaw/core';
65
import { log } from '@tinyclaw/core';
76

7+
type TaskStatus = 'backlog' | 'in_progress' | 'review' | 'done';
8+
9+
interface Task {
10+
id: string;
11+
title: string;
12+
description: string;
13+
status: TaskStatus;
14+
assignee: string; // agent or team id, empty = unassigned
15+
assigneeType: 'agent' | 'team' | '';
16+
createdAt: number;
17+
updatedAt: number;
18+
}
19+
820
const TASKS_FILE = path.join(TINYCLAW_HOME, 'tasks.json');
921

1022
function readTasks(): Task[] {

0 commit comments

Comments
 (0)