Logs every SSE event and final message content block types to stdout
to diagnose what the user sees as "full tool calls" in Telegram.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The miniapp feed path had an early `break` before the done reaction code,
so the 👍→clear sequence never ran when CLAW_GATEWAY_MINIAPP_PUBLIC_BASE_URL
was set. Move the break after the done reaction.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The gateway creates worker state/workspace dirs before Docker bind-mounts
them. These are host paths (e.g. /mnt/user/appdata/.../workers/wylab/state)
but the gateway can only access them through its /appdata mount. Translate
host paths to container-local equivalents before mkdir.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Fixes stale claw-ts-worker:latest image name persisting in profiles.json
after the image was renamed to claw-telegram:latest.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
load_or_init_manifest now updates worker_defaults roots, worker_image,
and worker_network from env vars on every startup. If the state/workspace
roots changed, existing profile paths are migrated and the manifest is
saved. No need to delete profiles.json when changing mount paths.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- TS worker saves/loads messages to {stateRoot}/conversation.json
- Saves after user message, assistant response, and session reset
- Loads on engine construction (survives container restarts)
- Add CLAW_GATEWAY_WORKER_HOST_STATE_ROOT and
CLAW_GATEWAY_WORKER_HOST_WORKSPACE_ROOT to Unraid XML, defaulting
to /mnt/user/appdata/claw-telegram-gateway/workers
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Adds emoji reactions on the user's incoming message at each lifecycle
point (thinking, tool use, compaction, done, error) with fallback
chains matching OpenClaw's status-reaction-variants. Existing text-based
status messages are preserved — reactions are additive.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace "Thinking..." text message with emoji reactions on the
user's message (🤔 thinking, 🔥 tool running, 😱 error, clear on done).
Tool use/result events are now silent — no text sent to Telegram.
Auto-compaction, task, team, agent, and mailbox events are silent.
Only assistant text and approval requests are shown to the user.
Adds setMessageReaction to TelegramApi.
Tested: real Claude response through Docker image, clean output.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
OAuth tokens require:
- System prompt as array of content blocks with the SDK prefix first
- anthropic-beta, anthropic-dangerous-direct-browser-access,
user-agent, and x-app headers
- Beta flags: claude-code-20250219,oauth-2025-04-20
Tested end-to-end: real Claude response received (Hey!, 409/5 tokens).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
OAuth tokens (sk-ant-oat) require:
- System prompt prefixed with "You are a Claude agent, built on
Anthropic's Claude Agent SDK."
- anthropic-beta, anthropic-dangerous-direct-browser-access, and
x-app headers
Tested locally: 401 → 429 (auth succeeds, rate limited).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The gateway health check calls /healthz without auth headers.
Move the healthz route before the auth check.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The agent is instructed to actively learn about the user, recognize
new information worth keeping, and offer to persist useful artifacts
across session resets. Concise for Telegram.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add ts-worker/ with the Bun/TypeScript worker that replaces
claw-profile-worker. The Dockerfile now builds a single image
containing both the Rust gateway (claw-telegram) and the TS worker.
The image defaults to worker mode (bun run ts-worker/main.ts).
The gateway Unraid XML overrides with --entrypoint claw-telegram.
Worker containers use the same image with the default CMD.
- Add ts-worker/ (12 files): HTTP/SSE server, Anthropic SDK engine,
approval broker, event translator, state stores
- Add package.json with @anthropic-ai/sdk dependency
- Rewrite Dockerfile: three-stage build (Rust + Bun + runtime)
- Revert CLAW_GATEWAY_WORKER_IMAGE to claw-telegram:latest
- Remove image pull from docker_worker_manager (same image, already local)
- Add ts-worker paths to CI trigger
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The gateway no longer shares an image with the worker, so the
worker image needs to be pulled explicitly. Previously both used
claw-telegram:latest which was already present from the gateway.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Remove claw-profile-worker from Dockerfile (no longer built or shipped)
- Remove hardcoded entrypoint/cmd in docker_worker_manager.rs (let
the worker image's own CMD run)
- Clear entrypoint override in Unraid worker templates
- Point CLAW_GATEWAY_WORKER_IMAGE to claw-ts-worker:latest in both
XML templates and template manager test fixture
The gateway now launches claw-ts-worker containers instead of
claw-profile-worker. The TS worker uses @anthropic-ai/sdk directly
and speaks the same HTTP/SSE protocol.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Update Unraid XML templates and template manager to default
CLAW_GATEWAY_WORKER_IMAGE to git.wylab.me/wylab/claw-ts-worker:latest
instead of the old Rust worker image.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Move all worker-facing record types (TaskListRecord, RuntimeTaskRecord,
TeamRecord, MailboxSummary, FeedItemRecord, LibraryAppRecord, etc.)
into protocol-owned mirrors in records.rs. The gateway and worker_client
now use these protocol types instead of importing from the runtime crate.
Add worker-protocol/ with OpenAPI spec and JSON schemas as the
language-neutral contract authority for the gateway-worker boundary.
This is the migration surface for the TS worker replacement.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Previewable files (HTML, MD, code, JSON, etc.) now open in
the Telegram Mini App instead of being uploaded as raw files.
Images and binaries still use Telegram upload.
- Add is_previewable() classifier for ~40 text/code extensions
- Add artifact registry with TTL-based expiry
- Add /miniapp/api/artifacts/:turn_id/:file_id proxy endpoint
- Add /miniapp/view/:turn_id/:file_id viewer with auto-auth
- Route previewable artifacts to "View in Mini App" web_app button
- Extract fetch_generated_file() for raw byte + content-type access
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>