Commit graph

285 commits

Author SHA1 Message Date
linuztx
9d9dd4bd7f fix: stop bridge and poll loop when plugin is disabled or toggled off 2026-03-27 14:41:14 +08:00
linuztx
66b0a7d3e0 improve: fix allowed users input, auto-strip + prefix, log ignored messages 2026-03-27 11:05:58 +08:00
linuztx
938e7b9312 improve: add line break to allowed users description 2026-03-26 23:26:42 +08:00
linuztx
4ef64b9121 feat: convert markdown to WhatsApp formatting before sending replies 2026-03-26 22:44:55 +08:00
linuztx
f549b49f44 improve: add progress update instructions to system context prompt 2026-03-26 22:34:56 +08:00
linuztx
66e5d51dcf fix: stop typing indicator on agent error or generation failure 2026-03-26 22:23:32 +08:00
linuztx
3dd01cd04c improve: persistent typing indicator with poll-based refresh 2026-03-26 18:31:38 +08:00
linuztx
8d0ec86f15 Update README.md 2026-03-26 17:11:25 +08:00
linuztx
e664673c1c feat: add agent prefix to self-chat replies for visual distinction 2026-03-26 16:05:44 +08:00
linuztx
18c5716d10 fix: clear typing indicator after sending reply in self-chat mode 2026-03-26 15:43:01 +08:00
linuztx
7c653c9d56 improve: merge WhatsApp Link and Disconnect into single Account field 2026-03-26 14:43:06 +08:00
linuztx
57c95e6f13 feat: add disconnect account option to switch WhatsApp accounts 2026-03-26 14:11:05 +08:00
linuztx
c62695356e improve: move mode description inline and reorder Allow Group after Allowed Users 2026-03-26 14:00:00 +08:00
linuztx
18a56ea446 fix: remove duplicate typing indicator before sending reply 2026-03-26 13:44:17 +08:00
linuztx
44c90a118f improve: remove sender number from DM prompt 2026-03-26 13:30:06 +08:00
linuztx
64fe7d0302 fix: handle documentWithCaptionMessage wrapper for captioned documents 2026-03-26 13:17:29 +08:00
linuztx
00b6657185 feat: add attachment reader/writer with RFC and download all media types 2026-03-26 13:06:40 +08:00
linuztx
8041c085d2 improve: update group prompt and reply instructions 2026-03-26 11:45:17 +08:00
linuztx
71a6eb7557 feat: reply to specific messages in group chats with quote 2026-03-26 11:26:36 +08:00
linuztx
6bf63eb9c6 feat: detect replies to bot messages in group chats 2026-03-26 09:57:34 +08:00
linuztx
b4492e0759 improve: resolve group names and sender LIDs in bridge messages 2026-03-26 09:20:27 +08:00
linuztx
14e673f165 feat: add allow_group toggle to respond only when mentioned in group chats 2026-03-26 04:44:50 +08:00
linuztx
40f4884319 refactor: rename mode value from bot to dedicated 2026-03-26 03:20:02 +08:00
linuztx
50af7c2bde fix: kill orphaned bridge process on port before starting new one 2026-03-26 02:34:51 +08:00
linuztx
45b21c093a improve: auto-restart bridge when config changes 2026-03-26 02:07:45 +08:00
linuztx
a12183ba6e feat: add bot and self-chat mode selection for WhatsApp bridge 2026-03-26 01:39:55 +08:00
linuztx
bb8961ab73 improve: send typing indicator immediately on message receive 2026-03-26 00:56:56 +08:00
linuztx
84c12b0c23 feat: add WhatsApp integration plugin with Baileys bridge and QR pairing 2026-03-26 00:29:04 +08:00
frdel
4d32432d54 Remove memory quick action extension, increase header icons dropdown shadow
- Delete memory-entry.html extension from sidebar quick actions
- Increase dropdown box-shadow from `0 2px 8px rgba(0,0,0,0.1)` to `0 2px 13px 2px rgba(0,0,0,0.3)`
2026-03-24 19:37:33 +01:00
frdel
6d44c885f8 Update default_config.yaml 2026-03-24 19:28:32 +01:00
frdel
986c1b1cee Refactor default presets, fix chardet version conflict, improve welcome banner refresh logic
- Rename presets: "Efficiency" → "Max Power", "Intelligence" → "Balance", add "Cost Efficient"
- Update preset models: use Claude Opus 4.6, Sonnet 4.6, Kimi K2.5, GPT-5.4-mini/nano, Gemini 3.1 Flash Lite
- Adjust context lengths and vision capabilities across presets
- Pin chardet<6 to avoid import warnings from requests when unstructured is installed
- Replace settings-updated listener with modal-closed event
2026-03-24 19:17:12 +01:00
Jan Tomášek
ab28c0f25a
Merge pull request #1320 from 3clyp50/dev2
Decouple browser model wiring; sidebar quick actions; chat input height and fullscreen icon
2026-03-24 19:14:15 +01:00
Alessandro
5f235f73f6 model_config: decouple browser agent model wiring
Move the browser model instantiation logic out of `_model_config` and into `_browser_agent` to properly invert the dependency direction.

This prevents the always-enabled `_model_config` plugin from taking a hard dependency on the optional `_browser_agent` module, ensuring it won't break if the browser module is removed or replaced.
2026-03-24 18:09:48 +01:00
frdel
75b8085b65 Add unzip to Docker base packages, refactor API key handling, improve self-update system
- Add unzip package to Docker base installation
- Remove deprecated missing API key banner extension
- Refactor API key management: clear drafts on init, track dirty state, allow empty string saves
- Add version filtering to self-update: enforce minimum v0.9.9, validate tag format
- Improve self-update UI: convert howto to Bootstrap collapse, fix branch selector reactivity, group tag suggestions
- Fix settings
2026-03-24 17:17:19 +01:00
frdel
e680256b29 Refactor API key handling and update system improvements
- Refactor API key management: move from global env-only to per-model config with dotenv fallback
- Add API key placeholder masking and reveal functionality in WebUI
- Consolidate API key validation logic into `has_provider_api_key()` helper
- Improve update system: add branch filtering for tags, simplify backup naming
- Add branch detection to version info and default to current branch for updates
- Extract configure model settings link to constant
2026-03-24 14:41:46 +01:00
keyboardstaff
1bd5bc01d6 refactor(chat_branching): ID-based log ↔ history linking for precise branch trimming 2026-03-24 03:04:09 -07:00
keyboardstaff
aafe7f4aa8 fix(chat_branching): not trimming agent history 2026-03-23 22:37:20 -07:00
Jan Tomášek
1a5a622203
Merge pull request #1303 from keyboardstaff/telegram-integration-plugin 2026-03-24 06:00:11 +01:00
Jan Tomášek
fe278e9495
Merge branch 'development' into browse-extract 2026-03-23 21:35:46 +01:00
frdel
4a8a747776 Merge branch 'development' of https://github.com/agent0ai/agent-zero into development 2026-03-23 21:16:16 +01:00
Jan Tomášek
7bc8dc95aa
Merge pull request #1310 from linuztx/email-plugin-improve2
Email integration plugin fixes and improvements (part 2)
2026-03-23 21:16:03 +01:00
frdel
790bd64daa Merge branch 'development' of https://github.com/agent0ai/agent-zero into development 2026-03-23 21:14:48 +01:00
frdel
89d4b8913f refactor: consolidate module loading utilities and add plugin lifecycle improvements
- Move load_classes_from_file and load_classes_from_folder from extract_tools to new modules helper
- Update all imports across api, extension, files, and plugins to use helpers.modules
- Add namespace purging to refresh_plugin_modules for selective plugin reload on Python changes
- Implement embed trimming in history based on model config max_embeds and vision support
- Add pre_update hook documentation to plugin
2026-03-23 21:13:25 +01:00
Alessandro
d986a19839 plugin_installer: refetch plugin hub on Browse tab
The browse view used x-create on install-index to load the index, but
that hook was not a dependable signal when returning from the Git or ZIP
tabs. setTab('store') now resets browse state and calls fetchIndex so the
hub stays in sync whenever Browse is selected, including on modal open.
2026-03-23 17:56:38 +01:00
Alessandro
338c86a058 upgrade tool extension hook to generic get_tool_message_handler
Replace the restrictive `get_tool_message_badge` extension hook with a generic `get_tool_message_handler` hook. This allows plugins to provide a full handler function for their specific `type === "tool"` rows.

Plugins can now completely take over rendering of their tool rows, or they can import and delegate to `drawMessageToolSimple` if they simply want the standard UI with a custom badge. Updated the `_browser_agent` plugin to use the new hook and documented the change in `AGENTS.plugins.md`.

feat: add get_tool_message_badge plugin hook

Add a WebUI extension point `get_tool_message_badge` so plugins can set short tool-row badge codes (`code`) and optional `displayKvps` after core handling for built-in tools (skills, vision, search, memory). Core `drawMessageTool` is now async and calls `callJsExtensions("get_tool_message_badge", …)` on the fallback path.

Remove the hardcoded `browser_agent` → `WWW` branch from `messages.js`. The `_browser_agent` plugin registers `WWW` via `extensions/webui/get_tool_message_badge/browser-tool-badge.js`.

Document the hook in `docs/agents/AGENTS.plugins.md`. With the plugin disabled, `browser_agent` tool rows no longer get a `WWW` badge from core (generic tool row).
2026-03-23 17:56:38 +01:00
Alessandro
db15bdb3bf refactor: extract browser agent into built-in plugin
Move the Browser Agent/browser-use stack into a tracked built-in
`_browser_agent` plugin while preserving the current model/config flow.

Changes:
- add built-in `_browser_agent` plugin with tool, helpers, prompts, assets,
  status API, and WebUI message/status surfaces
- move browser-use wrapper and monkeypatch ownership out of `models.py`
  into plugin helper code
- keep browser model resolution on the `_model_config` path and continue
  using the effective Main Model / chat model config
- remove stale Browser HTTP Headers UI and outdated browser-model wording
- make Playwright runtime resolution bootstrap-only and stop installing
  browser binaries on demand
- switch browser log rendering to plugin-owned WebUI extension handling
  with core fallback compatibility for old logs
- delete obsolete core browser tool/helpers/prompts/assets after plugin
  resolution is in place
- update docs to reflect built-in plugin ownership and Main Model browser
  behavior

feat(browser-agent): improve lifecycle reliability, LLM compatibility, and local-dev bootstrap

- **Lifecycle Reliability**: Implemented stale Chromium lock file cleanup and one-shot ephemeral profile fallback to prevent CDP connection hangs and profile-locked crashes.
- **LLM Compatibility**: Added OpenRouter/Gemini shims including schema compaction, system instruction injection, and JSON output normalization for `browser-use` validation.
- **Cache Alignment**: Reverted Playwright browser cache to `tmp/playwright` for parity with core behavior and updated Docker scripts and documentation accordingly.
- **Local-Dev Bootstrap**: Added a plugin `install()` hook to automate Python dependency setup and transitioned bootstrap feedback to UI notifications.
- **Plugin Config**: Set `always_enabled: false` to allow users to opt-out or bring their own browser providers.
- **Testing**: Expanded test suite to cover lifecycle edge cases, LLM normalization, and bootstrap logic.

rework clean up browser agent sessions on reset/removal

Force browser-agent teardown to use BrowserSession.kill() so keep_alive sessions do not leave Chromium running and keep the profile locked. Add centralized browser state cleanup for reset/context removal and regression tests to cover the new teardown path and prevent SingletonLock fallbacks from stale sessions.

add browser agent thumbnail

restore local dev for Playwright in browser agent via hook

- Introduced a new hook to bootstrap Playwright for local development, ensuring the Chromium headless shell is installed when in development mode.
- Updated the Playwright helper to call the new hook if the binary is not found during the binary check.
- Added tests to verify the correct installation and behavior of the Playwright binary in local development scenarios.

proper install notifications for Playwright in local dev

- Added notification management for Playwright bootstrap process, including info, success, and error notifications.
- Enhanced the `bootstrap_local_dev_playwright` function to notify users about the installation status of the Playwright runtime.
- Updated tests to verify the correct notifications are sent during the Playwright installation process.

rework browser state cleanup extensions for agent context removal and reset

- Added `CleanupBrowserStateOnRemove` and `CleanupBrowserStateOnReset` extensions to handle browser state cleanup when an agent context is removed or reset.
- Updated `cleanup_browser_agent_state` function to utilize new protocols for better type safety and clarity.
- Enhanced the `State` class to ensure proper cleanup of browser sessions and user data directories.
- Introduced tests to validate the cleanup functionality and ensure browser sessions are correctly managed during agent lifecycle events.

enhance Playwright cache handling

- Updated Playwright helper to include support for a new cache directory at `.cache/ms-playwright`, aligning with standard cache locations.
- Modified the `get_playwright_search_dirs` function to incorporate the new cache path.
- Added a new test to verify the retrieval of the Playwright binary from the repository's `.cache/ms-playwright` directory, ensuring proper functionality across different cache locations.
- Updated existing tests to reflect changes in cache path handling.

update docs and README.md

restore local dev bootstrap and async-safe teardown

Keep Browser Agent bootstrap local in development, matching pre-extraction behavior, by removing the RFC filesystem hop from Playwright cache setup. Restore on-demand local-dev bootstrap through plugin hooks before browser-use import, so missing browser packages and runtime can be installed on first use.

Rework browser session teardown to be async-safe during reset and cleanup, avoiding nested event loop shutdown failures while still terminating the browser worker cleanly. Also remove redundant browser-use patch application and add regression tests covering local bootstrap, reset-time async shutdown, and lifecycle cleanup.

playwright bootstrap via plugin hooks

[Fixed][P1] The hook-based restore was architecturally in the right place, but it was too late to recover a missing local browser_use / playwright install. The browser tool imports browser_use at module load time, and tool loading silently skips modules that fail to import, so the plugin install() hook could never rescue the first browser invocation if those packages were absent. I fixed that by calling the plugin install hook before importing browser_use in local development: browser_use.py, browser_use.py, agent.py, test_browser_agent_playwright_bootstrap.py.

[Fixed][P3] The Browser Agent UI and runtime error text still claimed on-demand install did not exist, which contradicted the intended local-dev bootstrap path. I corrected both messages so they now describe the real behavior: main.html, playwright.py.

rm tests

restore old browser use logic files

restore old browser working behaviour

browser: migrate cleanup hooks to new extensible paths

Update Browser Agent cleanup extensions to the new deep @extensible path layout introduced in 7e1d9ad2a4, so AgentContext reset/remove hooks fire again after the framework migration.

`This restores browser state cleanup when chats are reset or deleted, preventing keep-alive browser sessions from surviving context removal and leaving chats stuck until restart. The change also keeps the recent browser regressions covered with focused tests for Anthropic/OpenRouter action normalization, keep-alive session teardown via kill(), and extension discovery under the new _functions/... path structure.`

Update messages.js

update docs
2026-03-23 15:21:57 +01:00
keyboardstaff
24eb762963 fix(telegram): group attachment detection, typing lifecycle, per-chat session isolation
- Fix group @mention with attachments being silently dropped: filter now checks caption / caption_entities for media messages
- Fix typing indicator cancelled prematurely on inline updates (break_loop=false): typing and reply_to cleanup moved to process_chain_end's finally block
- Fix same user's group and private chat interfering with each other: _map_key now includes chat_id for per-chat context isolation
- Refactor _make_handler to use direct function references instead of string-based getattr
2026-03-23 07:18:42 -07:00
linuztx
8fcb778159 fix: prevent empty project override in UI and sync project state on routes 2026-03-23 21:34:28 +08:00
keyboardstaff
f5adfa26ce refactor(telegram): handler factory and add README 2026-03-23 06:26:54 -07:00
linuztx
820928260c fix(email): reference attachments before text parts and remove unused import 2026-03-23 18:28:42 +08:00