Skip to content

Commit 260f247

Browse files
ziggyclaude
andcommitted
Fix heartbeat path resolution and add model selection
Heartbeat prompt now references $NANOCLAW_GROUP_DIR/HEARTBEAT.md explicitly so the agent can find the checklist. Fixed stale nanoclaw log paths in heartbeat skill. Added GHOSTCLAW_MODEL env var for model selection (sonnet/opus/haiku), wired through agent runner to Claude SDK. Setup flow now asks which model and defaults to Sonnet. Phase 8 extras now include update-check and use multiSelect. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent e9f13f3 commit 260f247

5 files changed

Lines changed: 33 additions & 7 deletions

File tree

.claude/skills/add-heartbeat/SKILL.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Run these checks periodically. Only message the user if something needs attentio
2626

2727
## Checks
2828

29-
- [ ] **NanoClaw errors**: `tail -20 ~/nanoclaw/logs/nanoclaw.error.log` — alert if non-empty in the last hour
29+
- [ ] **GhostClaw errors**: `tail -20 ~/nanoclaw/logs/ghostclaw.error.log` — alert if non-empty in the last hour
3030
- [ ] **Disk space**: `df -h /` — alert if usage >80%
3131
- [ ] **Unread emails**: Check Gmail for unread emails in the last hour — summarise if any look urgent
3232

@@ -56,7 +56,7 @@ mkdir -p "$NANOCLAW_DATA_DIR/ipc/main/tasks"
5656
cat > "$NANOCLAW_DATA_DIR/ipc/main/tasks/heartbeat_$(date +%s).json" << 'EOF'
5757
{
5858
"type": "schedule_task",
59-
"prompt": "Read HEARTBEAT.md and run each check listed. Only message the user if something needs attention. If everything is fine, respond with <internal>All checks passed</internal> and nothing else.",
59+
"prompt": "Read $NANOCLAW_GROUP_DIR/HEARTBEAT.md (or ./HEARTBEAT.md in the current directory) and run each check listed. Only message the user if something needs attention. If everything is fine, respond with <internal>All checks passed</internal> and nothing else.",
6060
"schedule_type": "cron",
6161
"schedule_value": "*/30 * * * *",
6262
"context_mode": "isolated"
@@ -71,7 +71,7 @@ Adjust the cron value based on the user's preference.
7171
Wait for the next cron trigger (or manually create a test by adding a failing check to HEARTBEAT.md), then check logs:
7272

7373
```bash
74-
grep -i "heartbeat\|All checks passed" ~/nanoclaw/logs/nanoclaw.log | tail -5
74+
grep -i "heartbeat\|All checks passed" ~/nanoclaw/logs/ghostclaw.log | tail -5
7575
```
7676

7777
## Customisation

.claude/skills/setup-ghostclaw/SKILL.md

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,22 @@ CLAUDE_CODE_OAUTH_TOKEN=<token>
3939
ANTHROPIC_API_KEY=<key>
4040
```
4141

42+
### Model selection
43+
44+
AskUserQuestion: Which model should the bot use?
45+
- Sonnet (Recommended) — fast, capable, cost-effective for most tasks
46+
- Opus — most capable, slower, higher cost
47+
- Haiku — fastest, cheapest, good for simple tasks
48+
49+
Add to `.env` based on choice:
50+
```
51+
GHOSTCLAW_MODEL=claude-sonnet-4-6 # Sonnet (recommended)
52+
# GHOSTCLAW_MODEL=claude-opus-4-6 # Opus
53+
# GHOSTCLAW_MODEL=claude-haiku-4-5-20251001 # Haiku
54+
```
55+
56+
If they skip or aren't sure, default to Sonnet. Tell them: "You can change this any time by editing `GHOSTCLAW_MODEL` in `.env` and restarting."
57+
4258
### Bot name
4359

4460
AskUserQuestion: What should the bot be called?
@@ -237,9 +253,12 @@ If working: "You're set. Talk to BOTNAME — it knows who you are."
237253

238254
## Phase 8: Optional extras
239255

240-
After core setup, offer:
256+
After core setup, offer optional extras. Use AskUserQuestion with multiSelect:
241257

242-
- `/add-heartbeat` — periodic monitoring checks
243-
- `/add-morning-briefing` — scheduled briefings
244-
- `/add-gmail-agent` — email access for the bot
258+
- `/add-heartbeat` — periodic monitoring checks (recommended)
259+
- `/add-update-check` — weekly check for GhostClaw updates (recommended)
260+
- `/add-morning-briefing` — scheduled daily/weekly briefings
261+
- `/add-gmail-agent` — email access for the bot (needs Google Cloud OAuth)
245262
- `/add-voice` — voice note transcription (needs OpenAI key)
263+
264+
Run each selected skill in sequence. If none selected, skip — they can always add these later.

.env.example

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,10 @@ TELEGRAM_ONLY=true
1515
# Voice transcription (optional — needs OpenAI billing)
1616
# OPENAI_API_KEY=
1717

18+
# Model (optional — defaults to your subscription's best model)
19+
# Options: claude-sonnet-4-6, claude-opus-4-6, claude-haiku-4-5-20251001
20+
# Sonnet recommended for most use cases (fast, cheap, capable)
21+
# GHOSTCLAW_MODEL=claude-sonnet-4-6
22+
1823
# Gmail integration (optional — needs OAuth setup)
1924
# GMAIL_MCP_ENABLED=1

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ All config lives in `.env`. See `.env.example` for all options.
166166
| `ASSISTANT_NAME` | Yes | Bot name (trigger word in groups) |
167167
| `TELEGRAM_BOT_TOKEN` | Recommended | From @BotFather |
168168
| `TELEGRAM_ONLY` | No | Set `true` to skip WhatsApp |
169+
| `GHOSTCLAW_MODEL` | No | Model ID (default: subscription best). Options: `claude-sonnet-4-6`, `claude-opus-4-6`, `claude-haiku-4-5-20251001` |
169170
| `OPENAI_API_KEY` | No | For voice transcription |
170171
| `GMAIL_MCP_ENABLED` | No | Set `1` for Gmail integration |
171172

container/agent-runner/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,7 @@ async function runQuery(
422422
prompt: stream,
423423
options: {
424424
cwd,
425+
model: process.env.GHOSTCLAW_MODEL || undefined,
425426
additionalDirectories: extraDirs.length > 0 ? extraDirs : undefined,
426427
resume: sessionId,
427428
resumeSessionAt: resumeAt,

0 commit comments

Comments
 (0)