• v0.11.0 df850dbcf3

    v0.11.0 Stable

    rwachters released this 2026-10-14 05:51:01 +00:00 | 43 commits to master since this release

    📦 Release v0.11.0

    📝 Executive Summary

    Torvian 0.11.0 is a large platform release that introduces automated and manual conversation compaction, user-owned projects with scoped agent roles, reusable model presets, and a shareable instruction library. It also rounds out the chat experience with assistant reasoning, token usage, reported cost, response timing, thread statistics, turn notifications, and a raw LLM request viewer. The server, common contracts, worker and all clients gained substantial new capabilities alongside a broad round of architectural refactoring and dependency-migration work.

    🚀 What's New

    Server (chat runtime & persistence)

    • Automated conversation compaction: Added a token preflight before every primary LLM call with a rolling-window policy, verified chunk persistence (migration V26), a CompactionCompleted turn event, and configuration validation with structural/write-time checks. Failures now abort the turn before an oversized, uncompacted request is ever sent.
    • Manual (on-demand) compaction: Added a one-shot forced compaction of the displayed thread served over a dedicated per-session websocket, including skip reasons and a terminal stream-completed marker, plus abort-on-client-close handling.
    • Per-preset compaction configuration: Model presets can restrain compaction and override the token threshold while the auxiliary summarizer stays a user preference (migration V35; field renamed to automaticCompactionEnabled in V36).
    • Assistant message completion: Persisted completion state, incomplete cause and error code (migration V31); every turn ending without a terminal provider chunk persists its terminal state exactly once. Provider-declared failures and truncations are classified into bounded, server-authored reasons (PROVIDER_OUTPUT_LIMIT_EXCEEDED).
    • Turn limits: Added tool-call iteration bound, per-step batch cap and per-call argument cap.
    • Reasoning streaming: Forwards plaintext reasoning deltas to clients, persists derived reasoning items on normal and abnormal endings, and enforces a fatal reasoning cap.
    • Usage stats & cost: Captures provider-reported token counters (migration V33) and the provider-reported cost, keeping omitted values null rather than zero.
    • Response duration: Measures the provider call from dispatch to its terminal signal (migration V34) and copies it on session clone.
    • Thread statistics: New GET /api/v1/sessions/{sessionId}/stats computing branch-scoped message, token, timing and rate statistics in one transaction.
    • Raw LLM request capture: Added a masked, replayable prepared-request payload surfaced on both chat event surfaces.
    • Per-user disabled agent roles: Users can disable a role for themselves without affecting other users (migration V27), enforced on attach (409) and at turn time.
    • Admin user provisioning & registration control: Added a MANAGE_USERS-gated POST /api/v1/users endpoint with optional forced password change, and a fail-closed selfRegistrationEnabled policy that gates POST /api/v1/auth/register with 403 FEATURE_DISABLED.
    • Session tool overrides removed: Session-specific tool configuration APIs, DAOs and caches were removed (migration V30); effective session tools now come from agent-role assignments.

    Common (shared models & contracts)

    • Projects & clone contracts: ProjectDto, CRUD request models, ProjectResource, the per-session project-selection sub-resource, and ProjectResource.ById.Clone with CloneProjectRequest.
    • Model presets: ModelPresetDto, resource and create/update requests, plus compaction configuration fields.
    • Shareable instructions: AgentInstructionDto, instruction resources/requests and InstructionSlot, replacing per-role inline instructions.
    • Compaction vocabulary: ConversationCompactionPreference, CompactionCompletedPayload, and the CompactionEvent (completed/skipped/error) hierarchy with skip reasons.
    • Assistant message enrichment: Completion fields (isComplete, incompleteCause, errorCode, errorMessage), reasoning delta stream event, UsageStats with nullable cost, and a nullable responseDurationMs.
    • Thread stats & raw request: ThreadStats/DurationStats DTOs and the RawLlmRequest payload/events.
    • Built-in tool catalog: Extended with project, model-preset, instruction, get_current_session_info, delete_agent_role, clone_project and send_message specs, then reorganized into per-family files under models/tool/specs.
    • Shared utilities: A single resolveThreadBranch helper (with ThreadBranchError) now backs the app, server context builder and stats calculator.

    App (client)

    • Conversation Compaction settings tab: Model/settings selector, instruction editor, threshold editor, enabled flag and client-side validation; a snackbar notice on compaction events (transcript deliberately untouched).
    • Manual compaction action: A top-bar "Compact conversation" action with a dedicated COMPACTING turn state that reuses the composer's stop button as the abort control, blocking thread-affecting actions while active.
    • Projects: A Settings ▸ Projects tab (list, detail, create/edit/delete) and a chat top-bar project selector that scopes the role dropdown and switches sessions in one round-trip; project clone dialog, project-name filtering and deletion-cascade summary.
    • Model Presets: A Settings ▸ Model Presets section, a preset picker replacing the role's model/settings pickers, explicit non-sendable state and compaction editing.
    • Instructions library: A Settings ▸ Instructions tab and an in-role instruction picker, with atomic single-request role saves.
    • Agent role tooling: Enable/disable switch per role, project grouping, and a role form/detail that groups tools by origin (operator, server built-in, worker, MCP server) with per-origin sub-groups.
    • Chat message insights: Assistant completion notices, a collapsible reasoning section, a message usage dialog (tokens, response duration, reported cost), a thread stats dialog, and a raw LLM request viewer.
    • Turn feedback: Session-list status indicators, an assistant response timer in the composer, tool-call duration formatting, and a "Writing tool calls…" construction indicator.
    • Turn notifications: A Settings ▸ Notifications tab (master, sound, OS notification) with desktop, web and Android sound/OS channels, permission handling and click-to-select-session.
    • Admin & auth: Create-user dialog with registration-grade validation, and a sign-up entry hidden/gated when self-registration is disabled.
    • Session list ordering: The panel now re-sorts by last activity on persisted-message events.
    • Localization: New English and Spanish strings for projects, compaction, notifications, reasoning, usage/cost and error messages.

    Worker (MCP tool execution)

    • run_command output handling: stdout and stderr are now drained concurrently with bounded output, and stdin, timed-out processes, readers and descendants are cleaned up safely, preventing pipe deadlocks.

    Deployment / Documentation (non-code modules)

    • Docker image tags: Non-production images are now also published under a mutable snapshot channel tag alongside their version-specific tags (deploy/ — note: deploy/ is not one of the modules listed in the project map; reported as-is).
    • Release versioning & docs: Project version moved from 0.11.0-SNAPSHOT to stable 0.11.0, and the feature-tracking documentation set (docs/) was reorganized into Roadmap, Todos, Known issues, Resolved issues and archived ideas.

    🐛 Bug Fixes & Improvements

    • Worker: Prevented run_command pipe deadlocks by draining both streams concurrently and cleaning up process resources.
    • LLM (Responses): Assistant replay content is now serialized as a direct string and empty assistant messages are preserved, so replayed turns keep their original content.
    • LLM (Responses): Model tool names are sanitized before dispatch (with a fallback when empty), preventing HTTP 400 errors from malformed names.
    • Agent tools: Multiline tool responses are built without template indentation, preserving formatting.
    • Agent roles: Role deletion now enforces ownership and collapses foreign/nonexistent roles into not-found errors.
    • App chat: A streaming turn cancelled by this client settles its placeholder as interrupted by the user, and a delivered terminal state always wins over a stale fetch.
    • App reasoning: A manual message edit now clears stored reasoning that no longer matches the new content (clearReasoning flag), while turn finalization keeps it intact.
    • App UI: The reasoning section collapses together with its message and its header gained a tooltip.
    • App performance: Tool-call argument and error payload formatting is memoized to avoid re-parsing on every recomposition.

    🏗️ Technical Updates

    • Database migrations: V26–V36 add compaction chunks, per-user role-disabled state, projects, model presets, assistant completion, thread usage, response duration and preset compaction config, plus the V30 session-tool-config drop, V32 instruction normalization and V36 column rename.
    • Koin module decomposition: Split serviceModule into chatServiceModule, toolServiceModule and mcpServiceModule; split the app appModule into appCoreModule, appApiModule, appChatModule and appSettingsModule, preserving every binding key, qualifier and eager/lazy semantic.
    • App architecture: Split SessionRepository into list and conversation halves with dedicated SessionDetailsStore/ToolCallStore/SessionSummaryStore caches; extracted ChatTurnController and SearchNavigationObserver; split SendMessageUseCase collectors and approval emitter; decomposed the message action row; moved dialog ownership into the relevant use cases.
    • Server architecture: Extracted AgentRoleMapper/AgentRoleRequestValidator, the AuxiliaryCompactionSummarizer, the AuxiliaryCompactionConfigResolver/CompactionPreferenceService pair, and reworked the per-turn compaction resolution into configured/not-configured/rejected outcomes.
    • Common refactors: Split the built-in tool catalog by family and the JSON-schema builders into internal helpers without changing catalog order or public API.
    • Test-suite restructuring: Split the monolithic run-command, session-route, compaction-service and turn-orchestrator suites into focused classes; added RunCommandTestSupport and shared view-model scope utilities. Also de-flaked the project updatedAt, compaction newest-chunk, JWT distinctness and auth fixture-token tests.
    • Breaking changes for out-of-repo consumers:
      • V29 rebuilds agent_roles around a single model_preset_id reference and drops model_id/model_settings_id; pre-existing roles become preset-less and non-sendable until a preset is attached.
      • V30 removes session tool configuration; effective tools are role-derived.
      • PUT /api/v1/me/preferences/conversation_compaction now rejects null auxiliary ids with 400 invalid_argument while enabled is true.
      • Project deletion now returns 200 with a deletion-summary body instead of 204.
    Downloads