Commit graph

152 commits

Author SHA1 Message Date
Alessandro
1f34b87c00 Require visual verification for computer-use captures
Sanitize embedded image data URLs from prompt token estimates so screenshot attachments do not explode context accounting.\n\nStrengthen computer_use_remote prompt, skill, and capture-result text so state-changing desktop actions are treated as attempts until a fresh screen visibly confirms the requested outcome.
2026-05-23 10:32:37 +02:00
Alessandro
d1827e6c66 Refactor: use user locale for time displays
Some checks are pending
Build And Publish Docker Images / plan (push) Waiting to run
Build And Publish Docker Images / build (push) Blocked by required conditions
Add user-configurable timezone and 12/24-hour preferences, then wire them through settings, runtime snapshots, scheduler payloads, wait handling, notifications, backups, memory, plugin metadata, and frontend formatters.

Keep UTC as the boundary for absolute instants while serializing user-facing dates in the configured or browser-resolved timezone. Preserve scheduler wall-clock inputs in the selected timezone, propagate TZ into desktop/runtime process environments, and restart active desktop sessions when the runtime timezone changes.

Cover the risky paths with timezone regression tests for settings normalization, auto and fixed timezone resolution, scheduler round-trips, memory timestamp conversion, and desktop timezone sync.
2026-05-21 15:26:00 +02:00
Alessandro
daf95ec3ab Normalize tool contracts and slim prompt surface
Standardize multi-action tools around tool_args.action while keeping parser compatibility for older tool/args, tool_name:action, and method-shaped requests. This keeps new prompts clean without breaking agents that learned the previous dialect.

Move A0 connector remote execution/file tools into stable standard prompts, make remote targeting independent of the active chat context, and skill-gate beta computer-use remote so it no longer weighs down the always-on tool list.

Align text editor, scheduler, skills, office artifact, memory, notify, and browser prompts/tools around the canonical action contract. Add scheduler update/timezone handling, skills_tool read_file, text editor patch coverage, and fixes for memory_forget, behaviour_adjustment, and code execution progress warnings.

Reduce default prompt pressure by compacting browser and scheduler prompts into skill-backed manifests, shortening skill catalog descriptions, and pruning noisy framework knowledge. Remove obsolete connector prompt stubs and root tool-call knowledge examples.

Tests: conda run -n a0 pytest tests/test_a0_connector_prompt_gating.py tests/test_tool_action_contracts.py tests/test_task_scheduler_timezone.py tests/test_text_editor_context_patch.py tests/test_tool_request_normalization.py tests/test_office_document_store.py::test_odf_is_advertised_and_docx_remains_explicit_compatibility tests/test_office_document_store.py::test_document_artifact_accepts_method_alias_for_ods_create tests/test_skills_runtime.py tests/test_default_prompt_budget.py::test_a0_small_profile_removed_and_prompt_text_generic -q
2026-05-09 21:54:43 +02:00
Alessandro
5f063a6feb
Merge pull request #1550 from keyboardstaff/ready
Some checks are pending
Build And Publish Docker Images / plan (push) Waiting to run
Build And Publish Docker Images / build (push) Blocked by required conditions
fix: tool request validation crash on non-canonical field names
2026-04-27 19:26:06 +02:00
Alessandro
b782d40c3a fix: normalize tool request fallback fields 2026-04-27 19:24:56 +02:00
Alessandro
983d431a5e browser: replace browser-use agent with native browser
Introduce the new built-in Browser plugin for Agent Zero, replacing the legacy
browser-use-based browser agent with a direct Playwright-powered browser tool,
live WebUI viewer, browser session controls, status APIs, configuration, and
extension-management support.

Add browser-specific modal behavior so the browser can run as a floating,
resizable, no-backdrop window, including modal focus, toggle, and idempotent
open helpers for richer WebUI surfaces.

Remove the old `_browser_agent` core plugin and the `browser-use` dependency,
then clean up stale browser-model wiring and references across agent code,
model configuration docs, setup guides, troubleshooting docs, skills, and
Agent Zero knowledge.

Update regression and WebUI extension-surface coverage for the new browser
architecture and modal behavior.

The legacy browser-use implementation has been extracted from core so it can
continue separately as a community plugin published through the A0 Plugin Index for any user or professional that were relying on it for workflow.
2026-04-24 15:43:52 +02:00
keyboardstaff
14f5185cff fix: tool request validation crash on non-canonical field names 2026-04-22 22:01:25 -07:00
Greg DeYoung
7cf8905af5 fix: validate_tool_request rejects empty tool_args dict (PATCH-015)
Bug: not tool_request.get("tool_args") evaluates True for empty dict {}
causing ValueError crash on any tool call with no arguments.
Scheduler list_tasks, health checks, etc all broken.

Fix: Changed to existence check ("tool_args" not in tool_request)

Co-authored-by: Agent Zero <agent@zero>
2026-04-07 01:09:00 +00:00
Alessandro
5a2223596a stop tool dispatch at first completed json object
Tool execution no longer waits for the full streamed assistant text. We now detect the first explicitly closed top-level JSON object, freeze that snapshot as the canonical tool request, and stop the model stream there for dispatch.

To make that safe, DirtyJson completion semantics are tightened so completed=true only means the root object was explicitly closed, not that parsing hit end of file. I also restricted the new extraction path to object roots only, since tool calls are always brace-delimited objects, and added tests for parser completion and early stream stop.
2026-04-03 16:56:21 +02:00
Nicolas Leão
bd5eb7c61c fix: let agents fix their own tool call format instead of erroring 2026-03-29 11:06:39 -03:00
keyboardstaff
1bd5bc01d6 refactor(chat_branching): ID-based log ↔ history linking for precise branch trimming 2026-03-24 03:04:09 -07:00
Jan Tomášek
112ea2af53
Merge pull request #1262 from keyboardstaff/models-config-plugin
Models config plugin
2026-03-18 21:03:30 +01:00
frdel
d6f67b4df3 refactor: improve caching system and optimize extension/plugin path resolution
- Change cache key type from `str` to `Any` in cache helper functions
- Add `determine_cache_key` helper to generate consistent cache keys from agent profile and project
- Add extension call logging with `EXTENSIONS_LOG` environment variable support
- Implement caching for extension classes, enabled plugins, and subagent paths
- Optimize `get_abs_path` with `_resolve_path` helper to avoid redundant `get_base_dir` calls
- Store
2026-03-18 12:40:33 +01:00
keyboardstaff
d570c629c2 feat: add _model_config plugin with call-time model resolution 2026-03-14 09:41:19 -07:00
frdel
1b89a0d359 Add tool request validation and plugin change notifications
Introduce validate_tool_request() extensible method in agent.py to validate tool request structure (dict with tool_name string and tool_args dict fields) before processing. Add after_plugin_change() helper in helpers/plugins.py that clears cache and sends a frontend reload notification (throttled to display_time interval) with a reload button. Update plugin installer install/delete flows to call after_plugin_change(). Extend notification
2026-03-10 13:08:48 +01:00
linuztx
63651deb9e refactor: Extract code execution tool to plugin 2026-03-08 09:52:17 +08:00
TerminallyLazy
592fa615ae Add util_model_call_after extension hook
Adds a symmetric "after" hook to call_utility_model, matching the existing
util_model_call_before hook. This allows plugins (e.g. observability/tracing)
to capture the utility model response for logging, cost tracking, and span
finalization.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 09:52:39 -05:00
frdel
ab9fc4ee7f Refactor extensions to async/sync API
Redesign extension handling to support explicit async/sync execution. helpers/extension.py rewrites the extensible decorator, adds call_extensions_async / call_extensions_sync, and a helper to gather extension classes; caching flag adjusted. Updated call sites across the codebase (agent, APIs, plugins, tools, settings, extensions) to use extension.extensible and the new call_extensions_async/sync API, and converted several extension handlers from async to sync. Also small frontend tweaks (use globalThis.runtimeInfo) and minor import updates (csrf_protect in run_ui). This centralizes extension discovery/execution and avoids previously scattered asyncio.run usage.
2026-03-06 11:32:08 +01:00
frdel
d02dda3667 BIG PYTHON REFACTOR
Python scripts moved out of python/ folder to root to be unified with plugins

+ frontend extension around api calls
2026-03-05 17:28:11 +01:00
frdel
2cf73c4b4a Return LogOutput object and update callers
Introduce a LogOutput dataclass (items, start, end) and change Log.output to return a LogOutput instead of a bare list. Update callers to unwrap items: api_log_get now reads log_output.items, and state_snapshot builds logs and log_end from the LogOutput and uses log_end for log_version. Also re-enable the @extensible decorator on AgentContext.output. These changes expose log metadata (start/end) alongside items for consumers.
2026-03-03 11:08:40 +01:00
frdel
8d82979157 HOTFIX: Disable @extensible decorator on output
causes websocket log de-sync, removing for now
2026-03-03 10:37:57 +01:00
frdel
d7f39cd79b Unify exception handling via extensible handle_exception
Replace ad-hoc mutable exception_data flows with a single extensible Agent.handle_exception hook. Agent now delegates monologue/message_loop/process exceptions to handle_exception, and many extensions were renamed/updated to use a unified `data` payload (and new extension point naming) instead of `exception_data`. The extensible decorator was adjusted to initialize data['exception']=None and to derive different start/end names, and call_extensions usage was updated accordingly. Other changes: load_webui_extensions now passes agent to plugins.get_webui_extensions, plugin path resolution was improved to accept patterns via get_enabled_plugin_paths, some duplicate/unused message-loop exception extension files were removed, and task_scheduler references to critical-exception handling were adjusted (commented). These changes centralize and standardize exception handling for extensions and simplify extension implementations.
2026-03-03 10:06:22 +01:00
frdel
0372c05f2b Move exception handling to extensions
Refactors exception handling to use extension points and plugins. Moves InterventionException and HandledException into python/helpers/errors and routes exceptions from Agent (monologue and outer loops) through extension call points (monologue_exception, message_loop_exception, context_chain_exception) instead of inline handling. Removes inlined retry/critical logic and adds an error_retry plugin (reset counter + retry extension) as the retry implementation; also adds monologue_exception extensions to handle repairable, intervention, and critical exceptions. Adjusts extension hook naming in python/helpers/extension, adds agent-presence guards to several memory extensions, prevents a direct agent.handle_critical_exception call in TaskScheduler, renames a test file location, and fixes a webui modal path.
2026-03-02 16:51:39 +01:00
frdel
f7b7683918 Add extensible hooks and improve agent detection
Annotate many Agent and AgentContext methods with @extensible to expose extension points and enable runtime hooks. Refactor python/helpers/extension.py to derive extension points from __qualname__, add a _get_agent helper that more robustly finds an Agent instance in args/kwargs, and skip extension handling when module/qualname cannot be determined. Apply extensible to relevant Flask handlers in run_ui and import the extension helper. Also bump the default sleep_time in the code execution tool from 0.1 to 0.5s to reduce polling frequency.
2026-02-25 20:32:49 +01:00
frdel
d82b121bc9 Add extensible decorator and cache controls
Introduce an extensible extension point system and finer cache control. Added extensible decorator in python/helpers/extension.py to wrap sync/async functions, emit start/end extension points, detect Agent instances, and allow extensions to modify inputs/results/exceptions. Reworked extension loading to use the cache API and a dedicated cache area. Enhanced python/helpers/cache.py with global and per-area toggles and early-return behavior in add/get/remove. Updated API handler caching (python/helpers/api.py) to use the cache area toggle and simplify cache logic. Marked several initialization functions as @extension.extensible in initialize.py. Moved nest_asyncio.apply() from agent.py into python/helpers/runtime.py to ensure the event loop patch is applied at runtime initialization. Also applied small typing/formatting tweaks and path handling improvements.
2026-02-25 16:52:35 +01:00
Alessandro
505128c384 Detach memory and update config
Removed the memory_subdir attribute from AgentConfig and related settings, transitioning to a project-based memory isolation approach. Updated the memory plugin configuration to default to an empty string for agent_memory_subdir. Enhanced the get_context_memory_subdir function to support project-specific memory directories. Removed the project-edit-memory component and adjusted the UI to reflect these changes. Added a new memory configuration file for better management of memory settings.
2026-02-21 10:41:29 +01:00
frdel
5acb733b9e Refactor plugin/project helpers; add plugin UI
Major refactor of plugin and project helper APIs and add a plugin management UI.

Key changes:
- Rename project meta helpers from get_project_meta_folder -> get_project_meta and update callers across many modules (projects, memory, skills_import, secrets, subagents, skills).
- Overhaul python/helpers/plugins.py: introduce PluginMetadata and PluginListItem (Pydantic), new get_plugins_list/get_enhanced_plugins_list, support for reading plugin config (config.json), enable/disable logic (.enabled/.disabled), get_enabled_plugin_paths(), and helpers to find/read/save plugin assets. Plugin discovery now supports webui/main/config detection.
- Use enabled-plugin-aware lookups in subagents, extension loading, and other places (plugins.get_enabled_plugin_paths / get_enhanced_plugins_list used instead of previous list_plugins/get_plugin_paths where appropriate).
- Add API endpoint python/api/plugins_list.py to return JSON plugin lists.
- Add frontend plugin management UI: web components webui/components/plugins/list/plugin-list.html and pluginListStore.js; wire quick-actions button to open the plugins modal.
- Add new webui assets and config pages for example_agent and memory plugins; add plugins/plugin.json metadata for example_agent and memory.
- Memory plugin fixes: updated calls to use get_project_meta and adjusted memory path helpers to use project meta layout.
- File helper: add read_file_json to read JSON files directly.
- run_ui: tightened plugin asset serving security (only serve from plugin webui or plugin extensions/webui), added unified _serve_plugin_asset helper, and load plugin API handlers using enhanced plugin list.
- Small fixes: adjustments to parse_prompt/read_prompt/tool lookup to use updated subagents.get_paths signature, extension loader now uses enabled plugin paths, and web UI extensions JS updated to expect string paths.

These changes centralize project meta handling, improve plugin discovery and enable/disable behavior, and add a basic plugin management UI and API.
2026-02-19 17:20:14 +01:00
frdel
3bfdf91637 Support webui JS/HTML extensions and plugin paths
Add full support for loading web UI extensions from plugins: - Frontend: new extensions loader (js/extensions.js) that loads and caches JS and HTML extensions, calls JS hooks, imports HTML as <x-component> tags, normalizes paths, and replaces the old plugins.js auto-inject logic. - Messages: make setMessages async, introduce extension hooks (set_messages_before_loop / after_loop) and integrate JS extension calls; adjust Scroller usage accordingly. - Components: fix x-component path handling in several templates and components import logic. - Backend: add filters to /api/load_webui_extensions and pass them to plugin helper; update helpers to look for plugin extensions under extensions/python instead of backend. - Plugins helper: extend get_webui_extensions to accept file glob filters, dedupe matches, return relative paths, and improve error logging. - Project config: include plugins and usr/plugins JS files in jsconfig.json. - Add a small test extension file and move several plugin extension files from backend/ to python/ directories. - Minor: reset error_retries earlier in agent message loop to avoid stale retry counts.

These changes enable a flexible plugin extension system for both JS and HTML assets, improve caching and path normalization, and wire up backend APIs and helpers to support the new structure.
2026-02-17 10:17:19 +01:00
Alessandro
d69e30adc6 simplification and further memory decoupling
components.js restore
plugins tools fix
restore agent.py
2026-02-15 03:25:33 +01:00
3clyp50
54fb4746a4 initial plugins effort; memory system PoC
plugin manifest update
add memory plugin PoC files
offload memory prompts
cleanup imports
extract memory UI
fix paths
plugin docs
2026-02-14 17:05:37 +01:00
frdel
1945555b2d reset error retry counter 2026-02-13 12:10:09 +01:00
frdel
3dceaca64e caching and ctx window optimizations 2026-02-11 23:04:32 +01:00
frdel
fe46f045fe message rendering polishing 2026-02-04 08:47:06 +01:00
frdel
4932e12546 WebSocket merge 2026-02-01 16:07:45 +01:00
frdel
4aaf7af34a ui: welcome screen, queue input, interverntions 2026-01-31 19:37:39 +01:00
frdel
3d8cc2a620 nudge + move queue extension 2026-01-30 12:40:19 +01:00
frdel
1581d7d12f context.running to identify chat process 2026-01-30 09:54:31 +01:00
frdel
f63df9f4eb chat rendering refactor - work in progress 2026-01-25 19:12:34 +01:00
frdel
3c568891c7 minor errors to warnings 2026-01-21 18:39:45 +01:00
frdel
08693c22f0 fixes - allowed hosts, image get folders, extensions after termination 2026-01-20 16:40:16 +01:00
frdel
140b7b96dd Merge branch 'pr/855' into development 2026-01-07 09:42:36 +01:00
frdel
ed0964a857 sensitive settings store/load, short guids in scheduler and vdb 2026-01-02 11:28:11 +01:00
frdel
00108450a5 Update agent.py 2025-12-30 09:46:01 +01:00
Rafael Uzarowski
cc7af97ed3
Fix prompt fence stripping policy
- Restrict code fence stripping to fences at start-of-line (prevents inline "~~~markdown" from being treated as a fence and merging lines)
- Only strip fences for full JSON templates in Agent.read_prompt() and files.parse_file()
- Preserve fenced examples in markdown/tool prompts while keeping json-only prompts parseable
- Add regression tests for fence stripping and prompt fence policy
2025-12-28 22:33:34 +01:00
frdel
dd018d66a4 pipx, subagent paths, alpine directives, CSRF allowed origins autoset 2025-12-19 11:30:08 +01:00
frdel
0b35de52b4 Merge branch 'pr/810' into development 2025-11-26 09:25:47 +01:00
frdel
11d1cb0e64 subagents preparation 2025-11-26 09:07:30 +01:00
linuztx
dbebd41145 agent: Retry on critical error 2025-11-18 18:49:57 +08:00
frdel
0e1aa85890 projects continued 2025-11-03 16:17:12 +01:00
frdel
2b7b1ac623 projects prototype, email parser 2025-10-28 09:04:17 +01:00