Skip to content

Commit 2b9a31e

Browse files
authored
docs: sync with goclaw source changes c388364d..c5bfbc96 (EN+VI+ZH) (#45)
1 parent 5317903 commit 2b9a31e

19 files changed

Lines changed: 370 additions & 50 deletions

advanced/media-generation.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,23 @@ Generated files are verified after writing — if the file doesn't exist on disk
4141

4242
**Default provider chain:** Gemini → MiniMax → OpenRouter
4343

44-
**Default models:** Gemini `veo-3.0-generate-preview`, MiniMax `MiniMax-Hailuo-2.3`, OpenRouter `google/veo-3.0-generate-preview`
44+
**Default models:** Gemini `veo-3.1-lite-generate-preview`, MiniMax `MiniMax-Hailuo-2.3`, OpenRouter `google/veo-3.1-lite-generate-preview`
4545

4646
| Parameter | Type | Default | Description |
4747
|-----------|------|---------|-------------|
4848
| `prompt` | string | required | Text description of the video |
4949
| `duration` | int | `8` | Duration in seconds: `4`, `6`, or `8` |
5050
| `aspect_ratio` | string | `16:9` | `16:9` or `9:16` |
51+
| `image_path` | string || Path to a workspace image to use as starting frame (image-to-video). Omit for text-to-video. Supported formats: PNG, JPEG, WebP, GIF. Max 20 MB. |
52+
| `filename_hint` | string || Short descriptive filename without extension (e.g. `cat-playing-piano`) |
53+
54+
### Image-to-Video
55+
56+
Provide an `image_path` to generate a video starting from a reference image. The image is encoded as base64 and sent to the provider. When using image-to-video mode, duration is fixed at **8 seconds** (API constraint).
57+
58+
**Example agent prompt:** *"Animate this product photo with a slow zoom and subtle lighting changes"* (with `image_path` pointing to a workspace image)
59+
60+
> **Note:** Not all providers support image-to-video. Gemini (Veo 3.1 Lite) supports it natively. Unsupported providers in the chain are skipped automatically.
5161
5262
Video generation is slow — both Gemini and MiniMax poll up to ~6 minutes. The timeout per provider defaults to 120 seconds but can be increased via chain settings.
5363

@@ -182,4 +192,4 @@ Downloaded media files are capped at **200 MB**. Files exceeding this limit will
182192
- [Custom Tools](/custom-tools) — Build your own tools
183193
- [Provider Overview](/providers-overview) — Configure API keys
184194

185-
<!-- goclaw-source: 120fc2d | updated: 2026-03-18 -->
195+
<!-- goclaw-source: c5bfbc96 | updated: 2026-04-02 -->

advanced/scheduling-cron.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ goclaw cron delete <jobId>
101101
| `schedule.atMs` | int64 | Unix timestamp in ms (for `at`) |
102102
| `schedule.everyMs` | int64 | Interval in ms (for `every`) |
103103
| `schedule.expr` | string | 5-field cron expression (for `cron`) |
104-
| `schedule.tz` | string | IANA timezone for cron expressions; omit to use the gateway default timezone |
104+
| `schedule.tz` | string | IANA timezone — applies to **all** schedule kinds (`at`, `every`, `cron`), not just cron expressions. Omit to use the gateway default timezone |
105105
| `message` | string | Text the agent receives as its input |
106106
| `stateless` | bool | Run without session history — saves tokens for simple scheduled tasks. Default `false` |
107107
| `deliver` | bool | `true` = deliver result to a channel; `false` = agent processes silently. Auto-defaults to `true` when the job is created from a real channel (Telegram, etc.) |
@@ -318,4 +318,4 @@ When a session's conversation history exceeds **60% of the context window**, the
318318
- [Skills](/skills) — inject domain knowledge so scheduled agents are more effective
319319
- [Sandbox](/sandbox) — isolate code execution during scheduled agent runs
320320

321-
<!-- goclaw-source: a47d7f9f | updated: 2026-03-31 -->
321+
<!-- goclaw-source: c5bfbc96 | updated: 2026-04-02 -->

channels/overview.md

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,49 @@ The `media_max_bytes` config field enforces a per-channel limit on outbound medi
9595
| **Media** | Photos, voice, files | Files, embeds | Files (20MB) | Images, files (30MB) | Images (5MB) | -- | JSON |
9696
| **Reply media** | Yes | Yes | -- | Yes | -- | -- | -- |
9797
| **Rich format** | HTML | Markdown | mrkdwn | Cards | Plain text | Plain text | Plain |
98+
| **Thread support** | Yes | -- | -- | -- | -- | -- | -- |
9899
| **Reactions** | Yes | -- | Yes | Yes | -- | -- | -- |
99100
| **Pairing** | Yes | Yes | Yes | Yes | Yes | Yes | Yes |
100101
| **Message limit** | 4,096 | 2,000 | 4,000 | 4,000 | 2,000 | 2,000 | N/A |
101102

103+
## Channel Health Diagnostics
104+
105+
GoClaw tracks the runtime health of each channel instance and provides actionable diagnostics when issues occur. Health state is exposed via the `channels.status` WebSocket method and the dashboard overview page.
106+
107+
### Health States
108+
109+
| State | Meaning |
110+
|-------|---------|
111+
| `registered` | Channel is configured but not yet started |
112+
| `starting` | Channel is initializing |
113+
| `healthy` | Running normally |
114+
| `degraded` | Running with issues |
115+
| `failed` | Stopped due to an error |
116+
| `stopped` | Manually stopped |
117+
118+
### Failure Classification
119+
120+
When a channel fails, GoClaw classifies the error into one of four categories:
121+
122+
| Kind | Typical Cause | Remediation |
123+
|------|---------------|-------------|
124+
| `auth` | Invalid or expired token/secret | Review credentials or re-authenticate |
125+
| `config` | Missing required settings, invalid proxy | Complete required fields in channel settings |
126+
| `network` | Timeout, connection refused, DNS failure | Check upstream service reachability and proxy settings |
127+
| `unknown` | Unrecognized error | Inspect server logs for the full error |
128+
129+
Each failure includes a **remediation hint** — a short operator instruction pointing to the specific UI surface (credentials panel, advanced settings, or details page) where the issue can be resolved. The dashboard surfaces these hints directly on channel cards.
130+
131+
### Health Tracking
132+
133+
The health system tracks failure history per channel:
134+
- **Consecutive failures** — resets when the channel recovers
135+
- **Total failure count** — lifetime counter
136+
- **First/last failure timestamps** — for diagnosing intermittent issues
137+
- **Last healthy timestamp** — when the channel was last operational
138+
139+
---
140+
102141
## Implementation Checklist
103142

104143
When adding a new channel, implement these methods:
@@ -156,4 +195,4 @@ Channels may enforce per-user rate limits. Configure via channel settings or imp
156195
- [WebSocket](/channel-websocket) — Direct agent API via WS
157196
- [Browser Pairing](/channel-browser-pairing) — 8-char code pairing flow
158197

159-
<!-- goclaw-source: 120fc2d | updated: 2026-03-19 -->
198+
<!-- goclaw-source: c5bfbc96 | updated: 2026-04-02 -->

channels/telegram.md

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -223,11 +223,25 @@ Disabled by default. When enabled with `reasoning_stream: true` (default), reaso
223223

224224
Show emoji status on user messages. Set `reaction_level`:
225225

226-
> Typing indicator reactions are now handled with better error recovery — invalid reaction types are caught gracefully instead of causing errors.
227-
228-
- `off` — No reactions
229-
- `minimal` — Only ⏳ (thinking)
230-
- `full` — ⏳ (thinking) → 🛠️ (tool) → ✅ (done) or ❌ (error)
226+
- `off` — No reactions (default)
227+
- `minimal` — Only terminal states (done/error)
228+
- `full` — All status transitions with debouncing and stall detection
229+
230+
**Status → Emoji mapping** (use `/reactions` in chat to see this legend):
231+
232+
| Status | Emoji | Description |
233+
|--------|-------|-------------|
234+
| queued | 👀 | Waiting to process |
235+
| thinking | 🤔 | Processing your request |
236+
| tool || Executing a tool |
237+
| coding | 👨‍💻 | Running code |
238+
| web || Browsing / API call |
239+
| done | 👍 | Completed |
240+
| error | 💔 | Something went wrong |
241+
| stallSoft | 🥱 | No activity for 10s |
242+
| stallHard | 😨 | No activity for 30s |
243+
244+
Each status has fallback emoji variants in case the primary emoji is restricted by the chat's allowed reactions. Intermediate states (thinking, tool, etc.) are debounced at 700ms to avoid reaction spam.
231245

232246
### Bot Commands
233247

@@ -245,6 +259,7 @@ Commands processed before message enrichment:
245259
| `/task_detail <id>` | View task | -- |
246260
| `/subagents` | List all active subagent tasks with status | -- |
247261
| `/subagent <id>` | Show detailed view of a subagent task from DB | -- |
262+
| `/reactions` | Show reaction emoji legend (status → emoji mapping) | -- |
248263
| `/addwriter` | Add group file writer | Writers only |
249264
| `/removewriter` | Remove group file writer | Writers only |
250265
| `/writers` | List group writers | -- |
@@ -293,4 +308,4 @@ Each Telegram instance maintains an isolated HTTP transport — no shared connec
293308
- [Browser Pairing](/channel-browser-pairing) — Pairing flow
294309
- [Sessions & History](/sessions-and-history) — Conversation history
295310

296-
<!-- goclaw-source: c388364d | updated: 2026-04-01 -->
311+
<!-- goclaw-source: c5bfbc96 | updated: 2026-04-02 -->

deployment/upgrading.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ A GoClaw upgrade has two parts:
99
1. **SQL migrations** — schema changes applied by `golang-migrate` (idempotent, versioned)
1010
2. **Data hooks** — optional Go-based data transformations that run after schema migrations (e.g. backfilling a new column)
1111

12-
The `./goclaw upgrade` command handles both in the correct order. It is safe to run multiple times — it is fully idempotent. The current required schema version is **34**.
12+
The `./goclaw upgrade` command handles both in the correct order. It is safe to run multiple times — it is fully idempotent. The current required schema version is **35**.
1313

1414
```mermaid
1515
graph LR
@@ -227,6 +227,7 @@ These five migrations are auto-applied on startup when upgrading to v2.x. No man
227227
| 032 | Creates `secure_cli_user_credentials` for per-user CLI credential injection; adds `contact_type` column to `channel_contacts` |
228228
| 033 | Cron payload columns | Promotes `stateless`, `deliver`, `deliver_channel`, `deliver_to`, `wake_heartbeat` from `payload` JSONB to dedicated columns on `cron_jobs` |
229229
| 034 | `subagent_tasks` | Subagent task persistence for DB-backed task tracking |
230+
| 035 | `contact_thread_id` | Adds `thread_id VARCHAR(100)` and `thread_type VARCHAR(20)` to `channel_contacts`; cleans up `sender_id` by stripping `\|username` suffixes; rebuilds unique index as `(tenant_id, channel_type, sender_id, COALESCE(thread_id, ''))` |
230231

231232
### Breaking Changes in v2.x
232233

@@ -279,4 +280,4 @@ Before each upgrade, check the release notes for:
279280
- [Database Setup](/deploy-database) — PostgreSQL and pgvector setup
280281
- [Observability](/deploy-observability) — monitor your gateway post-upgrade
281282

282-
<!-- goclaw-source: c388364d | updated: 2026-04-01 -->
283+
<!-- goclaw-source: c5bfbc96 | updated: 2026-04-02 -->

reference/database-schema.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -645,11 +645,13 @@ Global unified contact directory auto-collected from all channel interactions. N
645645
| `avatar_url` | TEXT | | Profile image URL |
646646
| `peer_kind` | VARCHAR(20) | | e.g. `user`, `bot`, `group` |
647647
| `metadata` | JSONB | DEFAULT `{}` | Extra platform-specific data |
648+
| `thread_id` | VARCHAR(100) | | Thread/topic identifier within a chat (migration 035) |
649+
| `thread_type` | VARCHAR(20) | | Thread type classifier (migration 035) |
648650
| `merged_id` | UUID | | Canonical contact after de-duplication |
649651
| `first_seen_at` | TIMESTAMPTZ | NOT NULL DEFAULT NOW() | |
650652
| `last_seen_at` | TIMESTAMPTZ | NOT NULL DEFAULT NOW() | |
651653

652-
**Unique:** `(channel_type, sender_id)`
654+
**Unique:** `(tenant_id, channel_type, sender_id, COALESCE(thread_id, ''))`
653655

654656
**Indexes:** `channel_instance` (partial non-null), `merged_id` (partial non-null), `(display_name, username)`
655657

@@ -993,6 +995,7 @@ Centralized key-value store for per-tenant system settings. Falls back to master
993995
| 32 | Creates `secure_cli_user_credentials` for per-user credential injection (mirrors `mcp_user_credentials` pattern); adds `contact_type VARCHAR(20) DEFAULT 'user'` to `channel_contacts` |
994996
| 33 | Promotes `stateless`, `deliver`, `deliver_channel`, `deliver_to`, `wake_heartbeat` from `payload` JSONB to dedicated columns on `cron_jobs` |
995997
| 34 | `subagent_tasks` — subagent task persistence for DB-backed task lifecycle tracking, cost attribution, and restart recovery |
998+
| 35 | `contact_thread_id` — adds `thread_id` and `thread_type` to `channel_contacts`; cleans `sender_id` format; rebuilds unique index to include thread scope |
996999

9971000
---
9981001

@@ -1085,4 +1088,4 @@ Persists subagent task lifecycle for audit trail, cost attribution, and restart
10851088
- [Config Reference](/config-reference) — how database config maps to `config.json`
10861089
- [Glossary](/glossary) — Session, Compaction, Lane, and other key terms
10871090

1088-
<!-- goclaw-source: c388364d | updated: 2026-04-01 -->
1091+
<!-- goclaw-source: c5bfbc96 | updated: 2026-04-02 -->

0 commit comments

Comments
 (0)