Skip to content

v0.8.0

Latest

Choose a tag to compare

@rwachters rwachters released this 14 Jul 09:37
Immutable release. Only release title and notes can be modified.
57c1bf4

📦 Release v0.8.0

📝 Executive Summary

This release introduces a new built-in worker tools system that lets workers execute filesystem, command, and web operations directly within a sandboxed workspace, replacing the previous generic tool execution paths. It adds full server, worker, and client support for managing, authorizing, and approving these tools, alongside several chat and settings stability improvements.

🚀 What's New

Worker

  • Built-in Worker Tools: Added a worker-side built-in tool framework with a shared catalog and JSON schemas, covering file operations (read_text_file, write_file, edit_file, move_file, list_directory, create_directory, search_files, search_text), sandboxed command execution (run_command), and web access (fetch_web_content, download_file).
  • Workspace Isolation & Safety: Introduced workspace path validation and stable execution error codes to block filesystem escapes outside the configured workspace, plus public-URL validation and DNS abstraction for web tools.
  • Signed Authorization Flow: Added a signed authorization payload and worker-side validator so built-in tool executions are authorized via the existing verification service before running.
  • Tool Name Prefixing: Added an optional toolNamePrefix to worker configuration so built-in tool names can be namespaced per worker.
  • Docker & Config Support: Forwarded startup arguments through the worker Docker entrypoint and added workspace, tool-timeout, and trusted-signer settings to worker config, env mappings, and sample files.

Server

  • Built-in Tool Persistence: Added a BuiltInToolDefinition DAO, Exposed table, entity mappers, and a Flyway migration (V14) to persist built-in worker tool definitions and worker tool-name prefixes.
  • Dispatch & Execution: Added a BuiltInToolDispatchService (server→worker) and a BuiltInWorkerToolExecutor that routes built-in tool calls to their owning worker with typed events/errors and timeout/validation semantics.
  • Definition Service & Seeding: Added a BuiltInToolDefinitionService (list/update with worker-ownership checks) and a seeder that atomically creates and renames built-in tools, preserving canonical names and optional public prefixes.
  • Orchestration & Routes: Routed built-in worker tool calls through the dedicated executor with signed approval handling, removed legacy auto-approval paths, and exposed type-safe API resources and Ktor routes for listing, updating, and resetting worker tools.
  • Reset-to-Defaults Flow: Added server-side reconciliation that restores catalog defaults while preserving enabled state and approval preferences.

App (Client)

  • Built-in Tools Management UI: Added a new Settings tab for managing worker built-in tools, including worker selection, enable/disable toggles, approval preferences, an edit dialog for schema/description, a reset-to-defaults confirmation, and empty/loading/error states with dangerous-tool highlighting.
  • API & Repository Layer: Added a BuiltInToolApi (Ktor client) and BuiltInToolRepository with reactive StateFlow caching, plus a BuiltInToolsViewModel for worker selection, tool loading, edits, and toggles.
  • Signed Approvals in Chat: Added on-device request signing for built-in tool approvals, routing auto-approval and denial through the signed authorization path with safeguards for missing sessions or signing failures.
  • Worker Tool Name Prefix: Added a tool-name-prefix field to the worker form and wired it through the workers tab, repository, and update handlers.

🐛 Bug Fixes & Improvements

  • Chat Sending State: Centralized isSending updates into the ChatViewModel job lifecycle, removing duplicate toggles from SendMessageUseCase so the sending state reliably resets on completion or cancellation.
  • Chat ViewModel Persistence: Moved chat session-to-slot allocation into a Koin-managed ChatViewModelSlotManager, keeping view-model keys stable across navigation and preserving in-flight streams.
  • Search Files Glob Semantics: Matched search patterns against paths relative to the starting directory, allowed excludePatterns as a string or array, and normalized relative paths to forward slashes for consistent cross-platform behavior.
  • Directory Listing Order: Sorted directory listings with folders always before files, keeping size/name as a secondary sort key.
  • Read Text File Ranges: Replaced head/tail with a Python-style range argument (negative indices, open-ended bounds, clamping) and prefixed output with a header showing the source path and 1-based line range.
  • Tool Approval Preferences Loading: Added user tool approval preferences to the session loading flow so approval state is available when a session opens, and surfaced repository errors when those preferences fail to load.

🏗️ Technical Updates

  • Legacy Tool Paths Removed: Dropped the old generic tool request/model, related CRUD endpoints, and the legacy web-search/weather tool executors and stubs; switched DAO/service mappings to a flat entity with joined polymorphic tool lookup and deprecated MiscToolDefinition.
  • Shared Catalog-Driven Tests: Added a BuiltInToolCatalog.size helper and replaced hardcoded tool-count assertions with catalog-driven checks across seeder and worker-prefix tests.
  • Documentation: Added built-in worker tools concept notes and a Trusted Signers guide covering CLI, Docker, and env-var setup for authorizing client tool execution; updated root and deployment READMEs.
  • Versioning: Bumped the project from 0.8.0-SNAPSHOT to the 0.8.0 release version.

📚 Appendix: Built-in Worker Tools Reference

The following built-in tools are seeded by the server into each worker's catalog and executed inside the worker's configured workspace. All paths are relative to that workspace root, and filesystem operations are confined to it. Web tools reject localhost, loopback, link-local, and private-network addresses.

File Operations

  • read_text_file — Read a UTF-8 text file. Parameters: path (required), range (optional [start, end) line range with Python slice semantics: negative indices count from the end, null for open-ended bounds). Output is prefixed with a header showing the source path and 1-based line range.
  • write_file — Create or overwrite a UTF-8 text file. Parameters: path (required), content (required).
  • edit_file — Apply structured edits to a text file. Parameters: path (required), edits (list of oldText/newText pairs, required), dryRun (optional preview without applying).
  • create_directory — Create a directory and any missing parents. Idempotent. Parameter: path (required).
  • list_directory — List directory contents with [FILE]/[DIR] prefixes. Parameters: path (defaults to workspace root), sortBy (name or size), includeSizes, recursive. Folders are always listed before files.
  • move_file — Move or rename a file/directory; fails if the destination already exists. Parameters: source (required), destination (required).
  • search_files — Find files/directories by glob pattern. Parameters: path (starting directory, defaults to root), pattern (required; ** for recursive, bare *.kt matches only the starting directory), excludePatterns (string or array). Patterns match paths relative to the starting directory; returned paths use forward slashes.

Search

  • search_text — Search UTF-8 text files for plain text or regex, returning matching paths and line numbers. Parameters: path (file or directory, defaults to root), query (required), mode (plain/regex), caseSensitive, wholeWord (plain mode only), filePattern (glob include filter), excludePatterns (string or array), contextBefore/contextAfter (context lines), maxResults (cap on matched lines). Skips binary files and truncates grouped output.

Command Execution

  • run_command — Run a process inside the workspace with a timeout. Parameters: command (required, must be on PATH or absolute), args (list), timeout (seconds; defaults to the worker's builtInTools.defaultCommandTimeoutSeconds).

Web Access

  • fetch_web_content — Fetch textual content from a public internet URL. Parameters: url (required), timeoutSeconds, maxBytes, followRedirects (default true), returnMode (auto/text/html).
  • download_file — Download content (including binary) from a public URL to a workspace file. Parameters: url (required), path (required), overwrite (default false), timeoutSeconds, maxBytes, followRedirects (default true).

Tool metadata (names, descriptions, and JSON Schemas) is defined once in BuiltInToolCatalog and shared between the server (for seeding/LLM discovery) and the worker (for execution), keeping advertised schemas in sync. Public tool names may be namespaced per worker via the optional toolNamePrefix.