handleScreenshot returned a truncated base64 string (first 100 chars only),
which meant the screenshot data was effectively lost and never delivered
to channels (Telegram, Discord, etc.) via the media pipeline.
The media pipeline in loop.go looks for "MEDIA:" prefix in tool results
to collect files for channel delivery (e.g. sendPhoto on Telegram).
Without this prefix, screenshots were silently discarded.
Fix: save screenshot bytes to a temp file and return MEDIA:/path,
matching the pattern used by create_image and tts tools.
create_image exclusively used /chat/completions with modalities:["image","text"]
which only works on OpenRouter. Gemini returns HTTP 400:
"Image generation is not yet supported on the chat.completions endpoint"
OpenAI's DALL-E models also require /images/generations, not /chat/completions.
Fix: route OpenRouter through /chat/completions (supports modalities),
route all other providers (Gemini, OpenAI, etc.) through the standard
/images/generations endpoint with response_format:"b64_json".
Also update default Gemini model from deprecated gemini-2.0-flash-exp
to gemini-2.5-flash-image.
* feat(telegram): add speech-to-text transcription for voice/audio messages with audio-aware routing
Implement an STT pipeline for inbound voice and audio messages in the Telegram channel:
- Add new STT configuration options (stt_proxy_url, stt_api_key, stt_tenant_id, stt_timeout_seconds)
- Add VoiceAgentID config to route voice messages to a dedicated speaking agent
- New stt.go module handles transcription via configurable STT proxy service
- MediaInfo struct now includes Transcript field for storing transcription results
- buildMediaTags embeds transcript in media tags when available for downstream processing
This enables the pipeline to process voice messages with full transcription rather than falling back to text-only handling.
* test(telegram): add tests for buildMediaTags and transcribeAudio functions
Allow overriding the Anthropic API base URL via GOCLAW_ANTHROPIC_BASE_URL
env var, config JSON, or DB provider record. Enables use of Anthropic-
compatible proxies and custom endpoints.
Also adds Makefile shortcuts for docker compose (up/down/logs).
- Fix seedManagedData() hardcoding openai_compat for all non-Anthropic providers;
now uses resolveProviderType() mapping to correct store constants (gemini_native,
minimax_native, etc.) — fixes model listing in web UI for Gemini
- Rename GOCLAW_FEISHU_* env vars to GOCLAW_LARK_* (Lark is the global brand)
- Add WhatsApp env override (GOCLAW_WHATSAPP_BRIDGE_URL) and auto-enable
- Add missing env vars to docker-compose.yml (Cohere, Perplexity, Lark, Zalo, WhatsApp)
- Update .env.example with all providers/channels, remove unnecessary GOCLAW_PROVIDER
- Add Cohere and Perplexity to prepare-env.sh provider detection
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
StartAll() returned early when no channels existed at boot,
skipping the dispatchOutbound goroutine. Channels loaded later
via Reload() assumed the dispatcher was running, causing outbound
messages (agent responses) to never reach Telegram.
Move dispatcher startup before the empty-channel early return so
dynamically loaded channels always have a running consumer.
Co-authored-by: ntduc <ntduc@cpp.ai.vn>
- Replace deprecated text-embedding-004 with gemini-embedding-001
- Add WithDimensions() to OpenAIEmbeddingProvider for dimension truncation
- Pass dimensions=1536 for Gemini to match pgvector column size
- Allow config override of Gemini embedding model via embedding_model
Add env var overlay and auto-enable for Discord channel, matching the
existing Telegram pattern. Update .env.example and docker-compose.yml.
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Discord: include sender's mention format in [From:] annotation so models
use the correct user ID, and strip the bot's own @mention from message
content to prevent the model from echoing it back.
Summoning modal: remove AGENTS.md from progress list since backend only
generates SOUL.md and IDENTITY.md.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add tool loop detection (toolloop.go): tracks repeated no-progress tool calls
using SHA256 hashing of args+results. Warning at 5 identical calls, force stop
at 10. Prevents Gemini models from burning tokens in infinite loops.
- Inject AVAILABILITY.md negative context when agent has no team/delegation
targets, so models don't waste iterations probing unavailable capabilities.
- Fix Dockerfile: create /app/.goclaw directory so Docker volume initializes
with correct goclaw:goclaw ownership instead of root:root.
- Update collapseToolCallsWithoutSig comments for clarity.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Gemini 2.5 flash doesn't return thought_signature, causing
collapseToolCallsWithoutSig to convert tool_calls to "(Used tool ...)"
text that Gemini imitates instead of making real tool calls.
Now strips tool_calls and folds results into plain user messages
so the model retains context without an imitable pattern.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Gemini 2.5 flash doesn't return thought_signature in OpenAI-compat responses,
causing collapseToolCallsWithoutSig to convert ALL tool_calls to "(Used tool ...)"
text. Gemini then imitates this pattern instead of making actual tool calls.
Now drops tool_call cycles entirely, preserving only the assistant's text content.
Also fixes word-wrap in trace detail dialog (break-words instead of break-all)
and uses <pre> with whitespace-pre-wrap for trace-level input/output previews.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Implement `probeBotInfo()` to fetch bot's `open_id` via `/open-apis/bot/v3/info`, fixing group mention detection that was always false due to empty `botOpenID`.
- Add group pending history support to Feishu channel (record/build context/clear) matching Discord pattern.
- Fix Discord placeholder edit to chunk long responses instead of truncating at 2000 chars.
- Implement DM pairing flow for Discord and WhatsApp (checkDMPolicy, sendPairingReply with debounce)
- Add "pairing" case to BaseChannel.CheckPolicy() to reject instead of falling through to "open"
- Add group pending history tracking to Discord (record when not mentioned, prepend context when mentioned)
- Resolve Discord display names with priority: server nickname > global name > username
- Fix Gemini collapse format to prevent model from imitating tool call patterns
- Fix formatTokens crash on null/undefined input
In managed mode, multiple agents share a single tool registry. The spawn
and subagent tools were constructed with a hardcoded parentID of "default",
which does not exist as an agent in managed mode deployments. This caused
subagent announces to fail with "agent default not found" when any
non-default agent (e.g. a secondary agent) tried to spawn a subagent.
Fix: add ctxAgentKey to tool context keys (same pattern as channel/chatID),
inject the calling agent's key from the loop, and read it in spawn/subagent
tools with a fallback to the construction-time default for backward
compatibility with standalone mode.
MCP servers that don't implement the `ping` method return a "method not
found" error. The health loop previously treated this as a failure,
triggering exponential backoff reconnects and making tools temporarily
unavailable.
Now uses case-insensitive matching to detect "method not found" responses
and treats the server as healthy (it did respond, just doesn't support
ping). Resets reconnect attempts and clears error state.
- Add cmd.Version variable set at build time via -ldflags
- Fix Dockerfile ldflags path to use cmd.Version instead of main.version
- Add Makefile with auto-detection from git tags (git describe)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>