Commit Graph
510 Commits
Author SHA1 Message Date
MichaelandGitHub e76aabb3a4 fix(browser): return MEDIA: path from screenshot instead of truncated base64 (#8)
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.
2026-02-28 13:09:03 +07:00
MichaelandGitHub 370c290642 fix(tools): use /images/generations endpoint for Gemini and OpenAI image gen (#9)
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.
2026-02-28 13:08:32 +07:00
viettranx 4104420d5e feat: ignore commands explicitly addressed to other bots in Telegram group chats. 2026-02-28 13:07:32 +07:00
maemreyoandGitHub eacc481998 feat(telegram): add speech-to-text transcription for voice/audio messages with audio-aware routing (#14)
* 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
2026-02-28 11:54:33 +07:00
Duc NguyenandGitHub 4c67dff24d feat(providers): support custom base URL for Anthropic provider (#16)
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).
2026-02-28 11:50:00 +07:00
viettranxandClaude Opus 4.6 7450e7014a fix: Correct provider type seeding and add missing env vars for all channels
- 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>
2026-02-28 11:46:59 +07:00
fcaf3531ba fix(channels): start outbound dispatcher before channel check (#15)
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>
2026-02-28 11:10:18 +07:00
miken90andGitHub 4db5259581 fix(memory): update Gemini embedding to gemini-embedding-001 with dimension support (#10)
- 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
2026-02-28 09:16:00 +07:00
1b1ca2214a feat(discord): support GOCLAW_DISCORD_TOKEN env var for channel config (#6)
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>
2026-02-28 09:14:36 +07:00
viettranxandClaude Opus 4.6 2f44e86ef2 fix: Strip bot self-mention in Discord responses and remove AGENTS.md from summoning modal
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>
2026-02-27 22:12:15 +07:00
viettranxandClaude Opus 4.6 42263e5cc5 feat: Add tool loop detection, negative context injection, and fix Docker workspace permissions
- 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>
2026-02-27 22:00:50 +07:00
viettranxandClaude Opus 4.6 40425d3ad2 fix: Fold tool results as user messages instead of imitable text pattern
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>
2026-02-27 21:03:44 +07:00
viettranxandClaude Opus 4.6 ef3c35a8b5 fix: Drop tool_calls without thought_signature instead of converting to text, fix trace detail word-wrap
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>
2026-02-27 20:53:53 +07:00
viettranx 2e5cf4a9c9 fix: Implement Lark bot identity probe and group history for mention detection, fix Discord placeholder chunking.
- 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.
2026-02-27 20:22:08 +07:00
viettranx 2ee39c8483 feat: Add pairing enforcement, group history, and display name resolution for Discord & WhatsApp channels.
- 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
2026-02-27 19:59:51 +07:00
viettranx 0844969819 feat: Add thought_signature support for Gemini tool calls, including a compatibility function for old sessions and refactoring OpenAI types. 2026-02-27 18:46:01 +07:00
viettranx f3d2baa0bc feat: Implement agent resummoning, add Discord require_mention setting, and streamline agent file templates by removing TOOLS.md and HEARTBEAT.md. 2026-02-27 18:22:07 +07:00
viettranx 197c15943c feat: Add support for a wider range of LLM provider types with corresponding UI and backend logic. 2026-02-27 18:22:07 +07:00
viettranx 444169860c feat: introduce InfoLabel, ToolNameSelect, ProviderModelSelect, TagInput, and KeyValueEditor components and integrate them into various configuration pages for enhanced user experience. 2026-02-27 18:22:07 +07:00
MichaelandGitHub 0105bab2d5 fix(spawn): resolve parent agent from context in managed mode (#4)
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.
2026-02-27 16:06:18 +07:00
MichaelandGitHub 406f83160e fix(mcp): treat "method not found" ping responses as healthy (#1)
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.
2026-02-27 16:02:53 +07:00
viettranx 99c0d7e445 fix: send empty objects instead of null for tools_config and other_config when disabled or empty. 2026-02-27 12:31:13 +07:00
viettranx a4325e2abe feat: Improve agent context management with new compaction settings, session-level context window tracking, and calibrated token estimation for adaptive throttling. 2026-02-27 12:11:25 +07:00
viettranx 86d58e1021 feat: Introduce a new upgrade command and enhance built-in tool settings with provider and model configuration. 2026-02-27 11:38:04 +07:00
viettranx d65d792646 feat: Implement built-in tool management with persistence, API, and UI. 2026-02-27 10:19:19 +07:00
viettranx 66808850d4 feat: Implement LLM retry notifications in channels via placeholder updates. 2026-02-27 09:53:45 +07:00
viettranx 2ac44ce937 feat: enhance filesystem security with symlink/hardlink protection, implement typing indicators, and improve scheduler queue management for stale requests. 2026-02-26 22:47:59 +07:00
viettranx d5cc5a745d feat: Implement vision capabilities and image generation tools, adding media handling, dedicated configurations, and trace optimization for image data. 2026-02-26 22:28:27 +07:00
viettranx 112fddb401 feat: Make prepare-env.sh non-interactive by removing the API key prompt, updating README.md instructions and script output. 2026-02-26 19:42:25 +07:00
viettranx 31f7e1e22e feat: add prepare-env.sh script, update documentation, and refine session scheduling with new lanes and stop commands. 2026-02-26 18:48:13 +07:00
viettranx 1088ffceae feat: Introduce Docker-based sandboxing with container lifecycle management, execution, pruning, and core sandbox interfaces. 2026-02-26 16:45:45 +07:00
viettranx f3ba434e8e feat: Display cached token count in the traces table. 2026-02-26 12:12:53 +07:00
viettranxandClaude Opus 4.6 90107c73d3 docs: add git clone step to Quick Start
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 12:12:30 +07:00
viettranxandClaude Opus 4.6 a0ef0c2f91 build: add dynamic version injection via ldflags and Makefile
- 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>
2026-02-26 10:42:54 +07:00
viettranx 6066adc15a feat: Implement agent delegation, quality gates, and a new hooks evaluation system. 2026-02-26 10:15:07 +07:00
viettranx b365ef5494 feat: Modularize Telegram commands, introduce new scheduler components, and enhance agent management and Feishu integration. 2026-02-26 08:16:06 +07:00
viettranx dfd91556f8 feat: Introduce agent teams, agent linking, and advanced agent orchestration features. 2026-02-25 23:24:52 +07:00
viettranx 67b19e4746 feat: Implement standalone gateway mode with file-based agent storage and add path denial capabilities to filesystem tools. 2026-02-25 10:07:25 +07:00
viettranx 206c8256fd refactor: merge sql file to repare to public repo 2026-02-25 08:52:47 +07:00
viettranx f71dad016f refactor: improve dialog form scrolling behavior by making content scroll independently of header and footer. 2026-02-25 08:47:50 +07:00
viettranx 82efb43715 feat: Add persistent workspace volumes, improve workspace directory creation robustness, and enhance trace error display. 2026-02-24 22:53:09 +07:00
viettranx 9b0dce2aa5 feat: Dynamically register/unregister providers in memory and recompute stale cron job next_run_at on startup. 2026-02-24 21:59:38 +07:00
viettranx 3a85614e0b feat: exempt USER.md writes from group permission checks during bootstrap onboarding. 2026-02-24 20:42:11 +07:00
viettranx f5ff96d998 feat: Improve agent concurrency with per-session summarization locks and message buffering, add adaptive scheduler throttling, and introduce Telegram /stop and /stopall commands. 2026-02-24 17:44:50 +07:00
viettranx 16022d77be feat: Implement agent resummoning with UI retry, add provider verification, and introduce created_at timestamps to various tables. 2026-02-24 15:18:25 +07:00
viettranx 48878848df feat: enhance agent creation UI/UX, improve agent memory configuration, and refine styling across agent components. 2026-02-24 11:30:51 +07:00
viettranx 08ced252b2 feat: Introduce agent summoning flow with a dedicated modal and updated bootstrap process for predefined agents. 2026-02-24 10:19:49 +07:00
viettranx abaaf8fc83 feat: Implement dynamic model selection for agents using a new backend API and a reusable combobox component. 2026-02-23 19:17:34 +07:00
viettranx 3d63e419a5 feat: Only send 'Thinking...' placeholder message in Telegram direct messages. 2026-02-23 18:19:23 +07:00
viettranx 4feb8fb629 feat: Implement useDeferredLoading hook to defer skeleton display across various pages, enhancing perceived loading performance. 2026-02-23 17:52:48 +07:00