Commit graph

171 commits

Author SHA1 Message Date
Alessandro
5c914bc49e Tighten Responses bad request fallback
Keep fallback for endpoint-specific and Venice-style Responses payload rejections, but stop treating generic Bad Request validation text as proof that Responses is unsupported.

Add a regression that generic pre-output Responses 400s raise without trying Chat Completions.
2026-06-25 21:51:13 +02:00
Alessandro
eab40dc121 Flatten tool JSON extraction
Keep the valid-tool-root preference added for streamed snapshots, but avoid collecting and re-walking parsed candidates.

Remember the first parsed object/root while scanning and use a small predicate for tool-request recognition.
2026-06-25 21:49:29 +02:00
Alessandro
bf72345da6 Simplify skill frontmatter warnings
Keep the malformed SKILL.md warning behavior, but reduce the diagnostic machinery to a once-per-path warning with line numbers only for parser-owned structural errors.

Update the regression to assert the stable warning message without depending on the previous path/line/error dedupe key.
2026-06-25 21:48:16 +02:00
Alessandro
53a12a2ddd Prefer tool roots in streamed snapshots
Keep the streaming early-stop caller untouched by making extract_json_root_string prefer the first complete JSON root that normalizes as a tool request while preserving its first-root fallback for non-tool JSON.

Add regression coverage for incidental JSON before a streamed tool-call envelope.
2026-06-25 14:16:28 +02:00
Alessandro
884f13dea6 Keep skills tooling compatible
Default empty skills_tool calls to list, accept legacy method as a deprecated action alias, and warn when malformed SKILL.md frontmatter causes a skill to be skipped. Update the helper/tool DOX notes and focused regressions.
2026-06-25 09:41:08 +02:00
Alessandro
bd7e829a0f Materialize MCP image attachments
Save MCP image and image-resource payloads as scoped artifacts, return their paths in tool text and attachment metadata, and keep them model-visible through raw image history content. This gives downstream media delivery a real file path instead of only an inline data URL.
2026-06-25 09:40:47 +02:00
Alessandro
72cc78f8a5 Fallback Responses bad requests
Treat pre-output Responses API 400 validation failures as unsupported so OpenAI-compatible providers that reject /v1/responses payloads can retry through Chat Completions. Also prefer a valid tool-call JSON object after leading prose or incidental JSON to reduce false misformat warnings.
2026-06-25 09:40:37 +02:00
Alessandro
53ad7ba2dc Persist loaded skills through compaction
Store explicitly loaded skill IDs as chat-wide context data while keeping full skill bodies in normal tool-result history. Reattach any loaded skill body that is no longer visible after compaction by reimporting the current skill from its source, without revision hashes or protocol reinjection.

Update compaction and summary prompts to preserve loaded skill names only, refresh DOX contracts, and add focused coverage for context-data persistence, legacy agent-data migration, duplicate suppression, and post-compaction reattachment.
2026-06-23 16:32:21 +02:00
Alessandro
51f3ed00a1 Add project extension data hooks
Introduce generic project edit-data extension hooks so plugins can contribute named project settings sections without coupling helpers.projects to plugin-specific storage.

Move _model_config project LLM payload handling behind those hooks and preserve inherited global model settings unless a project override already exists or is explicitly selected.

Cover the inheritance regression, existing scoped overrides, multiple plugin sections, core-field collision protection, and extension payload filtering in focused project/model-config tests.
2026-06-23 07:34:21 +02:00
Alessandro
6dcaab2f5c Fix MCP settings apply NameError
Use the active settings dictionary when scheduling MCP config updates so applying global MCP servers no longer references an undefined config variable.

Add a focused regression test covering the settings apply path and document the deferred MCP update contract in settings.py DOX.
2026-06-22 10:26:05 +02:00
Alessandro
78a50e1431 Fix parallel worker chat log orphans
Skip persisted tool-result files for BACKGROUND contexts, remove ephemeral direct parallel worker chat folders during cleanup, and ignore chat directories without chat.json during startup loading.

Add focused regressions for background output persistence, parallel worker cleanup, and orphan directory loading.
2026-06-19 08:11:38 +02:00
Alessandro
bf2741990a Revert loaded skill history persistence
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
Reverts db01d7c1c8 and 3c83b2eca2.

Restores the prior loaded-skills prompt-extras behavior and removes the compaction reattachment metadata path.
2026-06-18 16:45:56 +02:00
Alessandro
8fda0ee69c Fix MCP timeouts from hanging agent loop
Release MCP config locks before awaited initialization or tool calls, isolate MCP session operations in disposable DeferredTask workers, and bound session cleanup so wedged transports cannot freeze later agent work.

Add deterministic MCP regression coverage for lock scope, config update initialization, cleanup timeouts, and isolated operation timeouts. Update the helper DOX contract for the new concurrency and cleanup behavior.
2026-06-18 13:32:10 +02:00
Alessandro
7ac9910e1d Add skill scanner settings flow
Add a Settings > Skills scanner section and modal backed by Snyk Agent Scan-oriented checks and prompts. Wire uploaded skill zips from Import Skills into the scanner before import, and add a preparation API that extracts archives into temporary scan roots without installing or executing them.

Harden shared skill zip extraction against traversal, backslash paths, and symlink entries, and cover the new flow with focused scanner tests.
2026-06-18 12:52:41 +02:00
Alessandro
b9153f718e Preserve subordinate agent profiles
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
Validate call_subordinate profile arguments against available agent profiles so missing profiles fail as repairable errors. Persist each agent's profile in saved chats and avoid flattening existing subordinate profiles during profile switches, settings refresh, or restart reload.
2026-06-17 13:07:22 +02:00
Alessandro
a24d9a73a0 Fix project skills folder initialization
Create the .a0proj/skills directory during project metadata setup so Project Settings can open the skills folder for new projects. Repair the folder when loading existing project settings, and cover both creation and repair with regression tests.
2026-06-17 02:37:28 +02:00
Alessandro
1dc719ff9c Extend WebSocket heartbeat grace
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
Raises the Socket.IO heartbeat interval and timeout defaults so long context and prompt work do not trip python-engineio's empty packet queue timeout.

Adds positive-integer environment overrides and updates the runtime configuration regression test.
2026-06-16 16:29:00 +02:00
Alessandro
3c83b2eca2 Reattach loaded skills after compaction
When compression hides an explicitly loaded skill body, reattach the current missing revision as a normal skills_tool history result under one fixed budget. Preserve skill name and revision metadata in automatic and manual compaction summaries without copying full skill bodies.
2026-06-16 14:31:37 +02:00
Alessandro
4714b5dcb9 Block document query in parallel calls
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
Reject document_query during parallel tool-call normalization before worker jobs are started. Add prompt guidance so the model avoids batching document_query, and update DOX plus regressions for the new sequential-only contract.
2026-06-16 13:27:59 +02:00
Alessandro
f90bb63a9f Use prompt-declared Responses tool names
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
Prefer explicit tool_name examples and first prompt headings when deriving native Responses function tool names, falling back to the prompt filename only when no callable name is declared.

Add regression coverage for code_execution_tool, memory_load, call_subordinate, behaviour_adjustment, and filename-only fallback, and document the contract in responses_tools DOX.
2026-06-15 15:06:48 +02:00
Alessandro
9bcef39028 Add llama.cpp and vLLM local providers
Add llama.cpp / llama-server support:
- Register llama.cpp chat and embedding providers through hosted_vllm defaults on host.docker.internal:8080.
- Add onboarding metadata, a bundled icon, no-key provider metadata, model discovery coverage, setup docs, and tests.

Add vLLM support:
- Register vLLM chat and embedding providers through hosted_vllm defaults on host.docker.internal:8000.
- Add onboarding metadata, a bundled icon, no-key provider metadata, model discovery coverage, setup docs, and tests.
- Strip empty tools arrays from the Responses-to-chat fallback path so strict OpenAI-compatible servers accept local vLLM calls.
2026-06-15 05:37:28 +02:00
Alessandro
f68792496b Fix parallel await timeouts
Some checks failed
Build And Publish Docker Images / plan (push) Has been cancelled
Build And Publish Docker Images / build (push) Has been cancelled
Keep running parallel jobs alive when an await call reaches its timeout so agents can await the same job ids again instead of cancelling child work. Distinguish direct background tool workers from call_subordinate child chats so nested subordinate chats can use parallel normally while true worker recursion remains blocked. Update the parallel prompt, DOX notes, and regressions for non-destructive timeout and non-blocking collect semantics.
2026-06-13 18:36:41 +02:00
Alessandro
2b99ab53c6 Gate remote tool prompts by connector metadata
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
Hide A0 connector remote tool prompts unless a connected CLI advertises the matching capability. Remote file access enables text_editor_remote, F4-enabled remote execution enables code_execution_remote, and supported enabled Computer Use that is not in rearm-required state enables computer_use_remote.

Apply the same gate to Responses API function-tool generation, move the prompt hook to the active tool-prompt extension path, and update connector prompt wording, DOX, and regression coverage.

Verified with:
- conda run -n a0 pytest tests/test_a0_connector_prompt_gating.py tests/test_default_prompt_budget.py tests/test_responses_architecture.py -q
2026-06-13 02:00:32 +02:00
Alessandro
6eeddf2f04 Clarify parallel tool-call batching
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
- document that parallel accepts full reply-shaped tool call objects and ignores planning-only fields
- steer prompt guidance toward one mixed batch for ready independent calls instead of splitting by tool type
- add normalization and prompt regression coverage plus matching DOX notes
2026-06-12 18:32:34 +02:00
Alessandro
b704a0e3f5 Add inspectable parallel tool calls
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 a parallel wrapper and runtime for concurrent background tool calls
- run parallel call_subordinate jobs as child chats with visible subagent steps that match normal subordinate args
- render parallel child tool steps with normal tool-call args while keeping job handles in wrapper results and prompt extras
- group parallel child chats in the sidebar with persistent accordion and caret behavior
- add prompt, extension, DOX, and regression coverage
2026-06-12 15:23:14 +02:00
Alessandro
b8c390f50d Enable A2A streaming capability by default
Wrap FastA2A agent card generation so Agent Zero advertises streaming support on A2A endpoints by default.

Add focused regression coverage for the agent-card capability rewrite and proxy wiring, and update the helper DOX profile for the new wrapper.
2026-06-12 03:11:00 +02:00
Alessandro
df19e399e8 Handle wrapped Responses endpoint 404s
Teach the Responses fallback classifier to inspect status codes, wrapped exception types, and response bodies so LiteLLM NotFoundError wrappers that hide the /v1/responses URL still fall back to chat completions.

Keep rate-limit errors non-fallback and add a regression test for the OpenAIException detail-only 404 shape observed with providers that do not expose the Responses API.
2026-06-11 04:12:40 +02:00
Alessandro Frau
e7b64a39fd
Merge pull request #1676 from hash-anmol/telegram-native-integration-production
feat: major improvements to native Telegram integration UX and streaming
2026-06-11 04:11:12 +02:00
Alessandro
b04443be1a Add native Responses API transport
Route Agent Zero turns through a LiteLLM transport layer that prefers the Responses API while preserving chat-completions fallback for providers without compatible endpoints.

Persist Responses metadata in history and agent state so provider-state continuation, local replay, native function-call execution, and stored-response cleanup survive normal chat workflows.

Normalize prompt caching by provider: OpenAI and Azure use prompt_cache_key and prompt_cache_retention, while Anthropic, Gemini, Bedrock, OpenRouter, and compatible chat providers keep block-level cache_control breakpoints and cached tool definitions.
2026-06-11 03:37:04 +02:00
Alessandro
ab34084069 Polish MCP server management UI
Revamp the global and project MCP manager surfaces with list-first layout, clearer examples, a dedicated scanner modal, manager/raw toolbar parity, and local-command-first server creation.\n\nAdd server and tool search, plugin-style enable toggles, per-tool disabled_tools handling in the MCP backend, internal A0 MCP tool search, regression coverage, and updated DOX contracts.
2026-06-11 03:01:19 +02:00
Alessandro
521172b489 Revamp MCP server configuration
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 project-scoped MCP server configuration with global/project merge semantics, a richer settings UI, and chat composer access. Introduce MCP config scanning plus project-aware status/detail/log/apply APIs while preserving the raw JSON editor. Strengthen MCP runtime handling for dotted tool names, timeouts, status accuracy, and project-aware tool execution, with focused regression coverage.
2026-06-09 17:29:25 +02:00
frdel
c576f67469 Merge branch 'ready' of https://github.com/agent0ai/agent-zero into ready 2026-06-08 12:41:57 +02:00
frdel
e138e33ca9 Add file-level DOX docs & update AGENTS indexes
Add comprehensive file-level DOX documentation across the repo and update directory AGENTS.md indexes. Many new `*.py.dox.md` files were added under api, helpers, tools, plugins, extensions, webui, and other dirs to document endpoint purpose, ownership, runtime contracts, work guidance, and verification. Several AGENTS.md files were created or updated (agents profiles, api, docker, extensions, helpers, plugins, skills, webui components, etc.) to list child DOX files and clarify documentation/work guidance. Also add example and bundled profile DOX files (agent0, default, developer, hacker, researcher) and minor updates to helpers/dirty_json.py and its tests. These changes improve on-disk documentation coverage and establish the convention that each direct runtime file should have a matching `*.dox.md` describing its contracts and verification steps.
2026-06-08 12:41:53 +02:00
Anmol Malik
abf0cef8e8 Scope Telegram integration commands 2026-06-07 21:20:30 +05:30
Alessandro
f9d8167a00 Make file browser paths editable
Some checks failed
Build And Publish Docker Images / plan (push) Has been cancelled
Build And Publish Docker Images / build (push) Has been cancelled
Add direct directory navigation to the file browser path bar and preserve the current listing when typed paths fail.

Add a default-enabled setting to remember the last successful file browser directory, while keeping explicit open paths deterministic.
2026-06-04 17:29:53 +02:00
Alessandro
ca4efe6e6a Fix Tailscale Remote Control CSRF origins
Normalize active Remote Control URLs to same-origin values before adding them to CSRF allowlists, so Tailscale Funnel URLs with paths or trailing slashes can bootstrap tokens correctly.

Allow WebSocket origin validation to trust only the currently active Remote Control origin, including Docker split-process tunnel service URLs, while preserving rejection for unrelated external origins.

Add focused regression coverage for active Tailscale-style origins, tunnel-service origin lookup, and negative cross-origin cases; keep run_ui decorator re-exports compatible with existing CSRF tests.
2026-06-04 14:54:39 +02:00
neurocis
f8730c0608 feat(login): Enhance next URL validation to reject backslash open redirects
Co-authored-by: Agent Hero <agent.hero@neurocis.ai>
2026-06-02 21:55:37 -07:00
neurocis
6609632bf6 feat(login): Implement secure post-login redirection
Return users to their original requested page after login, with robust same-origin validation to prevent open redirects.

Co-Author Agent Hero <agent-hero@neurocis.ai>
2026-06-02 21:54:48 -07:00
frdel
08306be650 Include top-level AGENTS.md in project instructions
Add support for including a top-level AGENTS.md in a project's system instructions while keeping backwards-compatible defaults. Introduces include_agents_md project metadata (defaults to true), normalization and save logic, and helper functions to discover and format AGENTS.md and other instruction files into the system prompt. Updates build_system_prompt_vars to assemble instruction parts, adds UI checkbox in project edit form, normalizes defaults in the projects store, and adds tests for the new behavior. Also documents the compatibility rule in AGENTS.md and adds a small prompt rule reminder.
2026-06-02 14:50:29 +02:00
frdel
175baa49db Add AGENTS.md DOX files and migrate docs
Introduce DOX (AGENTS.md) contracts across the repository to formalize ownership and local work contracts: adds .github/AGENTS.md plus AGENTS.md files for agents, api, conf, docker, docs, extensions, helpers, knowledge, lib, plugins, prompts, scripts, skills, tests, tools, usr, webui (and several subfolders). Update root AGENTS.md (content and last-updated date) to include DOX framework guidance and a child DOX index. Update .gitignore to allow usr/ and usr/plugins AGENTS.md files. Remove legacy deep-dive files under docs/agents (banners, components, modals, plugins) and migrate frontend/plugin references to webui/ and plugins/ DOX locations. Also adjust plugins/README.md and several skills/*/SKILL.md files to align with the new DOX layout.
2026-06-01 13:55:07 +02:00
Alessandro
bb6004c77f Harden Tailscale Funnel remote control
Start Tailscale Remote Control through Funnel on HTTPS port 443, verify the prepared client supports the funnel command, and give the Funnel startup path a longer approval window.

Forward Tailscale approval/login URLs through the shared tunnel notification stream so the UI renders an actionable browser link like Microsoft Dev Tunnels, with clearer basic-user copy around approval and public Funnel URLs.

Keep ngrok removed from the Remote Control surface and extend regression coverage for Funnel command wiring, unsupported clients, and approval-link handling.
2026-06-01 02:11:58 +02:00
Alessandro
ce4156a110 Harden internal Xpra desktop control
Move the internal Linux Desktop skill toward a structured-first workflow: state/window commands before screenshots, batched desktopctl sequences in one process, and final screenshots only when pixels matter. Normalize internal system Desktop resize requests so narrow portrait canvas sizes do not shrink the real X11 root display and distort screenshots. Keep the live Docker runtime in sync with the changed Desktop files.
2026-05-30 22:22:15 +02:00
Alessandro
edd58a42d2 Fix durable screenshot artifacts and Xpra sizing
Materialize browser, desktop, computer-use, and vision-load screenshots into chat-scoped artifacts so historical image refs survive temporary screenshot pruning.

Keep history serialization free of rescue assumptions, document durable screenshot behavior in tool prompts/skills, and size Xpra canvases from backend-normalized display dimensions to prevent stretched desktop views.

Verified with focused pytest coverage plus live Docker checks for browser screenshot persistence and Xpra canvas dimensions.
2026-05-30 17:45:19 +02:00
Alessandro
6ccbae0712 feat(document_query): add liteparse runtime and progressive skill
Add LiteParse as the preferred parser path with legacy parser fallbacks, centralized document fetching, generic user-facing progress, and compatibility shims for the former helper/tool imports.

Install the runtime through Docker requirements for fresh images and through the _document_query plugin hook/startup migration for existing installations.

Move the long document_query tool instructions into a document-query skill and leave a compact tool prompt stub that directs the model to load the skill before using document_query for documents, code-file Q&A, and document-image OCR. Also add default Agent Zero guidance for document/code/OCR Q&A routing.

Tests:
- PYTHONPATH=/home/eclypso/a0/agent-zero-pr-1528 conda run -n a0 pytest tests/test_document_query_plugin.py -q
- python -m compileall -q plugins/_document_query helpers/document_query.py tools/document_query.py tests/test_document_query_plugin.py
- git diff --check
- Live Agent Zero Web UI E2E at localhost:32080: PDF Q&A, code-file Q&A through document_query skill, and W-4 document-image OCR

Broader legacy pytest probe remains blocked by unrelated browser-agent, docker workflow branch expectation, and webui fixture path failures in this older PR worktree.
2026-05-29 12:45:14 +02:00
Deimos Agent
5fd7a6a79e feat: extract document_query into _document_query plugin with parser strategy pattern
- Create plugins/_document_query/ with full plugin structure:
  plugin.yaml, default_config.yaml, tools/, helpers/, helpers/parsers/, prompts/, README.md
- Add BaseParser ABC with asyncio.to_thread offload and configurable timeouts
- Implement 5 parsers: PDF (PyMuPDF+Tesseract), HTML (Markdownify),
  Text (expanded mimetypes: YAML, XML, TOML, JS, TS, shell),
  Image (Unstructured), Unstructured (catch-all)
- Add MIME type registry with priority-based routing via get_parser_for_mimetype()
- Add gather_timeout on asyncio.gather for bounded concurrent fetches
- All config externalized to default_config.yaml
- Disable core files (._py.bak) replaced by plugin
- Update knowledge_tool._py import to plugin path
2026-05-29 12:45:05 +02:00
Alessandro
67224672e8 Add Remote Control tunnel providers
Rename the Remote Link UI and user-facing messages to Remote Control.

Refactor tunnel startup into provider helpers, remove ngrok support, and keep Cloudflare Tunnel, Microsoft Dev Tunnels, Serveo, and Tailscale wired through the Remote Control selector.

Add provider-time binary preparation, Tailscale userspace tailscaled startup, Tailscale login URL display, Microsoft Dev Tunnel progress feedback, and focused regression coverage for the Remote Control provider flows.
2026-05-28 22:33:29 +02:00
Anmol Malik
013a374daa Revert "Add Telegram speech mode"
This reverts commit c51c235faacbbed44994635d4743b97f7a143a17.
2026-05-29 00:10:04 +05:30
Anmol Malik
709b865399 Add Telegram speech mode 2026-05-29 00:10:04 +05:30
Anmol Malik
1ff45e71c2 Add Telegram session picker 2026-05-29 00:10:04 +05:30
Anmol Malik
1bbbfa44ac Improve Telegram integration command and streaming UX 2026-05-29 00:10:04 +05:30