Commit graph

213 commits

Author SHA1 Message Date
Alessandro
5ff106a2d4 Raise unusable response limit to five
Some checks failed
Build And Publish Docker Images / plan (push) Has been cancelled
Build And Publish Docker Images / build (push) Has been cancelled
Set the default consecutive unusable response threshold to five and align the Agent Settings copy, helper DOX, and regression assertion.
2026-08-01 16:52:48 +02:00
Alessandro
2925baca8a Add file browser drag and drop
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
Move files and folders into directories or the parent path from the shared Files surface, with guarded multi-item backend moves and clear drop feedback.

Keep drag gestures independent from row selection, preserve unrelated selections after moves, and add focused regression coverage.
2026-08-01 12:50:31 +02:00
Alessandro
ff596e2a84 Require native Responses tool calls
Default Responses turns with Agent Zero function tools to a required, single native call while preserving explicit caller overrides.

Keep parallel work inside Agent Zero's parallel tool so complete tool roots reach the parser deterministically.
2026-07-31 16:35:53 +02:00
Alessandro
1d88a82b55 Fix native Responses tool metadata
Expose grouped memory tools and conditional vision support while applying prompt render variables before deriving native metadata.

Stop guessing complex schemas from prose and keep native descriptions to compact discovery text, reducing the duplicated Responses tool payload.
2026-07-31 16:35:53 +02:00
frdel
bebe6826cf Improve WebUI bundling, manifest and stop command
Some checks failed
Build And Publish Docker Images / plan (push) Has been cancelled
Build And Publish Docker Images / build (push) Has been cancelled
Introduce a WebUI extension manifest and rewrite the asset bundler/server to support caller-supplied entry sets, extension-injected entries, and negotiated gzip. Key changes: add get_webui_extension_manifest() to helpers/extension, refactor Stop logic into stop_context() and reuse it from the connector `/stop` command, and add a new `/rename` slash command for chat naming. ui_bundler now accepts entry_urls, includes enabled extension entry files, raises the embedded text file size limit to 512 KiB, computes per-entry-set cache keys, and returns a bundle version based on the bundle signature. ui_server applies Starlette GZip middleware, adds routes (/, /index.html, /ui/index, /safe), serves splash/safe documents, injects the serialized webui_extension_manifest into the rendered index, and streamlines the /ui/asset-bundle endpoint with ETag and gzip handling. Also add multiple WebUI assets and fonts, new/updated plugin command YAML and Python command handlers, and corresponding tests covering bundling, commands, chat naming, and WebUI behaviors. Documentation (.dox.md) updated to reflect the new runtime contracts and guidance.
2026-07-29 19:49:07 +02:00
Alessandro
4b0feac1f4 Fix malformed native Responses tool output
Keep Agent Zero wrapper examples out of native function descriptions and expose the response text schema.\n\nRoute concatenated tool envelopes through repair before the plain response hook can render them as final text.
2026-07-28 16:46:38 +02:00
Alessandro
63a52b3a4a Expose slash commands through skills
Delegate scoped command discovery to the Commands plugin and let skills_tool list or read effective slash-command definitions without invoking them.
2026-07-28 16:46:38 +02:00
frdel
0329003b65 Add UI asset bundler, service worker, tests
Introduce a UI asset bundler and delivery flow: adds helpers/ui_bundler.py to discover same-origin HTML/CSS/JS (<=40KiB), build a versioned JSON bundle, and serialize it for an authenticated /ui/asset-bundle endpoint (handlers added in helpers/ui_server.py with gzip and ETag support). Add webui/sw.js service-worker to accept a preload bundle, populate a per-version cache, serve bundled text entries immediately, and perform runtime caching/cleanup for eligible assets. Update webui/index.html to fetch the bundle asynchronously, send it to the worker, register the worker by bundle version, inline a non-blocking startup splash, and convert stylesheets to non-blocking preload loads. Expose extension readiness from webui/js/extensions.js (webui-extensions-loaded) so startup waits for Alpine and HTML extension loading. Add tests covering bundler behavior, service-worker expectations, and startup ordering.
2026-07-28 16:10:48 +02:00
frdel
2ec52e1968 Add /stop API and stop-button UI/behavior
Introduce a /stop API handler (api/stop.py) and its DOX to cancel an AgentContext run without deleting the context; it clears pause state, progress and logs an info step. Add tests for stopping behavior, chat working animation, and sidebar timestamp/spacing (tests/*). Update helpers/git._format_git_timestamp to emit UTC timestamps without a timezone suffix and add a test for it. Implement stop-related UI/UX: input-store.js gains a stop state, activateSendButton(), and stopAgent() to call /stop; chat-bar-input.html updates the send button markup, aria-label and stop styles. Update sidebar/chat list CSS to add the working-bubble animation, adjust chat row layout and action-button visibility, and left-sidebar/bottom styling (nowrap timestamp). Modify messages.js to hide kvps.finished from display and complete the active process group when finished. Minor welcome-composer and documentation updates to reflect these behaviors.
2026-07-28 09:26:06 +02:00
Alessandro
a76b0b5b7d Block final responses from parallel calls
Some checks failed
Build And Publish Docker Images / plan (push) Has been cancelled
Build And Publish Docker Images / build (push) Has been cancelled
Keep response tool calls at the top level so they can end the parent message loop instead of forcing an unnecessary follow-up turn.\n\nDocument the parallel constraint and cover both runtime rejection and prompt guidance.
2026-07-26 00:58:19 +02:00
Alessandro
9f1e24a2db fix(prompts): strip JSON fences at render time
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
Keep fenced examples readable in prompt Markdown while removing only JSON fence markers from the final assembled system prompt. Cover all bundled profiles and preserve non-JSON fences.
2026-07-25 16:01:52 +02:00
Alessandro
6b7302f664 fix(tools): harden malformed text tool handling
Require complete standalone text requests for execution while accepting supported text-tool formats. Route fenced and structurally broken tool intent through the existing misformat repair path so streamed chats do not remain in a thinking state.
2026-07-23 11:34:38 +02:00
Alessandro
21c62f6716 fix: release deferred task resources
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
Clear DeferredTask callables and arguments after completion or cancellation while running each invocation from a safe private snapshot. Preserve result retrieval and active restart behavior, clean up child tasks, and add best-effort local and SSH session destructors with focused lifecycle regression coverage.
2026-07-20 21:15:35 +02:00
Alessandro
fd795bda82 Limit runtime secret redaction to credentials
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
Filter usr/.env masking to API keys and login/password credentials so ordinary settings cannot corrupt chat text. Keep global and project secrets protected, and cover full-response, prompt, and streaming behavior with a regression test.
2026-07-19 13:22:57 +02:00
Alessandro
55456df294 Mask runtime .env values in agent output
Include usr/.env in the agent-facing SecretsManager sources so runtime credentials are masked in tool results, history, logs, and streamed output. Keep the writable default secrets manager scoped to usr/secrets.env.

Add regression coverage for dotenv masking and document the source contract.
2026-07-17 16:23:46 +02:00
Alessandro
9b829a0425 Unify skills CLI with runtime helpers
Delegate skill discovery, parsing, lookup, search, and validation to helpers.skills so CLI behavior cannot drift from the runtime contract.

Generate canonical triggers metadata and cover valid and incomplete skill validation.
2026-07-17 15:20:33 +02:00
frdel
15a2b553be Unify global model presets
Make model presets a single global collection and treat presets as reusable setups (main, utility, embedding). Persisted scope configs now store only a preset name (Default is always present and immutable); project-scoped preset definitions were removed and attempts to edit/reset project presets are rejected. Add embedding-model support throughout: include embedding slot in presets, surface embedding in the switcher and override APIs, and notify extensions when the effective embedding model changes. Implement rename/retire propagation to update plugin configs, saved chats, and live AgentContext objects when preset names change or presets are removed. Update CLI/integration commands to use an "inherit" action for returning to the scoped preset and to report the effective scoped-or-chat preset. Add startup migration/bootstrap to initialize presets from remote or bundled fallback and numerous docs/UI text updates to reflect the new preset model. Extra: refactor config resolution helpers and add safety checks (validation, atomic writes) when saving presets.
2026-07-17 12:16:10 +02:00
Alessandro
8e5d643483 Remove legacy filesystem logs
Stop PrintStyle from creating per-process HTML files under /a0/logs and remove the obsolete tracked folder scaffolding.

Delete existing legacy log directories during startup migration so self-updated and manually upgraded installations are cleaned automatically. Point plugin debugging guidance to Docker output and add regression coverage for repeatable cleanup.
2026-07-16 15:30:37 +02:00
Alessandro
6a7178af91 Fix MCP lookup for Responses tool aliases
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
Resolve provider-safe Responses tool names back to their canonical MCP names inside the MCP handler before dispatch. Preserve canonical lookups and reject stale or unrelated aliases so local tool resolution can continue.

Add regression coverage for Google Workspace-style names and document the lookup contract.
2026-07-16 02:29:39 +02:00
Alessandro
7b216c6343 Prevent Responses metadata history bloat
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
Persist only durable Responses continuation metadata instead of repeated prompts and raw model payloads.

Normalize legacy AI message metadata during load while preserving structured output, unrelated metadata, and tool-result inputs.
2026-07-14 20:41:22 +02:00
Alessandro
4b5077c493 Fix plugin reload toast behavior
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
Persist the frontend-extension notification as read before reloading so it does not reappear after refresh. Align plugin and updater toast actions with the shared small spacing token.
2026-07-12 17:26:35 +02:00
Alessandro
a55a76f62b Keep action-required notifications visible
Make plugin frontend-reload and Agent Zero update notifications persistent until the user dismisses or acts on them. Reuse the existing zero-duration toast contract without changing ordinary notification timeouts.\n\nDocument the behavior and extend the persistent-toast regression coverage.
2026-07-12 16:55:17 +02:00
Alessandro
5c1d50f928 Fix notifications skipped during state snapshots
Capture each notification payload together with its GUID and update cursor under the notification manager lock. This prevents concurrent notify_user events from advancing the WebUI cursor without delivering the corresponding toast.\n\nAdd regression coverage for notification cursor continuity and update the helper contracts.
2026-07-12 12:46:12 +02:00
Alessandro
3ac63c6166 Add responsive interface control visibility
Add an Interface settings section with independent mobile and desktop toggles for the project selector, clock, connection status, and right canvas rail.

Persist the visibility map in instance settings, apply it at the shared WebUI surfaces, preserve existing defaults, and cover the contract with focused regression tests and DOX updates.
2026-07-10 19:38:19 +02:00
Alessandro
d33cac3bf3 Stop runaway unusable response loops
Add a configurable circuit breaker for consecutive malformed or repeated model outputs. Expose the limit in Agent Settings and render the stop notice from a framework prompt.
2026-07-10 16:36:30 +02:00
Alessandro
811556d24e Make chat persistence crash-safe
Write serialized chats to a same-directory temporary file, fsync it, and atomically replace chat.json so interrupted saves preserve the previous chat data.

Add regression coverage for interrupted replacement and document the persistence guarantee.
2026-07-10 13:08:09 +02:00
Alessandro
fa05710da7 Reuse native parallel child logs
Pass each parent-visible child log into direct parallel worker execution so tool before_execution reuses it instead of creating a second generic tool log.

This keeps native badge types such as wait/progress (HDL) intact through execution, updates the parallel helper DOX contract, and adds a regression test for log reuse.
2026-07-09 17:42:41 +02:00
Alessandro
8d79f556c6 Fix parallel child log typing
Resolve tool-specific log objects for all parallel child jobs, removing the code_execution_tool-only special case and using native get_log_object() when available, with generic fallback.

Update parallel_tools docs to reflect the shared logging contract and add coverage for wait/ fallback behavior in parallel-tool tests.
2026-07-09 17:34:48 +02:00
Alessandro
3d87998821 Exclude Time Travel history from backups
Skip usr/.time_travel during self-update user-data backups and add the same Time Travel shadow-history exclusion to default BackupService metadata.\n\nAdd focused regressions proving regular user files stay in backup coverage while Time Travel shadow repositories are omitted.
2026-07-09 13:27:03 +02:00
Alessandro
bcf2634000 Add AGENTS.md protocol guidance
Load active-project AGENTS.md path-chain guidance into the protocol area without duplicating the project root instructions.

Move the AGENTS.md protocol wording into a prompt template, reuse existing file/path helpers, and cover direct-path discovery plus prompt assembly with focused tests.
2026-07-08 14:29:15 +02:00
Alessandro
0de0fcec0e Simplify relevant skill recall
Search the raw user message when recalling relevant skills instead of the rendered history wrapper.

Replace the stopword catalog with structural matching: names use normal terms, tags/triggers use long terms or phrase matches, and descriptions require phrase matches.
2026-07-08 12:32:19 +02:00
Alessandro
dea64ddad0 Load skills into chat history
Switch the Skills catalog UI/API from scope-wide prompt pins to current-chat history loading, and remove user-facing removal of loaded skills.

Disable legacy active-skill prompt injection so forgotten scope config no longer inflates new-chat prompts.
2026-07-08 01:52:22 +02:00
Alessandro
ad148f24cc Fix Responses state after history compaction
Clear the active Responses provider continuation when automatic history compression or manual chat compaction rewrites local history, while preserving stored response IDs for cleanup.

Add focused regressions for both compression paths so compacted chats do not keep stale provider-side context.
2026-07-07 16:59:49 +02:00
Alessandro
9bb3cb9469 Render parallel code execution as EXE
Use the code_exe log type for code_execution_tool children launched through parallel so the WebUI reuses the existing code execution renderer.

Add a focused regression test and document the parallel child-log contract.
2026-07-07 13:56:38 +02:00
Alessandro
6998789ed3 Normalize MCP stdio command lines
Accept shell-style local MCP command values from the manager before spawning stdio clients, so configs like uvx workspace-mcp resolve to the correct executable and args.

Split collapsed option/value argument lines in the MCP manager, document the input contract, and add a regression for the google_workspace MCP shape.
2026-07-05 20:11:19 +02:00
Alessandro
038f88848d Fallback when Responses mock parses SSE
Detect LiteLLM JSONDecodeError failures caused by the Responses mock streaming iterator trying to parse a real SSE stream.

Fall back to Chat Completions before any output is emitted, keeping custom OpenAI-compatible proxy prefixes provider-neutral.

Add a regression test for SSE-shaped JSON decode failures and update the transport DOX contract.

Verified with: PYTHONPATH="/home/eclypso/a0/agent-zero" conda run -n a0 pytest tests/test_stream_tool_early_stop.py tests/test_responses_architecture.py -q; PYTHONPATH="/home/eclypso/a0/agent-zero" conda run -n a0 python -m py_compile helpers/litellm_transport.py; docker exec -i -w /a0 9c436228a4a2 /opt/venv-a0/bin/python -m py_compile helpers/litellm_transport.py; git diff --check.
2026-07-02 17:29:40 +02:00
Alessandro
0f7429daef Fix streamed parallel tool extraction
Only treat top-level JSON objects as tool roots during streaming, so a complete nested tool_calls item cannot end the stream before the parallel wrapper closes.

Add regression coverage for partial parallel wrapper snapshots.
2026-07-02 17:29:40 +02:00
Alessandro
6ab402172f Prune deleted saved chats from sidebar state
Mark chats after successful persistence and reconcile saved chat IDs while building WebUI state snapshots so stale in-memory contexts disappear after their chat files are removed.

Keep fresh unsaved chats visible, skip running contexts, and cover the regression with snapshot and persistence tests.
2026-07-02 17:29:40 +02:00
Alessandro
738949031b Stabilize LiteLLM provider fallback
Fall back to Chat Completions for provider/proxy Responses endpoint failures before any output is emitted.

Preserve streamed Chat Completions tool-call deltas as structured LLMResult function-call items, so fallback providers can still drive tools.

Document Docker host-gateway addressing for local model servers, where container localhost does not reach host loopback.

Verified with: PYTHONPATH="/home/eclypso/a0/agent-zero" conda run -n a0 pytest tests/test_stream_tool_early_stop.py tests/test_responses_architecture.py -q; PYTHONPATH="/home/eclypso/a0/agent-zero" conda run -n a0 python -m py_compile helpers/litellm_transport.py helpers/llm_result.py; git diff --check.
2026-07-02 17:29:40 +02:00
Alessandro
272a0d8dfa Normalize Responses tool schemas
Ensure function parameter schemas include an explicit properties object before Responses requests are dispatched through LiteLLM.

Keep prompt/MCP permissive schemas compatible with stricter OpenAI-compatible chat validators and cover chat, legacy function, and native Responses tool inputs with regressions.
2026-06-26 14:48:41 +02:00
Alessandro
7160747607 Remove backup file count cap
Let backup creation and restore cleanup use unlimited pattern scans so archives for agents with more than 50,000 files are complete. Keep UI preview and dry-run paths bounded for responsiveness while making the dry-run truncated flag safe for optional limits.

Add regression coverage for unlimited scans, backup creation, clean-before-restore, and restoring an archive entry past the old 50,000-file boundary.
2026-06-26 14:03:51 +02:00
Alessandro
b11818bfff Accept JSON-string parallel tool calls
Restore parallel normalization tolerance for provider/model outputs that stringify the tool_calls array inside tool_args.

The wrapper still expects normal tool-call objects after decoding, so nested parallel and document_query guards continue to run through the same validation path.
2026-06-26 13:47:35 +02:00
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