Commit graph

231 commits

Author SHA1 Message Date
Alessandro
517a3cd90b Fix assistant-first provider history
Omit orphaned leading assistant messages from model history so Claude-compatible providers receive a user-first conversation.

Add regression coverage for the initial UI greeting path.
2026-08-12 14:34:16 +02:00
gdeyoung
cb9c877538 fix(transport): fall back on untyped Responses items
Treat opaque 400 type-discrimination errors from OpenAI-compatible Responses endpoints as shape-specific request rejections and retry through Chat Completions. Add focused regression coverage.
2026-08-12 14:34:16 +02:00
spinnakergit
d1e1c6494e fix(plugin-hub): preserve dirty edits during updates
Temporarily stash tracked plugin edits while updating. Restore the original checkout and edits if the update cannot reapply them, and surface the conflict beside the Update button. Add isolated Git regression coverage for merge, no-op, and conflict cases.
2026-08-12 14:34:16 +02:00
Alessandro
1121758a6f feat: add caller context to plugin config hooks 2026-08-12 14:34:16 +02:00
linkliti
6257f2cb3b Fix DeprecationWarning 2026-08-12 14:34:16 +02:00
Alessandro
1b4505d8e5 Guard chat deletion against empty context IDs
Reject empty and whitespace-only chat context identifiers before provider or filesystem cleanup begins. This prevents malformed deletion requests from resolving to the shared chat directory and adds focused regression coverage.
2026-08-12 14:34:16 +02:00
Alessandro
db4913ff76 Avoid rewriting unrelated chats on project changes
Project updates and deletion previously persisted every loaded chat, while matching chats were written twice through the existing activation helpers.

Keep the established project lifecycle flow and remove the unconditional writes so only affected chats are saved once. Add focused regression coverage and document the persistence contract.
2026-08-12 14:34:15 +02:00
Alessandro
4f8ae9cc2c Keep hidden utility profile out of new chats
Normalize legacy global settings that still select the internal default profile to Agent 0. This keeps fresh chats aligned with the visible profile catalog while preserving existing chat selections.
2026-08-12 14:34:15 +02:00
Alessandro
864e311c60 Keep slash commands out of agent skills
Return skills only from skills_tool and remove the command-definition loading bridge. Leave slash-command discovery, invocation, and authoring with the Commands plugin and its user-facing surfaces.
2026-08-12 14:34:15 +02:00
Alessandro
dbe87ee184 Keep capability discovery aligned with runtime
Humanize MCP catalog labels with their server names while preserving canonical IDs. Suppress skill discovery prompts when skills_tool is unavailable and move the behaviour_adjustment prompt under the Memory plugin so disabling its implementation also removes its instructions.
2026-08-12 14:34:15 +02:00
Alessandro
13ecab24ee Unify Agent Editor capability and prompt controls
Give Tools, MCPs, and Skills explicit default switches with segmented per-item policy controls while preserving sparse overrides. Simplify Advanced prompt editing around the full-height ACE surface and align the editor contracts and regression coverage.
2026-08-12 14:34:15 +02:00
Alessandro
9dab4f2460 Hide the utility agent from profile selectors
Centralize omission of the internal default profile in the shared presentation catalog and keep status reporting intact for existing chats. Align Settings, model-switcher, Connector, Telegram, and selector contracts with focused regressions.
2026-08-12 14:34:15 +02:00
Alessandro
afff2e3c05 Harden scoped tool policy enforcement
Resolve effective policy through inherited layers without letting empty upper configs shadow restrictions, and carry canonical tool identities through local and MCP execution.

Enforce required policy hooks and parent delegation checks at runtime, keep installed connector capabilities configurable while disconnected, and remove complete blocked-tool examples from rendered prompts.

Use the canonical tool prompts for concise catalog descriptions and add regressions for plugin activation, dotted local names, MCP calls, layered policies, and parallel subordinate paths.
2026-08-12 14:34:15 +02:00
Alessandro
7545eef298 Harden scoped agent profile mutations
Validate destructive requests and project-derived scopes at the Agent Editor API boundary, and reuse the running-profile guard for deletion.

Recheck creation and availability invariants inside the existing mutation boundary, preserve project availability atomically through its dedicated owner, and keep Project Edit and Settings catalogs from replaying stale or unavailable profile state.

Add focused regressions for confirmation, collisions, malformed project metadata, avatar failures, running profiles, and sparse project updates.
2026-08-12 14:34:15 +02:00
Alessandro
9e5fd188e2 Finish scoped Agent Editor profile workflows
Add per-scope availability, duplication, active-profile status, and inline project selection while keeping the profile switcher synchronized with runtime state.

Reconcile unavailable profiles at explicit disable, deletion, project-transition, and context-creation boundaries; polish validation, prompt layout, deletion, and completion states; and extend focused backend and WebUI coverage.
2026-08-12 14:34:15 +02:00
Alessandro
c2ee867665 Add profile skill visibility policies
Extend _skills with sparse allow/block rules and an explicit default for future skills, using the existing layered plugin configuration and skill-entry normalization.

Enforce the policy across discovery, loading, and chat activation while preserving loaded history, legacy hidden-skill behavior, and canonical name/path identity.
2026-08-12 14:34:15 +02:00
Alessandro
eec18ad839 Enforce scoped tool access policies
Add one project/profile-aware resolver for canonical local, plugin, and MCP tool identities.

Apply it to text prompts, Responses schemas, connector stubs, local execution, MCP invocation, and delegated agents while preserving the response and vision invariants owned by the runtime.
2026-08-12 14:34:15 +02:00
Alessandro
641df22868 Make agent profile overrides presence-aware
Merge layered profile metadata by authored field presence so missing keys inherit while explicit empty values clear inherited values.

Move the default specifics prompt to the canonical prompts directory and cover sparse metadata and prompt-only overrides.
2026-08-12 14:34:15 +02:00
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