-
-
Notifications
You must be signed in to change notification settings - Fork 119
Changelog
All notable changes to CortexPrism are documented here.
Format: Keep a Changelog
Versioning: Semantic Versioning
-
Multi-user collaboration — users, teams, API tokens, and resource scoping across the entire
platform. New
userstable with PBKDF2 password hashing,teamstable with join policies,team_membershipsjoin table,user_tokenstable for API access (SHA-256 hashed),resource_sharestable for cross-user sharing,instance_identityandfederation_peerstables for instance-to-instance federation. Migrations 044–047. -
Request identity system —
RequestIdentityinterface with userId, teamIds, isInstanceAdmin fields, extracted from session cookies orAuthorization: BearerAPI tokens. -
Authorization guards —
requireInstanceAdmin(),requireTeamAdmin(),requireTeamMember(),requireResourceOwner()for coarse permission checks. -
API token management —
POST /api/auth/tokenscreate,GET /api/auth/tokenslist,DELETE /api/auth/tokens/:idrevoke. Team-scoped tokens with expiration and last-used tracking. - Team management API — full CRUD for teams and members with join policy controls.
-
Resource sharing API —
POST /api/sharesfor cross-user resource sharing with ownership validation. - Federation API — instance-to-instance trust establishment with pairing tokens.
-
User management API —
GET/POST /api/users, enable/disable (instance admin only). - Multi-user web UI — login page with username+password, team selector dropdown, Teams page with member management, Users page with create/disable/enable (instance admin).
-
CLI commands —
cortex login(username+password or API token),cortex logout,cortex whoami,cortex users list/create/disable/enable,cortex teams list/create. Auth token stored in~/.cortex/auth.json. - Locale translations — all 10 non-English locale files fully translated from English source.
-
Login flow —
/api/auth/loginnow accepts{ username, password }for multi-user auth. -
Session model —
Sessioninterface gaineduserIdandusernamefields. -
Auth middleware —
requireAuth()extractsRequestIdentitywith user/team/admin context. - Agent CRUD scoped — three-layer filtering (user → team → instance) for agent operations.
- Migration version collision — four-part migration 044–047 uses unique version numbers.
- Agent authorization — GET/PUT/DELETE on agents validates user ownership or team access.
-
Per-user default agent isolation —
selectAgent()no longer overwrites global default. -
Auth per-request DB query —
requireAuth()caches user-existence check.
-
6 new LLM providers — DeepInfra (
meta-llama/Llama-3.3-70B-Instruct), Hyperbolic (deepseek-ai/DeepSeek-V3, 80% cheaper), MiniMax (M3 model, 80.5% SWE-bench at $0.30/$1.20 per 1M tokens), Zhipu/GLM (glm-4-flashfree tier), Replicate (predictions-based API with SSE streaming), and Cloudflare Workers AI (edge inference, requires Account ID + API token). Total providers: 24 → 30. -
Distributed agent swarm — cross-instance coordination via A2A protocol. Swarm contracts, node registry with heartbeat metrics, A2A transport, swarm coordinator (self-registration, 30s heartbeat loop, drain/seal lifecycle), directive handler (5 kinds:
spawn_agent,execute_task,query_resources,forward_message,sync_state), remote kernel proxy (synthetic PIDs ≥900000), migration 043 (swarm_directives,swarm_resource_snapshotstables). CLI:cortex swarm(init, nodes, topology, report, drain, seal). Web UI: fleet summary cards, node CPU/memory bars, Swarm Topology + Directive History views. API:/api/swarm/topology,/api/swarm/report,/api/swarm/directives,/api/swarm/nodes/metrics,/api/swarm/nodes/:id/snapshots. -
Channel webhook routes —
GET/POST /api/channels/webhook/:protocoldispatches inbound webhook events from WhatsApp, Google Chat, Lark, Telegram, and Teams to the appropriate channel plugin. Handles WhatsApp verification (hub.mode/hub.verify_token) and Lark URL verification (url_verification→{challenge}). Registered as public routes. -
Channel agent-loop bridge —
createChannelEventHandler()bridges channel inbound messages toagentTurn(). Maps channel conversations to Cortex sessions viachannel_sessionstable, auto-creates sessions, resolves agent config → provider → model, registers tools, loads plugins, builds system prompt, and sends response back to channel. -
Microsoft Teams inbound —
TeamsChannelPluginnow hashandleWebhook()parsing Bot Framework Activity format (type,from,text,conversation,channelData,attachments). Teams was previously the only channel with zero inbound path. -
88 data-tooltip hover hints — added across 16 UI source files covering all major surfaces: chat, editor, dashboard, sessions, skills, settings, agents, services, policies, marketplace, git, tunnel. Uses existing
#global-tooltipJS system with 250ms hover delay.
-
Memori checkpoints never captured — the entire checkpoint infrastructure was implemented but never wired into the agent lifecycle. Added fire-and-forget checkpoint capture to
runCleanup()so every agent turn persists a full state snapshot. Auto-prunes to the most recent 5 checkpoints per session. -
Server channel auto-start never worked — auto-start loop used wrong plugin instantiation pattern (expected default exports, all channel files use named classes). Replaced with a
switchon channel type that constructs the correct class for all 9 channel types. -
Channel contracts were stale and unused —
IChannelAdapterhad a single untypedsend()method, imported by zero files. Updated both interfaces to match actualChannelPluginsystem (8 typed methods,handleWebhook,findChannelByProtocol,setEventHandler,sendToChannel). -
Channel bridge missing tools and context —
createChannelEventHandler()calledagentTurn()without registry,toolContext, workspace dir, system prompt, or plugins. Agent had zero tools available. Now wires full tool registration and context. -
16 unwired/broken areas — CLI aliases silently
Deno.exit(1)instead of delegating (chat, tui, serve, start, stop, restart). Six fully-implemented CLI commands never registered (run, update, migrate, service, qm, mqm).PUT /api/workflows/:idparsed update body but never applied mutations. Pipelinepre-reflect/post-reflectstages never wired. Stalepackages/cliregistry removed.AGENTS.mdpaths/counts corrected. Three test files used legacy Deno CDN imports. -
Codegraph: 5 bugs — call edges attributed to wrong source node, edge sourceQName absolute↔relative path mismatch,
bulkInsertNodesreturned wrong IDs causing FK violations, post-insert DELETE removed all edges, auto-index infinite loop + data corruption. -
5 provider wiring fixes — Novita models endpoint returned 404 (wrong API version). Alibaba models fetcher used wrong regional domain.
fetchModelsForModalrequired API key for localhost providers (LM Studio, LiteLLM). LM Studio deadnumCtx/keepAliveconfiguration fields. Cloudflare model fetch had no access to Account ID. -
Vault token consolidation —
decryptValue()returned encryptedenc:string on failure instead ofnull, causing corrupted blobs to flow throughloadConfig(). Now returnsnullon decryption failure. -
GitHub clone missing token authentication —
POST /api/projects/import-githubcalledgit clonewithout embedding the GitHub token, so private repos failed. Now constructshttps://{token}@github.com/{fullName}.git.
-
ProviderKindconsolidated — 24-provider union type was defined identically in 3 places. Now single source of truth in contracts file. -
Removed backward-compat CLI aliases — dead alias stubs (
cortex chat,tui,serve,start,stop,restart) removed. Users reach canonical paths directly.
-
Checkpoint Time-Travel UI — Memori page (
/memori) renders a full two-panel timeline: session-grouped checkpoint list on the left, rich detail view on the right. Each checkpoint shows turn number, goals, message count, tool calls, and workspace snapshot. Resume here and Branch from here action buttons. -
Runtime Tool Forging — agents create, test, and export custom tools at runtime via
tool_forge,forged_call,tool_export, andtool_list_forged. Static safety scan againstUNSAFE_PATTERNS, optional LLM security judge, session-scoped forged-tool registry. -
Multi-Agent Orchestration —
orchestratetool with 6 strategies:sequential(chain agents),parallel(concurrent + synthesiser),debate(N agents, R rounds, impartial judge),review-loop(writer + reviewer iterate),hierarchical(coordinator + workers),graph(DAG with topological execution). - HEXACO Personality System — agents configurable with 6-factor personality (H, E, X, A, C, O ∈ [0,1]). Drives system prompt injection, memory retrieval bias weights, response style hints, and MQM routing hints. Neutral scores (0.5) produce no change.
-
Memory Benchmark Runner — LongMemEval-S compatible.
cortex eval memoryCLI with--suite,--sample,--full,--jsonflags. REST API at/api/eval/memory/. Web UI with summary stat cards, per-category accuracy chart, per-question results, and historical trend table. CI workflow runs weekly. - 10 built-in agents — 5 new specialists: Writer ✍️, DevOps 🚀, Security 🔐, Code Reviewer 👁️, QA/Tester 🧪 join the existing 5 (Assistant, Developer, Researcher, Architect, Analyst). All 5 existing agents received deep soul rewrites with Capabilities, Guardrails, Limitations sections, sub-agent delegation hints, and improved output format specs.
-
2 new sub-agent types —
reviewer(structured BLOCKER/SUGGESTION/NITPICK/QUESTION format) andwriter(Keep a Changelog + API doc conventions). Total sub-agent types: 11 → 13.
- Sub-agent prompts refined across all 11 types — scope boundaries, verification mandates, source-quality hierarchies, dependency checklists expanded, explicit causation caveats.
- Extensions top-nav category — plugins get dedicated Extensions tab (sixth tab). Plugin-contributed panels appear as first-class sub-nav items with full URL hash deep-link support.
-
Plugin sidebar slot injection — plugins declaring
ui:panelhave panels registered inui-slotsregistry.GET /api/plugins/slotsendpoint. Sidebar-slot plugins injected as clickable items above sidebar footer. -
Plugin middleware pipeline hooks — ESM plugins can export
middlewarePre/middlewarePostfunctions auto-registered aspre-tool/post-toolpipeline hooks. Clean unregistration on disable/remove. -
Plugin event bus wiring — live agent lifecycle events (
agent:turn-start,tool:pre-execute,tool:post-execute,agent:turn-end) fire to plugin event bus. - Navigation consolidation — 9 pages merged into 5 tabbed hubs (Sandbox, Remote & Computer, MCP, System Health, Automation). Extensions + Panels tab. Activity (Lens) moved to System category.
-
host.registerTool/unregisterToolwere no-ops — PluginContext.host stubs silently discarded tool registrations. Now delegate to globalRegistry. - Plugin panel navigation — moved to Extensions category, old sidebar duplicate removed.
-
unloadPluginleft dangling hooks and UI slots — now callsunregisterAllForPlugin()andunregisterUIPlugin().
Sync all package versions to 0.50.0 across main repo and package manifests.
UI overhaul with horizontal top navigation (5 categories, 40 pages), experience levels (Beginner/Intermediate/Advanced) with 3-button segmented control, dark/light theme toggle with system preference detection, and JS tooltip system replacing CSS pseudo-elements. Data import system with OpenClaw, Hermes, and ZeroClaw importers supporting config, sessions, and memory migration. New CLI commands registered: cortex import, cortex qm (Quartermaster tool orchestration), cortex mqm (Model Quartermaster), cortex service (full CRUD). Comprehensive security audit resolved 18 issues: SSRF wired into shell validation, session isolation enforced at tool-call boundary, 16 new deny rules, 4 hardened regex patterns, policy table CHECK constraint widened (migration 042), 12 tool risk profiles, CORTEX_VAULT_KEY removed from safe vars, classification default relaxed to 'normal'. Prompt Lab A/B testing and prompt generation with 14 API endpoints. Memory graph entity detail panel with clickable nodes. Quartermaster and MQM fixes (18 total). Sessions tree view. Dead code removal across eval routes and unregistered endpoints.
Tauri desktop app rebuilt with Rust IPC backend (8 commands, system tray, server lifecycle management) and dedicated desktop frontend (toolbar, quick-ask bar, health indicator, iframe-hosted dashboard). 30+ previously hardcoded runtime values made configurable via config.json: agent loop (maxToolRounds, sub-agent timeout, stream timeout), sandbox (timeout, max output, Docker images), approval workflow (auto-approve risk, timeouts), job scheduler (running job timeout), Chrome Bridge (health check, retries, backoff), UI CDN endpoints, and code graph limits. All config sections use deep merging so partial overrides don't wipe defaults.
Codebase modularization into 6 coarse Deno workspace packages with pure TypeScript contracts (core ← gate ← ai ← server ← cli, core ← ai ← infra ← cli). Router split: 6,075-line monolith → 62 route modules + new-router.ts dispatcher. UI split: 17,740 lines → 74 modular files (CSS, pages, JS, shared). Agent loop decomposed: 1,605 lines → 7 stages, 3 post-turn modules, 3 helpers, 81-line orchestrator. 41 contract interfaces across 6 package boundaries with zero runtime dependencies. 593 source files migrated while preserving original src/ directory. Boundary enforcement script ready for CI. Memory barrel export, memory graph visualization, integrated terminal in Web UI.
-
Sandbox backends API hardcoded Docker availability —
GET /api/sandbox/backendsreturnedavailable: truefor Docker regardless of whether Docker was actually installed. Thedefaultbackend now falls back tosubprocesswhen Docker is unavailable. -
IPC socket directory hardcoded to
/tmp/cortex— socket dir on Linux now usesgetTempDir()which checksTMPDIR/TEMP/TMPenv vars. -
MCP client version stale and duplicated — MCP
clientInfo.versionwas hardcoded to'0.35.3'in two places. Added a synchronousVERSIONexport fromconfig/version.tsand updated both MCP client locations. -
A2A
pushNotificationscapability hardcoded — agent card always declaredpushNotifications: false.getA2AAgentCard()now checks the channel store for enabled channels. - Daemon log path, onboarding version, Pinecone fallback, Bedrock region — multiple hardcoded values replaced with dynamic config/env reads.
-
/compactand/planslash commands were stubs — replaced with informative messages explaining these features run automatically in the agent loop. -
MAX_OUTPUT_BYTESinconsistent between shell and sandbox — standardized to 64KB. -
VFS fake
RegExpMatchArraycopy-pasted 3 times — extracted into afakeMatch()helper function. -
Debug settings page not saving log level config —
PUT /api/confignow deep-merges theloggingkey instead of replacing it entirely. Form fields now populate from current config when switching tabs.
-
Stale job recovery —
recoverStaleJobs()detects jobs stuck inrunningstate longer than 10 minutes and transitions them topendingorfailed. Recovery runs at daemon startup and every poll cycle.cortex jobs recoverCLI command allows manual recovery. -
Scheduler structured logging — the scheduler daemon now uses the project's
logger()instead of rawconsole.log. -
Jobs CLI verbose mode —
cortex jobs list -vshows full job details: timestamps, duration, source, and last 5 runs.-rfilters to running/stuck jobs. - Debug settings page — new Debug tab in Web UI Settings with four diagnostic cards: System Diagnostics, Scheduler & Stuck Jobs, Sandbox Debug, and Log Level & File.
-
System diagnostics API —
GET /api/system/diagnosticsreturns scheduler aliveness, running job count, DB file sizes, sandbox runtime, and Deno memory usage.
-
Jobs stuck in running state — if the scheduler daemon crashed or was killed mid-execution, running jobs were left stuck indefinitely. Now handled by
recoverStaleJobs().
-
Tool call lens events missing payload —
logEventfor tool calls now includes a structuredpayloadwith tool name, success status, output (first 500 chars), error, and duration. -
VERSION file out of sync — synced with
deno.jsonversion.
-
Server restart not working — fixed Cliffy 1.2.1 routing bug where parent commands with both subcommands and empty
.action()misrouted subcommands. Removed no-op.action()from container commands. -
Server graceful shutdown — added
SIGTERM/SIGINTsignal handlers with PID file management, service cleanup, and chrome-bridge shutdown. -
Service manager orphan cleanup on restart —
startAutoServices()now checks if each running service's PID is still alive and resets dead services. - Server restart port race condition — replaced fixed 1500ms sleep with port availability polling (up to 10s).
-
Marketplace plugin version enrichment broken —
checkGitHubRelease()was passing an invalid GitHub token. Now detects 401/403 and retries unauthenticated. -
Marketplace CLI lacked version enrichment —
cortex marketplace list pluginsnow enriches versions from GitHub releases. -
installFromMarketplaceused stale manifest version — now resolves actual latest version from GitHub releases before downloading. -
Update flow GitHub fallback used
mainbranch — marketplace plugin update fallback now downloads from the correct release tag. -
content_readablesupply chain failure — fixedDeno.readTextFile()rejection offile://URIs. -
Supply chain
requireKnownHashtoo strict — changed default fromtruetofalsefor community marketplace plugins.
- VSplit/HSplit key dispatch — split-pane layouts weren't adding children to the component tree, blocking keyboard input in nested panels.
- TUI enter key decoded as Ctrl+M — reordered byte checks so the Enter key is recognized before the Ctrl+M control range, fixing message submission.
-
TUI enter key input clearing —
onSubmithandler now unconditionally clears text with properawait. - TUI logging pollution — silenced agent-loop stdout output during interactive sessions.
- TUI duplicate render path — root renderer was traversing nested children after splits had already rendered them, causing flicker.
-
I18n key sync — synced
cli.tuii18n keys across all 10 locales.
-
Custom Deno-native TUI framework — full terminal UI framework (
src/tui/) with double-bufferedVirtualScreen, class-basedComponenttree with lifecycle hooks, layout engine (HSplit,VSplit,ScrollView,Box), rawInputEnginewith emacs-style keybindings, and three built-in themes. 9 reusable components: Header, StatusBar, TextInput, CompletionMenu, MarkdownBlock, CodeBlock, DiffBlock, ToolCard, ChatView. -
cortexCommand()builder with declarative middleware — fluent CLI command builder replacing rawnew Command(). Commands declareneeds('config'|'migrations')and receive typedCtxwith auto-loaded config. -
Static command registry with lazy imports —
CommandEntry[]table mapping nested paths to asyncload()functions. Command modules only imported when invoked. -
Global CLI flags —
--json,--verbose,--no-color,--config <path>,--model <model>,--profile <name>propagate to all subcommands. -
agent exec <prompt>one-shot mode — non-interactive agent execution for CI/scripting.--jsonflag outputs structured JSON. -
configcommand group —config get/set/unset/list/validatewith dot-notation keys and encrypted credential storage. -
12 slash commands in TUI chat —
/model,/compact,/status,/clear,/save,/load,/export,/theme,/diff,/review,/plan,/help, plus/! <cmd>and/soul. -
Shared agent session helper —
createAgentSession()extracts agent initialization into a reusable function. -
OS Kernel —
OsKernelsingleton with system call dispatcher, capability enforcement, RBAC (4 roles), per-agent token/cost tracking, and process registry with parent-child tree. -
Kernel turn orchestration —
kernelTurn()wraps the agent loop with process registration, resource accounting, and token/cost tracking. -
Observable LLM provider wrapper — all LLM calls across every subsystem automatically observed via
ObservableLLMProviderwrapper providing Langfuse generations, Lens audit events, and Prometheus metrics. - Built-in agent profiles — 5 pre-configured agents: Assistant, Developer, Researcher, Architect, Analyst. Built-in agents cannot be deleted but can be customized.
- IDE-style code editor — redesigned File Editor with resizable sidebar, bottom panel with Problems/Output/Terminal tabs, find/replace bar, quick file open (Ctrl+P), context menus, enhanced status bar.
- OS capability groups — 12 capability groups forming an OS syscall table.
-
Resource limits for agents —
ResourceLimitstype withcpuShares,memoryMb,diskMb,maxProcesses,networkKbps. -
Boot sequence definition — formal
BootStagetype andBOOT_ORDERarray for ordered OS startup. -
OS health endpoint —
GET /api/os/healthreturns aggregated health report. -
OS API endpoints —
/api/os/info,/api/os/processes,/api/os/capabilities. - OS Health dashboard — new Web UI page showing system health dashboard.
-
Virtual filesystem —
src/vfs/module providing/cortex/*namespace abstraction. -
Supervisor upgraded to init process — follows formal
BOOT_ORDERsequence with sequential daemon startup and socket readiness checks. -
Plugin dependency resolution —
src/plugins/deps.tswith semver constraints, topological sort, circular dependency detection. - CI pipeline hardening — i18n consistency validation, standalone entry point type-checks, coverage reports.
- Release pipeline hardening — full test suite, i18n validation, and type-checks before compiling release binaries.
- Tauri desktop dashboard build — generates full CortexPrism SPA as static HTML for Tauri.
-
CLI command tree restructured — from 44 flat commands to nested domain groups:
agent(chat/tui/exec/sessions/eval),server(start/stop/restart),sandbox(run),self(update),db(migrate),config(get/set/unset/list/validate). - Agent OS identity in soul templates — all soul templates now identify the agent as running on CortexPrism OS.
- "Agentic harness" terminology replaced with "AI agent operating system" across CLI description, GitHub User-Agent, and package manager manifests.
- Interactive TUI logging polluted the screen — agent loop stdout logging silenced during interactive sessions.
- Nested layout children rendered twice — fixed duplicate rendering in root renderer.
-
Tool approval gate hung indefinitely in TUI chat — rewritten
approvalGatecallback properly resolves via user input. - Per-keystroke synchronous filesystem I/O in TUI — completions now trigger only on explicit Tab press.
- Full array copy on every streaming chunk — changed to in-place mutation of last message content.
- Daemon logs always empty in UI — fixed filename prefix mismatch in log path resolution.
-
Daemon migration race at startup — made
applyMigration()resilient to concurrent execution. - LLM producing raw tool code as output — added malformed-tool-call detection, structural quote discrimination, and propagation of inject messages.
-
Jobs duplicating from agent schedule tool — added upsert mode to
createJob(). - Template literal regex and escape bugs in UI — fixed multiple template literal escape issues causing broken JavaScript in rendered page.
- Sub-agent types expanded from 5 to 11 — all 11 specialized types supported: explore, general, plan, code, research, security, debug, architect, devops, data, ui.
-
True parallel sub-agent execution — multiple
sub_agenttool calls in the same turn execute concurrently viaPromise.all. - Metacognition engine domain expansion — 6 new keyword sets (security, debug, devops, data, ui, architect — 143 keywords total).
- Sub-agent retry with fallback — retries with same type and configuration on failure.
-
Sub-agent usage metrics —
getSubAgentMetrics()andgetSubAgentSuccessRate()provide per-type spawn/completion/failure counts. -
Chat retry action —
↻ Retrybutton replays last turn by truncating session at last user message. -
Checkpoint restore —
POST /api/memori/checkpoints/:id/restorerewinds session to any saved checkpoint.
-
Sub-agent privilege-escalation fallback removed — automatic retry with
type="general"that widened tool permissions was removed. - DB corruption recovery hardened — fail-closed approach requires manual operator recovery instead of silent deletion.
- Retry state drift after page reload — user message metadata persisted as JSON for accurate retry.
-
lens.db multi-process corruption (SQLITE_CORRUPT) — 5 OS processes writing to same WAL-mode
lens.dbfixed byNoopDbstub for subprocesses. - claude-sonnet-4-5 hallucinated by LLM — removed specific model example from tool description.
-
Codegraph transaction deadlock and FK violations — added
ROLLBACKinfinallyblocks, pre-filtered invalid edges. - Malformed tool calls silently dropped — added detection for unparsed tool call patterns.
- Recursive sub-agent depth explosion — added depth guard refusing spawns at depth ≥ 2.
- Various vault, MCP, sandbox, and skills fixes — 20+ fixes across subsystems.
- Sub-agent type system prompts enhanced — all 11 types now have detailed protocols and quality standards.
- Sub-agent model/provider inherits from chat — sub-agents use the active chat model unless type-specific override.
- Sidebar navigation consolidated — merged duplicate nav items, unified Tools & Integrations.
- Sandbox debug logging — all sandbox modules emit namespaced debug logs, toggleable via env var, CLI flag, API, or WebUI.
-
Auto model selection with explicit model pool — new
Autochat model mode using backend-native runtime selector with configurable global pool. Model Quartermaster UI for pool management. Per-turn resolved model metadata reported through WebSocket. -
Quartermaster wired into agent loop —
observe()records every tool execution andpredict()runs before each LLM round. -
Structured content block support in LLM providers —
CompletionChunkextended with content block events. Anthropic preserves structured events, OpenAI-compatible providers handledelta.tool_callsarrays. -
Tool call parser: 5 format support — parser handles XML tags, nested XML, attribute syntax, direct-tool-name-as-tag, and
<parameter>formats.sanitizeModelJson()pre-processes model-emitted JSON. -
Agent loop: urgency nudge at roundsLeft ≤ 2 — explicitly tells model to use
file_write.maxToolRoundsincreased from 8 to 12. - Test infrastructure — coverage tasks, shared test helpers, 10 typed error classes.
-
cortex debugCLI command — live introspection for sessions, health, metrics, memory. -
Debug HTTP endpoints —
/api/debug/health,/api/debug/sessions,/api/debug/metrics. - Logging enhancements — request ID propagation, automatic stack-trace capture on error.
- Tool call parsing: multiple formats not recognized — parser now handles 5 model output formats.
-
Tool call parsing: JSON rejected due to raw newlines —
sanitizeModelJson()fixes common JSON errors. - Agent loop: infinite research without writing — Quartermaster tool prediction, increased rounds, urgency nudge.
-
Workspace file_write:
Is a directoryerror — removed unnecessaryresolve()call in path resolution. - Web UI chat refresh created duplicate sessions — localStorage session id hydration fixes.
- Chat bubble formatting collapsed paragraph breaks — fixed whitespace collapsing regex.
- Web UI file editor: 404 opening files in subdirectories — path segments now encoded individually.
- InjectionDetectorHook flagged tool result content — skip system-generated tool result messages.
-
WebSocket reconnect on new tab created duplicate sessions — pass
msg.sessionIdtoensureChatSession. - OpenAI-compatible streaming tool calls stuck at "Thinking…" — update cached entry name when later chunks provide it.
- Pipeline abort showed "Thinking…" forever — send abort message as chunk when no previous chunks delivered.
-
Codegraph: indexing and graph rendering — tree-sitter WASM grammar CDN URLs fixed (removed non-existent
wasm/prefix),web-tree-sitterv0.24.x API migration (default export forinit()andLanguage), FTS5 search index now rebuilt after indexing, edge insertion usesINSERT OR IGNOREwith orphan cleanup, import-map resolution restructured for correct fallback ordering, legend colors mapped to actual node labels only, architecture panel wired to live Node/Edge/Hotspot counts -
Codegraph: edge/impact/trace endpoint response shapes —
POST /api/codegraph/impactnow returns{ nodes: [...] }andPOST /api/codegraph/tracereturns{ paths: [[...]] }matching UI expectations - Codegraph UI: blank page, project selector, graph rendering — added Index button with inline path prompt, empty-state overlay shows actionable "Index a Project" button, project selector preserves selected value on refresh, nodes sized by degree with hover tooltips, D3 transform-based group movement
-
Editor: directories and navigation — workspace listing endpoints now append
/to directory names, addededitorCurrentPath/editorOpenDir()/editorGoUp()for click-to-navigate folder browsing, file open/save use full relative paths -
Projects: agent selection on GitHub import — agent
<select>dropdown in both import modal and inline panel,POST /api/projects/import-githubacceptsagentIdfield and clones into workspace agent directory, New Project form uses agent dropdown instead of free-text -
Re-index diagnostics —
POST /api/codegraph/indexreturnsnodeCount,edgeCount,fileCount,errorCount,errorSamplein response -
Template-literal string escaping — fixed
renderEditorTreeregex and onclick-string escapes consumed by TypeScript template literal, producing broken generated JS -
API: 404 on Remote Agents, Computer Use, and Vault pages — added route handlers for
/api/remote/agents,/api/remote/directives,/api/remote/deploy,/api/computer/screenshots,/api/computer/actions,/api/computer/config,/api/vault/list,/api/vault/store,/api/vault/delete/:key,/api/vault/audit,/api/vault/export,/api/vault/import -
Web auth: login redirect loop on HTTP — session cookie
Secureflag now conditional on request protocol (setSessionCookie/clearSessionCookieinauth.ts) -
Web auth: vault key bypass — documented
CORTEX_VAULT_KEYrequirement;hasPassword()no longer silently returnsfalsebypassing auth when key is unset - Web auth: onboarding behind auth middleware — 11 onboarding POST endpoints moved to public route section before auth middleware gate
-
UI: password field DOM warnings —
DOMContentLoadedscript auto-wraps orphaned password inputs in<form onsubmit="return false"> -
API: 404 on Eval, Providers, and related pages — added route handlers for
/api/eval/suites,/api/eval/run,/api/eval/runs,/api/eval/runs/:id,/api/eval/baselines,/api/eval/baselines/:id,/api/providers/:kind/models(returns empty array on unconfigured provider instead of 502)
-
Polyglot cross-language analysis — architecture endpoint runs
detectFFIBridgesviapolyglot.ts; response includesffiBridgesfield for JNI, cgo, ctypes, etc. bridges -
Incremental sync watcher — Codegraph page starts 30-second polling loop (
POST /api/codegraph/incremental-sync); graph auto-refreshes on new nodes/edges -
Pilot config wired —
code_pilottool loads saved pilot config (token budget, pruning mode, include tests) fromloadConfig();GET/PUT /api/codegraph/pilot-configendpoints now have active consumer -
Error logging —
console.erroradded to previously-bare catch blocks indiscoverFiles,indexFile,incrementalSync
-
UI:
fetchJSON is not defined— movedfetchJSONfromDASHBOARD_JStemplate scope to global script scope so all pages (Sandbox, Projects, PromptLab, Channels) can use it -
API: 404 on Metacognition, Tools, A2A, Processes, Providers, Router, Security Supervisor — added route handlers for
/api/metacognition/history,/api/metacognition/summary,/api/tools/registry,/api/tools/list,/api/a2a/agent-card.json,/api/processes/sub-agents,/api/providers/comparison,/api/router/history,/api/security/supervisor,/api/security/supervisor/history -
API: 404 on Memori, Daemons, Memory extensions — added route handlers for
/api/memori/checkpoints,/api/daemons/health,/api/daemons/:name/logs,/api/daemons/:name/restart,/api/memory/privacy,/api/memory/heuristics,/api/memory/embeddings,/api/memory/vector-store -
Supervisor now configurable — added
SupervisorConfigtype (provider,model,cacheTTL) toCortexConfig;selectSupervisorModel()checks explicit config before fallthrough; Settings UI replaced read-only stat rows with editable provider/model dropdowns -
Projects: GitHub import + Codegraph integration —
POST /api/projects/import-githubclones repos into workspace, creates filesystem project, and best-effort indexes into Codegraph; Projects page has Import from GitHub modal and inline picker -
Codegraph: projects now appear in selector —
GET /api/codegraph/projectsmerges indexed and filesystem projects; selecting a filesystem-only project auto-indexes on first load -
Projects persistence — GitHub-imported projects persist the actual cloned workspace path in
cortex-project.jsoninstead of metadata directory path -
MCP & Chrome Bridge routes — added
GET/POST/DELETE /api/mcp/connections/*,GET /api/mcp/server,GET /api/chrome-bridge/status,POST /api/chrome-bridge/start|stop,GET /api/chrome-bridge/tools -
GitHub token detection — fixed
getGitHubToken()to read fromconfig.update.githubTokenandconfig.pluginUpdate.githubTokeninstead of non-existent top-level field -
Settings tab null-guards —
switchSettingsTab()andswitchSettingsExtTab()now use?.styleon optional extension tab elements
-
UI: removed Tailwind CDN — replaced
cdn.tailwindcss.comscript tag with inline CSS, removed redundant utility classes, updated CSP headers -
UI: SyntaxError on Projects page Delete — changed inline
onclickhandler from double-quote JSON to single-quote JS withescAttr()wrapper -
UI: vault credential form a11y — wrapped vault credential modal inputs in
<form>with proper button types, addedautocomplete="current-password"
-
Sandbox & Environment (#79, #230, #232, #240) — full sandbox and environment management suite with environment replication, workspace snapshots, dev environment as code, and bug reproduction studio:
- Environment Replication Debugger (#79) — capture and replay development environments (6 endpoints, sensitive-key masking, shell-injection-safe replication)
- Workspace Context Snapshot (#240) — point-in-time workspace state capture with SHA-256 hashing, file tree diffing, restore manifests
- Dev Environment as Code (#232) — auto-detect language/dependencies (JS/Python/Rust/Go/Ruby), generate versioned manifests
- Bug Reproduction Studio (#230) — create/execute/list bug repro runs with status lifecycle (queued→running→passed|failed|error)
-
Shared utilities —
git-capture.ts,dependency-detect.ts,snapshot-types.ts
- Sandbox page — new dedicated page with 4 tabs (Snapshots, Workspace, Dev Env, Bug Repro)
- Database migration #034 — sandbox_snapshots, workspace_snapshots, dev_env_manifests, bug_repro_runs tables
-
API endpoint —
GET /api/sandbox/confignow returns runtime, Docker/gVisor availability, timeout/memory limits, supported languages
- Shell-injection hardened: env var keys validated, values fully escaped, exports commented-out by default
- Path traversal prevented: all 6 sandbox endpoints validate workspace paths
- Sensitive env var values masked in API responses
-
Code Intelligence (#74, #81, #84, #229, #239, #294, #295) — full code intelligence suite:
- Cross-Repository Code Search (#74) — search across all indexed projects with language filtering
- Code Ownership Router (#81) — git-blame-based code ownership analysis
- Multi-Language Polyglot Bridge (#84) — AST node normalization across 15+ languages, cross-language call tracing
- Codebase Archeologist (#229) — file commit history browser
- Live Codebase Q&A (#239) — FTS-backed symbol search with citations
- Alcove Private Documentation (#294) — documentation search and browse page over
.cortex/data/docs/ - Codebase Pilot (#295) — token-optimized context builder with AST-aware pruning
- Codegraph page extended with 4 new bottom-panel tabs: Ownership, History, Q&A, Pilot
-
code_pilotagent tool registered as 60th builtin tool
- Settings page resolved stuck "Loading…" state
- Settings navigation consolidated dual navigation bars into single global sub-nav
- Codegraph Q&A JavaScript syntax error fixed
-
Supply-Chain Verification Reports — verification results are now persisted per plugin and surfaced in the Extensions page:
- New
verification_report_jsoncolumn on the plugins table (migration #033) -
IntegrityReportis stored after plugin install and both update paths (GitHub + marketplace/URL), withtrust_levelauto-derived from verification status - Color-coded trust badges in plugin cards (green verified, amber unverified, red suspicious/blocked)
- Inline verification details section showing summary and failed checks with per-check severity
- "Scan" button in every plugin card footer and "Re-scan" in the verification section
-
GET/POST /api/plugins/:name/verificationendpoint for inspection and on-demand re-verification
- New
-
Skill Bus Bindings View — live event orchestration surface in the Skills page:
- In-memory recent-events buffer in the skill bus (max 100 events) tracking triggered bindings, per-binding results (success/failure, duration), and timestamps
- New
GET /api/skills/bindingsendpoint returning enriched bindings, bus status, and recent event log - "Bindings" toggle button in the Skills page header switches between skill list and bindings view
- Bindings rendered as cards with skill name, event type, enabled/disabled state, action type, priority, and conditions
- Recent event log showing event type, fired binding count, pass/fail breakdown, and local timestamps
-
Adversarial Self-Critique (#52) — second-pass adversarial reflection runs alongside normal reflection:
- New
adversarialReflection()function inreflect.tswith a skeptical/critical system prompt that actively looks for missed edge cases and risks - Agent loop runs adversarial reflection immediately after normal reflection when
enableReflectionis enabled - Adversarial results stored in reflection_memory with category
adversarial
- New
-
Confidence Task Escalator (#53) — low-confidence assessments auto-escalate to clarification:
- Confidence threshold (0.35) in
metacog.ts— ifassessTask()produces adirectdecision with sub-threshold confidence, it escalates toask_firstwith a clarification prompt -
MetaAssessmentnow carriesescalated: booleanandescalationReasonfields - Escalation events logged to
lens_eventswith typeescalation, surfaced in Metacognition page history with red ⚡ badge - New
GET /api/metacognition/summaryendpoint returning decision distribution, escalation count, and recent adversarial critiques - Metacognition page shows decision distribution bar chart, escalation alerts, and adversarial critique cards with issues
- Confidence threshold (0.35) in
-
Policy-Aware Planner (#57) — agent plans are now logged and surfaced:
- New
src/agent/planner.tswithlogPlan(),checkPlanPolicies(), and in-memory plan store - Agent loop logs every metacognition assessment as a plan artifact with decision, confidence, and signal breakdown
- Plans appear in the Workflows page sidebar above saved workflows, color-coded by decision type
-
GET /api/workflowsnow returns both workflows and recent plans;GET /api/workflows/plansfor dedicated query
- New
-
Goal Drift Detector (#60) — detects when sessions change direction from prior goals:
- New
src/agent/drift-detector.tswith keyword-based drift detection (explicit phrases + Jaccard word divergence) - Agent loop compares each turn against the previous session goal, logs drift events when score ≥ 0.4
- Drift events stored in-memory and written to
lens_events - "Goal Drift" tab added to Workflows page bottom panel showing drift score, previous goal, new input, and timestamp
-
GET /api/workflows/drift?sessionId=endpoint for querying drift events
- New
-
Parallel Sub-Agent Dispatcher (#58) — sub-agent task tracking and live task board:
- New
src/agent/sub-agent-tracker.tswithtrackSubAgentStart(),trackSubAgentEnd(), andgetSubAgentTaskBoard() - Tracking integrated into
sub_agent.tstool at start and all completion paths (success, error, fallthrough) - In-memory tracking of active tasks + rolling recent history (max 100 completed)
- "Sub-Agents" tab added to Workflows page: pulsing green dots for active tasks, status badges for completed/failed
- Active tasks auto-refresh every 3 seconds when tab is selected
-
GET /api/workflows/tasksendpoint for the task board data
- New
-
Memory Health Monitor (#70) — health scoring and warnings for memory stores:
-
getMemoryHealth()now computes a 0-100 health score and generatesHealthWarning[]with severity levels - Stale ratio, low decay, low access, unconnected entities, and low reflection confidence trigger warnings
- Memory page shows color-coded health score bar (green ≥80, amber ≥50, red <50) and warning list
-
-
Entity Resolution Memory (#66) — duplicate detection and merging:
- New
findDuplicateEntities()ingraph.tsfinds fuzzy-matched entity duplicates across the graph - New
mergeEntities()relinks relations and removes the source entity -
GET /api/memory/duplicatesreturns duplicate groups;POST /api/memory/mergemerges two entities
- New
-
Multi-Modal Memory Vault (#69) — vault now supports arbitrary content storage:
- Existing
POST /api/vault/storeaccepts optionalmimeTypefor content storage (setscredentialTypetocontent) - New
POST /api/vault/contentendpoint for embedding, images, files, and text with a 1MB value limit - Content entries logged to
lens_eventswithmemory_writeevent type for auditability
- Existing
-
Cross-Repository Code Search (#74) —
GET /api/codegraph/search-allcross-repo symbol search, Codegraph page "All repos" button -
Multi-Language Polyglot Bridge (#84) —
ftsSearchNodes()language filter,getLanguages(), Codegraph page language dropdown -
Code Ownership Router (#81) —
GET /api/codegraph/ownership?file=git blame attribution with author ranking -
Codebase Archeologist (#229) —
GET /api/codegraph/history?file=git log commit viewer -
Live Codebase Q&A (#239) —
GET /api/codegraph/qa?q=&project=symbol citations with file/line/signature provenance -
Alcove Private Documentation (#294) —
GET /api/alcove/search?q=semantic search over .cortex/data/docs/ -
LLM Vulnerability Scanner (#136) —
POST /api/security/scandetects prompt injection, data leaks, destructive commands, XSS, and SQL injection in prompts/outputs -
Credentials Hygiene Monitor (#142) —
GET /api/security/hygienechecks vault for duplicate names, namespace conventions, and total count warnings -
Zero-Trust Policy Generator (#274) —
GET /api/security/policies/generate-allowlistgenerates path/domain allow-lists from enabled policy rules -
Environment Replication Debugger (#79) —
GET /api/sandbox/snapshotcaptures OS, Deno version, and environment variables -
Bug Reproduction Studio (#230) —
POST /api/sandbox/reproducegenerates reproduction manifests with steps, sandbox config, and environment -
Dev Environment as Code (#232) —
GET /api/sandbox/env-as-codeserializes sandbox config, providers, and web auth -
Workspace Context Snapshot (#240) —
GET /api/sandbox/workspace-snapshotcaptures file tree, sizes, session list, and git branch -
CSV/Spreadsheet Analyst (#109) —
POST /api/tools/csv-parseparses CSV data with headers and rows -
Tool Discovery (#247) —
GET /api/tools/discoverlists all registered tools with names and descriptions -
Plugin Scaffolder (#250) —
POST /api/tools/scaffold-plugingenerates manifest.json scaffolding for new plugins -
Usage Analytics ROI (#249) —
GET /api/analytics/roiaggregates tokens, cost, sessions, and tool calls -
Multi-Channel Memory (#260) —
GET /api/analytics/channels-memoryshows message counts per channel -
Infrastructure Drift Check (#123) —
GET /api/tools/infrastructure-driftdetects Terraform/Pulumi drift -
SSL/TLS Certificate Manager (#126) —
GET /api/tools/certificatesACME and certificate monitoring -
Blueprint Scaffolder (#131) —
GET /api/tools/blueprintsreturns project scaffold templates -
Architecture Fitness (#238) —
GET /api/codegraph/fitness?project=runs naming, circular dep, and layer isolation checks -
MCP Auto-Discovery (#256) —
GET /api/mcp/discoverfinds MCP servers from env vars and config -
PAL CLI Orchestrator (#311) —
POST /api/pal/clireturns recommended model for CLI commands -
Cross-Agent Context Protocol (#255) — shared memory namespace for multi-agent collaboration:
-
src/memory/cross-agent-context.tswithwriteSharedContext,readSharedContext,listSharedContext - Conflict detection with version vectors and conflict resolution API
- Session linking/unlinking with
linkSessions/getLinkedSessions -
GET/POST /api/cacp/context,GET /api/cacp/conflicts,POST /api/cacp/linksendpoints
-
-
Remote Sandbox Backends (#257) — E2B and Daytona added to sandbox runtime types:
-
SandboxRuntimeextended with'e2b'and'daytona'backend types -
GET /api/sandbox/backendsreturns available backends with availability based on API key env vars - Docker and subprocess remain default backends; gVisor, E2B, Daytona as opt-in
-
-
UI Expansion Endpoints — new endpoints for existing features:
-
POST /api/mcp-gateway/health-retry— MCP server health re-check (#252) -
GET /api/memori/preview— session checkpoint browser (#313) -
POST /api/security/approvals/bulk— bulk approve/deny (#254) -
GET/PUT /api/settings/compressor— context compressor config (#55) -
GET/PUT /api/codegraph/pilot-config— codebase pilot token budget (#295) -
GET /api/sessions/links— cross-session context bridge (#64) -
GET /api/agent/preferences— user preference learner data (#68)
-
-
Glossary & Terminology Manager (#73) — in-memory term registry with aliases:
-
GET /api/glossarylists terms with category filter;POST /api/glossarydefines new terms
-
-
Prompt Engineering Lab (#175) — prompt workspace with versioning:
-
src/prompt-lab.tswith template CRUD and run recording -
GET /api/promptslists templates and runs;POST /api/promptscreates templates or records runs
-
-
Embedding Pipeline Builder (#177) — pipeline stage configuration:
-
GET /api/embeddings/pipelinereturns stage, backend, and chunk configuration
-
-
RAG Evaluation Framework (#178) — retrieval quality scoring:
-
POST /api/eval/ragscores retrieval with hit@1, recall, and MRR metrics
-
-
Multi-Model Cost Optimizer (#180) — provider comparison and routing:
-
GET /api/cost/optimizerlists configured providers with key status
-
-
LLM Observability & Tracing (#182) — trace explorer:
-
GET /api/observability/tracesreturns OTEL/Langfuse connection status
-
-
Model Benchmarking Dashboard (#183) — benchmark suite management:
-
GET /api/benchmarkslists eval suites and comparisons
-
-
AI Agent Evaluation Harness (#186) — reusable harness presets:
-
GET /api/eval/harnessesreturns code-gen, exploration, QA, and security harness presets
-
-
PKM Assistant (#219) — personal knowledge management connectors:
-
src/pkm-connectors.tswith Obsidian/Logseq/Notion/Roam connection management -
GET /api/pkm,POST /api/pkm/connect,POST /api/pkm/syncendpoints
-
-
UI Pages & Enhancements — new pages and in-page widgets for all features:
- New Prompt Lab page with template CRUD, versioning, test run recording, and run history
- New PKM page with connection management, sync controls, and status indicators
- Settings page: compressor token-budget slider (#55), learned preferences inspector (#68), sandbox backend availability (#257), A2A protocol status (#251)
- Eval page: harness preset cards (#186), inline RAG evaluation with hit@1/recall/MRR scoring (#178)
- Navigation sidebar items for Prompt Lab and PKM with icon labels
- Fixed non-functional Delete/Trigger/Cancel/Logs buttons in the Jobs tab of the Automation page. The
renderJobCard()function usedJSON.stringify(job.id)to embed job IDs in onclick handlers, which wrapped IDs in double quotes that conflicted with the HTML attribute quoting, producing broken HTML. Changed toesc(job.id)with properly escaped template-literal single quotes.
-
A2A Protocol Bridge (
src/a2a/) — implements Google's Agent2Agent (A2A) v1.0 protocol for cross-framework agent interoperability. Cortex agents can now discover, delegate to, and collaborate with external agents built on LangGraph, CrewAI, AutoGen, or any A2A-compliant framework:-
A2A data model (
src/a2a/types.ts) — full v1.0 type system:AgentCard,Task,Message,Part,Artifact,TaskStatusUpdateEvent,TaskArtifactUpdateEvent,SendMessageRequest,StreamResponse,PushNotificationConfig, and all security scheme types (API key, OAuth2, OIDC, mTLS). -
A2A JSON-RPC server (
src/a2a/server.ts) — exposes Cortex agents as A2A endpoints handlingSendMessage,SendStreamingMessage(SSE),GetTask,ListTasks,CancelTask,GetAgentCard,GetExtendedAgentCard. Multi-turn context tracking with TTL-based eviction (1hr expiry, max 1000 tasks, max 500 contexts). JSON-RPC 2.0 request validation with proper error codes. -
A2A client (
src/a2a/client.ts) — delegates tasks to remote A2A agents withfetchAgentCard,sendMessage,sendStreamingMessage(SSE streaming parser),getTask,listTasks,cancelTask. AbortController-based timeouts on all outbound calls. -
A2A tool wrapper (
src/a2a/tool-wrapper.ts) — wraps remote A2A agents as CortexPrismToolobjects following themcp-adapter.tspattern. Agent card caching with automatic retry on failure. -
Agent card generator (
src/a2a/agent-card.ts) — generates A2A agent cards from Cortex tool definitions, converting tool schemas toAgentSkill[]entries with tags, examples, and default interface declarations. -
A2A REST endpoints (
src/server/router.ts) —GET /.well-known/agent-card.json(public, pre-auth),GET /api/a2a/agent-card.json,POST /a2a(JSON-RPC 2.0 gateway).
-
A2A data model (
-
MCP Gateway & Registry (
src/mcp-gateway/) — enterprise MCP server management with security and governance:-
Gateway (
src/mcp-gateway/gateway.ts) — token-bucket rate limiter with configurable requests/min, burst size, and automatic refill. HTTP health checking with tool-count comparison (healthy/degraded/unhealthy). Audit logging with 10K-entry ring buffer. Risk assessment for tool calls (critical: DROP DATABASE, rm -rf /; high: DROP TABLE, DELETE FROM, shutdown; medium: writes, deletes, shells). -
Server registry (
src/mcp-gateway/registry.ts) — CRUD operations for managed MCP servers with tag-based search, health status filtering, transport-type filtering, and status lifecycle tracking.
-
Gateway (
-
Memori: Persistent Agent Checkpointing (
src/memori/) — full agent state serialization for survival across restarts, crashes, and context window resets:-
Checkpoint data model (
src/memori/types.ts) —AgentCheckpointwith six sub-structures:CheckpointConversation(messages, prompt, context window),CheckpointMemory(episodic, semantic, graph entities, active skills),CheckpointTools(available tools, call history, pending approvals),CheckpointReasoning(current goal, sub-goals, completed goals, confidence, reflection notes),CheckpointWorkspace(working dir, open files, recent changes, git state),CheckpointMetadata(version, provider, model, tokens, cost). -
Checkpoint storage (
src/memori/store.ts) — SQLite persistence via the libSQLDbwrapper withsaveCheckpoint,loadCheckpoint,loadLatestCheckpoint,listCheckpoints(with session/agent/timerange/tag filters),deleteCheckpoint,deleteSessionCheckpoints,pruneOldCheckpoints(keep last N). Proper use ofdb.exec()/db.run()/db.get<T>()/db.all<T>()API. -
Checkpoint capture (
src/memori/checkpoint.ts) —captureCheckpoint()serializes full agent state from aCaptureContextinto anAgentCheckpoint. Dynamic version import fromsrc/config/version.ts. Available tools populated from the tool registry, not call history. Message and tool result truncation at 50K/10K character bounds. -
Checkpoint restore (
src/memori/restore.ts) —restoreCheckpoint()rehydrates agent state including messages, goals, open files, active skills, tool call history, and workspace info.buildResumePrompt()generates a structured resume context with goal, completed tasks, remaining sub-goals, reflection notes, recent conversation, working directory, and git state. -
Database migration (
src/db/migrations/032_memori_checkpoints.sql,src/db/migrate.ts) —memori_checkpointstable with indexed(session_id, turn_number DESC)and(agent_id, timestamp DESC).
-
Checkpoint data model (
-
Dynamic Tool Permission Grant (
src/security/dynamic-grant.ts, #62) — per-task tool permission evaluation replacing static allow/deny.evaluateToolPermission()returns one of four decisions:granted,granted_with_guardrails,denied,requires_approval. Risk profiles for 13 tool categories with default guardrails (readOnly, restrictedPaths, allowedDomains, maxDurationMs, requireConfirmation). Integrates with existing policy engine viacheckPolicy()and temporary grants viahasTemporaryGrant(). Lens audit logging for every grant decision. -
Tool Approval Workflow Engine (
src/security/approval-workflow.ts, #254) — structured approval pipeline for high-risk tool executions.submitForApproval()returns a Promise that resolves when a human reviewer approves or denies, or when the 5-minute timeout expires. Auto-approval for low-risk operations (configurable threshold). Webhook-based channel notifications with approve/deny URLs.approveRequest()/denyRequest()for programmatic resolution. Cleanup timer auto-expires stale requests every 30 seconds. Unified with #62 +#135 into the "Agentic Tool Governance" stack. -
Data Loss Prevention Guard (
src/security/dlp.ts, #137) — comprehensive sensitive data scanning with 22 built-in scanners covering: AWS access/secret keys, GitHub tokens/PATs, OpenAI/Anthropic/Google API keys, JWTs, private keys (RSA/EC/DSA), PEM certificates, database connection strings, Slack/Discord tokens, credit cards, SSNs, emails, IPs, password fields, API key headers, bearer tokens, and basic auth. Three action levels:monitor,redact,block. Non-overlapping match deduplication.dlpMiddleware()convenience function with fire-and-forget lens audit logging for blocked/redacted events. -
AI Guardrails & Content Safety (
src/security/guardrails.ts, #179) — pluggable content safety middleware with 5 built-in classifiers:prompt_injection(10 detection patterns for ignore-previous-instructions, jailbreak DAN/STAN, system override),pii_leakage,harmful_code(rm -rf /, DROP DATABASE, eval, os.system),excessive_length(>100K chars),shell_injection(curl|bash, eval, backtick command substitution).registerClassifier()/unregisterClassifier()API for custom classifiers. Operates on input and/or output stages. ReturnsGuardrailResultwith pass/block/warn per check. Factory functions (createPreMiddleware,createPostMiddleware) for pipeline hook integration. -
Session Isolation Boundary (
src/security/isolation.ts, #139) — multi-tenant data isolation between Cortex sessions. Three isolation modes:strict(no cross-project access),permissive(path-only isolation),shared(no restrictions). Path-based isolation with workspace root enforcement and allowlist overrides. Environment variable filtering with safe-var allowlist (PATH,HOME,USER, etc.). Cross-session memory access control with shared-session whitelist. Network access gating per mode. Violation recording with lens audit trail (1K ring buffer). -
Supply Chain Integrity Verifier (
src/plugins/supply-chain.ts, #138) — full verification pipeline extendingintegrity.ts: SHA-256 hash check against known-good hashes per package@version, blocked hash list, digital signature verification, author reputation scoring (0–100), blocked/allowed author lists, malware pattern scanning (6 default patterns: eval, child_process, rm -rf /, curl|sh, wget|sh). ConfigurableSupplyChainPolicywithblockSuspiciousmode.verifyPluginIntegrity()returns structuredIntegrityReportwith per-check pass/fail/severity. Lens audit logging for every verification. -
Dependency Supply Chain Guardian (
src/plugins/dependency-guardian.ts, #272) — continuous dependency monitoring across 6 ecosystems (npm, PyPI, Maven, Go, Cargo, NuGet). CVE database with severity-scored vulnerability records. Version range matching for affected-versions parsing (<=,>=,<,>, exact, wildcard). Risk score calculation (critical=40, high=25, medium=10, low=3 + outdated=10 + blocked-license=15). Blocked license enforcement (GPL-3.0, AGPL-3.0, BUSL-1.1, SSPL-1.0 by default).generateGuardianReport()for per-project vulnerability summaries. Auto-generated remediation suggestions with safe version bump recommendations.checkAllProjects()for bulk monitoring. Lens audit logging for every report generation. -
Skill Bus Orchestrator (
src/agent/skill-bus.ts, #54) — pub/sub event bus connecting plugins as composable skills.createSkillBinding()wires skills to event types with conditional matching (regex/value, cooldown periods, prerequisite checks). Five action types:invoke_skill,inject_context,emit_event,call_tool,notify. Listens ontool:post-execute,agent:turn-end,session:end,config:changeevents. Async handler execution with per-binding timeout and cooldown tracking. -
Context Window Compressor (
src/agent/context-compressor.ts, #55) — sliding-window conversation compression with importance-weighted retention.compressConversation()scores messages by recency, importance, decision/error/todo content, then retains high-scoring messages up to the target token budget.analyzeMessage()auto-detects decisions, errors, and todos from content patterns.buildCompressedContext()generates a structured digest with original vs. compressed token counts and percentage savings. -
Codebase Pilot: Token-Optimized Context (
src/codegraph/codebase-pilot.ts, #295) — AST-aware codebase optimization for LLM consumption.chunkCode()splits files into signatures, imports, and body chunks with token estimation.optimizeCodebase()ranks files by importance (src/ > root, main/index/config/types > tests), prunes private members, strips comments, and enforces token budgets.buildCodePilotPrompt()assembles the final context with per-file symbol lists and dependency graphs. Supports 20+ language extensions for detection. Configurable file allowlist/blocklist with exclude patterns for node_modules, .git, dist, build. -
Cross-Session Context Bridge (
src/memory/context-bridge.ts, #64) — retrieves relevant past-session context when starting new sessions.bridgeSessionContext()finds sessions matching the current project root and task description, scores by recency and keyword overlap, and aggregates common errors, key decisions, and active code areas.buildPreloadPrompt()generates a preload context for the system prompt with suggested focus areas and previously encountered issues. Configurable max sessions and max age (default 5 sessions, 30 days). -
User Preference Learner (
src/memory/preference-learner.ts, #68) — implicit preference model built from user corrections and overrides.observePreference()tracks 10 preference categories (coding_style, library_choice, naming_convention, risk_tolerance, communication_style, tool_preference, language_choice, testing_style, documentation_style, architecture_pattern). Confidence scoring with evidence-based reinforcement (match=+0.15, mismatch=×0.7).learnFromCorrection()auto-extracts preference signals from natural language corrections.buildPreferenceContext()generates system prompt injection with high-confidence (≥60%) preferences organized by category. -
AgentLint (
src/agent/agentlint.ts, #312) — automated auditing of agent configurations, plugin manifests, tool definitions, and system prompts with 33+ checks across 4 categories. Agent config checks: name length, description presence, system prompt validation, tool count, maxTurns range, provider validity, dangerous tool audit. Tool definition checks: name length, description quality (action verbs, ambiguous phrasing), parameter count and descriptions, capability declarations. Plugin manifest checks: version presence, capability scoping, WASM runtime warnings. System prompt checks: instruction clarity, conflicting directives, token efficiency. -
Responsible AI Auditor (
src/agent/responsible-ai.ts, #188) — bias, fairness, and safety auditing for agent outputs with 10 audit categories: demographic bias, gender bias, cultural bias, stereotypes, content safety, code safety, fairness, transparency, accountability, and privacy.auditAgentOutput()produces aResponsibleAIReportwith per-category severity scoring (pass/concern/violation), overall score (0-1), and actionable recommendations.auditBatch()for bulk output analysis. Lens audit logging for any concern or violation findings. Configurable stereotype, safety, and fairness pattern sets. -
A2A Bridge UI (
src/server/ui.ts,src/server/router.ts) — new sidebar navigation page with agent card display (name, version, streaming capability, skill count), interface endpoint list, and 3-column skills grid.GET /api/a2a/agent-card.jsonendpoint. -
MCP Gateway UI (
src/server/ui.ts,src/server/router.ts) — new Settings sub-tab for enterprise MCP server management. Health dashboard with server count, healthy/degraded breakdown, per-server status badges with tool counts.GET /api/mcp-gateway/serversendpoint with aggregated health stats. -
Memori Checkpointing UI (
src/server/ui.ts,src/server/router.ts) — new sidebar navigation page for persistent agent checkpoint viewing. Session ID filter, per-session turn listing with timestamp, token count badges, and goal snapshots.GET /api/memori/checkpointsendpoint with sessionId and limit query params. -
AgentLint UI (
src/server/ui.ts,src/server/router.ts) — new standalone audit page with Run Checks button. Summary cards (total checks, passed, warnings, errors), color-coded issue cards with severity badges and actionable suggestions.GET|POST /api/agentlint/checkendpoints. -
New lens event types (
src/db/lens.ts) — added 9 event types:dynamic_grant,approval_requested,approval_decision,dlp_blocked,dlp_redacted,guardrail_blocked,isolation_violation,supply_chain_verification,guardian_reportto theEventTypeunion for Tier 2 security feature audit logging. -
CLI commands for new features (
src/cli/a2a-cmd.ts,src/cli/memori-cmd.ts,src/cli/agentlint-cmd.ts,src/cli/mcp-gateway-cmd.ts,src/main.ts) —cortex a2a(card, skills),cortex memori(list, prune),cortex agentlint(check, config),cortex mcp-gateway(status, health). All registered in main.ts command tree. -
Pipeline hook integration (
src/pipeline/builtin.ts) — DLP Guard registered as@cortex/dlp-guardhook atpre-output/post-toolstages. Responsible AI Auditor registered as@cortex/responsible-aihook atpost-outputstage. Both use fire-and-forget patterns and never block the pipeline. -
Startup integration (
src/server/server.ts) — Skill Bus initialized at server start after plugin loading. Dependency Guardian scheduled for periodic checks every 6 hours. -
Supply chain verification on install (
src/plugins/manager.ts) —verifyPluginIntegrity()called before every plugin install. Plugins with statusblockedare rejected. Plugins withsuspiciousstatus log warnings but proceed. -
A2A auth fix (
src/server/router.ts) —POST /a2aJSON-RPC endpoint moved to public section (before auth middleware) for agent-to-agent interop without session cookies. -
Barrel import fixes (
src/server/router.ts,src/security/dynamic-grant.ts) — all internal module imports now route throughmod.tsbarrels. Removed 3 unused imports fromcontext-bridge.ts. -
Multi-system import system (
src/cli/import/) — new shared import module supporting three external agent systems:-
Hermes import (
cortex import hermes) — parses Hermes JSONL exports with session/message records and ShareGPTconversations[]format. Groups records bysession_id, writes messages into per-session databases, imports system prompts and model info as episodic memory. Auto-detects~/.hermes/. -
ZeroClaw import (
cortex import zeroclaw) — handles JSONL event-sourced transcripts andMEMORY_SNAPSHOT.md/MEMORY.mdmemory snapshot files. Transcript events are written as session messages;branch_summary/compactionevents become episodic memory; memory snapshots become semantic memory. Auto-detects~/.zeroclaw/. -
JSONL transcript import (
cortex import transcripts) — shared parser for OpenClaw/ZeroClaw lineage JSONL format with tree-structured events. -
API import routing (
POST /api/import) — the HTTP API now dispatches to the correct import module based ontypeparameter (hermes,zeroclaw,transcripts,openclaw,auto), returning structured results with session/message/memory/policy/error counts.
-
Hermes import (
-
CSP relaxation (
src/server/security-headers.ts) —connect-srcnow includeshttp:andhttps:schemes to allow API connections from the browser.script-srcincludeshttps://d3js.orgfor D3.js charts.img-srcincludesblob:for blob URLs. -
JetBrains Mono font quoting (
src/server/ui.ts) — allfont-family:"JetBrains Mono"and unquotedfont-family:JetBrains Monoinstances changed to single-quotedfont-family:'JetBrains Mono'for valid CSS. In single-quoted JavaScript strings embedded in template literals, single quotes are now double-escaped (\\'→\'in output) to prevent premature JS string termination. -
Missing
hideModal()function (src/server/ui.ts) — added thehideModal(id)function which was referenced in 7 modal Cancel buttononclickhandlers (MCP add, vault credential, vault import, remote deploy, workflow create, workflow run, eval run) but was never defined, causingReferenceErroron every Cancel click.
-
Chrome Bridge — dynamic MCP tool registration (
src/tools/mcp-adapter.ts,src/tools/registry.ts) — MCP-connected server tools can now be dynamically registered as first-class CortexPrism tools with automatic JSON Schema→ToolParamconversion and capability inference.ToolRegistrygainsregisterMcpConnection(),unregisterByPrefix()methods for lifecycle management. -
Chrome Bridge — connection manager (
src/tools/builtin/chrome_bridge_manager.ts) — manages the chrome-bridge MCP server subprocess lifecycle with auto-start on demand, graceful shutdown, 30-second health checks viaget_status, and exponential backoff reconnection (100ms–1600ms, max 5 retries). Module-level state tracks running status, retry count, and timer handles. -
Chrome Bridge — capability mapping (
src/tools/builtin/chrome_bridge_capabilities.ts) — curated capability assignments for all 60 chrome-bridge real-browser automation tools, mapping screenshot/interaction/network/Audit tools to CortexPrism'sToolCapabilitysystem (computer:screenshot,network:fetch,computer:keyboard, etc.). -
Chrome Bridge — CLI command (
src/cli/chrome_bridge.ts,src/main.ts) —cortex chrome-bridge [start|stop|status|tools]subcommands for managing the chrome-bridge MCP server from the command line, with colored output and config validation. -
Chrome Bridge — API endpoints (
src/server/router.ts) —GET /api/chrome-bridge/status(connection state, tool count, server info),POST /api/chrome-bridge/start,POST /api/chrome-bridge/stop, andGET /api/chrome-bridge/toolsREST endpoints follow the established MCP API pattern. -
Chrome Bridge — Web UI (
src/server/ui.ts) — dedicated "Chrome Bridge" page added as a Settings sub-tab with status cards (connection state, server info, tools registered, total calls, errors), a registered tools grid, and Quick Setup section. Added to the settings sub-navigation bar alongside Tools, MCP, and Vault. Start/Stop/Restart header buttons toggle visibility based on running state. -
Chrome Bridge — quick-connect (
src/server/ui.ts) —quickConnectChromeBridge()pre-fills the MCP Add Connection modal with chrome-bridge settings (name, transport, command, auto-connect) for one-click setup from the Chrome Bridge page. -
Chrome Bridge — config schema (
src/config/config.ts) —ChromeBridgeConfiginterface with fields forenabled,autoStart,autoRegisterTools,toolPrefix,serverPath,nodePath,port,token, andenv. Added as optionalchromeBridge?field onCortexConfigfor backward compatibility.
-
Chrome Bridge —
execute_jspolicy gate (src/security/validator.ts) —chrome_execute_jscalls require explicitcheckPolicy('tool', 'chrome_execute_js')allow before executing arbitrary JavaScript in the real browser, with denial logged to the lens events table. -
Chrome Bridge — upload file path validation (
src/security/validator.ts) —chrome_upload_filepaths are checked for../traversal and validated against path policy rules before being passed to the browser's file upload dialog. -
Chrome Bridge — save/download path validation (
src/security/validator.ts) —chrome_save_pageandchrome_manage_downloadspaths are stripped of../sequences and validated against path policy rules. -
Chrome Bridge — network rules modification gate (
src/security/validator.ts) —chrome_network_rulesactions other thanlist/clearrequirecheckPolicy('capability', 'network_rules_modify')approval. -
Chrome Bridge — log event offloading (
src/security/validator.ts) —chrome_execute_jssuccess-path event logging is fire-and-forget (.catch(() => {})) to avoid adding DB write latency to the critical tool execution path. -
Chrome Bridge — non-blocking server startup (
src/server/server.ts) — auto-start wrapped in(async () => {...})().catch(() => {})so chrome-bridge initialization failures never block the HTTP server from accepting connections.
-
Path traversal hardening — tar slip prevention (
src/plugins/install.ts) — extracted file paths from tar archives are now validated vianormalize()to stay within the destination directory, blocking malicious archives with../traversal entries (Zip Slip mitigation). -
Path traversal hardening — plugin name validation (
src/plugins/install.ts,src/plugins/update.ts) —pluginDirconstruction from remote marketplace or URL manifest names now validates the resolved path stays within the base plugins directory, preventing directory traversal via crafted plugin names. -
Path traversal hardening — upload and undo/redo (
src/server/router.ts) — file upload endpoint now validates the resolved upload path against the upload directory. Undo/redo operations normalize DB-sourced file paths before writing. -
DoS prevention — unbounded string hashing (
src/security/supervisor.ts) —hashString()now caps input to 10,000 characters to prevent exponential CPU exhaustion from attacker-controlled query strings. -
postMessage origin validation (
src/plugins/extensions/ui.ts) — both the TypeScriptonEventhandler and the generated panel JavaScript now validateMessageEvent.originagainst the window's origin, blocking cross-origin messages from untrusted sites. -
Dependency upgrade — AWS Bedrock SDK (
deno.json) —@aws-sdk/client-bedrock-runtimeupgraded from 3.750.0 to 3.1072.0, resolving 6 known vulnerabilities (4 HIGH, 2 MEDIUM) in transitive dependencyfast-xml-parseranduuid. -
Vault salt hardening (
src/security/vault.ts,src/config/paths.ts) — replaced static PBKDF2 salt with a per-installation random salt persisted tovault_salt, with legacy v1-to-v2 auto-migration on first decrypt. PBKDF2 iterations increased from 100,000 to 200,000. -
Config encryption (
src/config/config.ts) — provider API keys, GitHub tokens, Grafana auth tokens, and Langfuse secret keys are now encrypted with AES-256-GCM before writing tocortex.json, preventing plaintext credential exposure on disk. -
CORS hardening (
src/server/router.ts,src/config/config.ts) — replacedAccess-Control-Allow-Origin: *wildcard with configurable origin (defaults tosame-origin). AddedVary: OriginandAccess-Control-Max-Ageheaders. -
Security headers (
src/server/security-headers.ts,src/server/server.ts,src/server/router.ts) — addedContent-Security-Policy,X-Frame-Options: DENY,X-Content-Type-Options: nosniff,Referrer-Policy, andPermissions-Policyheaders to all HTTP responses. -
Rate limiting for auth endpoints (
src/server/router.ts) — login and password-setup endpoints now enforce per-IP rate limiting (10 requests per 60s window), returning 429 on excess. -
Request body size limit (
src/server/server.ts) — configurablemaxBodyBytes(default 10 MB) enforced viaContent-Lengthheader check, returning 413 on oversized requests. -
HTTPS/TLS support (
src/server/server.ts,src/config/config.ts) — server now accepts optionalcertFile/keyFileinserver.httpsconfig section to serve over TLS. -
Session cookie
Secureflag (src/server/auth.ts) — session cookies now include theSecureattribute to prevent transmission over cleartext HTTP. -
XSS sanitizer rewrite (
src/server/ui.ts) —sanitizeHtml()regex patterns fixed (were double-escaped and non-functional) and extended to strip<iframe>,<object>,<embed>,<style>,<link>,<meta>,<svg>,<form>,javascript:URIs, andexpression()calls in custom dashboard widgets. -
Vault key isolation (
src/tools/builtin/env_manager.ts) —CORTEX_VAULT_KEYremoved from the env_manager allow-list. Thegetoperation now enforces the same allow-list asset, preventing agents from reading arbitrary environment variables. -
SSRF protection (
src/security/ssrf.ts,src/tools/builtin/web_fetch.ts) —web_fetchtool now performs DNS resolution and blocks requests to private/internal IP ranges (127.0.0.0/8, 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 169.254.0.0/16, IPv6 link-local/unique-local), as well as known metadata hosts. -
Subprocess sandbox env filtering (
src/sandbox/executor.ts) — subprocess fallback mode no longer passes sensitive environment variables (containing PASSWORD, SECRET, TOKEN, KEY, VAULT) to executed code. -
Enhanced Docker sandbox (
src/sandbox/executor.ts,src/sandbox/agent-sandbox.ts) — TypeScript code execution in Docker mode now uses read-only root filesystem,noexec/nosuidtmpfs, and Deno permissions scoped to workspace (--allow-read=/workspace,--allow-write=/workspace). -
Approval gate for git_push (
src/tools/builtin/github/git_push.ts) —git_pushtool now requires user approval before committing and pushing, showing the commit message summary. -
Sub-agent tool escalation lock (
src/tools/builtin/sub_agent.ts) — thetoolsparameter now intersected against the sub-agent type's built-in allow-list, preventing sub-agents from requesting tools beyond their intended scope. -
API key query string removal (
src/server/router.ts,src/server/ui.ts) — the/api/providers/:kind/modelsendpoint now accepts API keys via POST body instead of URL query parameters, preventing secret leakage through server logs and browser history. -
postMessage target hardening (
src/plugins/extensions/ui.ts) —emit()now sends messages toglobalThis.location.origininstead of'*', preventing cross-origin data leaks from extension panels. -
WebSocket broadcast scoping (
src/server/ws.ts) —broadcast()now filters recipients by session ID, preventing cross-session event leakage (file changes, voice state) between unrelated clients. -
CSP and regex escape fix (
src/server/security-headers.ts,src/server/ui.ts) — relaxed Content-Security-Policy to allowhttps://d3js.org(D3.js),ws:/wss:(WebSocket), andblob:(image data). Fixed regex patterns insanitizeHtml()where backslash escapes were stripped by template literal processing.
-
Daemon health and restart handling (
src/server/server.ts,src/server/router.ts,src/services/manager.ts,src/server/ui.ts) — server startup now boots auto-start services, daemon health reports real supervisor and service-manager status, and the Daemons page restart dialog uses a restart-specific action label. -
Pluggable memory vector stores (
src/config/config.ts,src/memory/store.ts,src/memory/vector_backends.ts) — memory writes now mirror embeddings into built-in Qdrant, ChromaDB, and Pinecone adapters when configured, with SQLite remaining the authoritative fallback. -
Memory hardening pass (
src/server/router.ts,src/services/manager.ts,src/memory/privacy.ts,src/memory/consolidate.ts) — daemon restart now requires auth, auto-start reconciles runtime state on boot, vector-store mirroring is non-blocking, and retention/pruning now removes remote vector records too. -
Heuristics page refresh (
src/server/ui.ts,src/server/router.ts,src/memory/heuristics.ts) — the memory heuristics panel now shows real category cards, rule counts, and a one-click heuristic cycle runner instead of a static category list. -
Vector store settings (
src/server/ui.ts,src/server/router.ts,src/config/config.ts) — the memory page now includes a dedicated vector-store tab for Qdrant, ChromaDB, Pinecone, and SQLite fallback configuration. -
Memory page consolidation (
src/server/ui.ts) — combined health, reflections, and persistent notes into a single Overview tab, leaving Search and Graph as the primary exploration views. -
Session restore hardening (
src/server/ui.ts) — stale saved session ids now fail soft instead of spamming/resumeand/messages404s, and invalid session state is cleared from local storage. -
Settings subnav cleanup (
src/server/ui.ts) — removed the duplicate Policies entry from the shared settings/tools/MCP/vault sub-navigation so Policies now appears only in the main page navigation. -
Workflow history persistence (
src/workflow/engine.ts,src/server/router.ts) — workflow runs are now recorded to a local history log so the Workflows history tab shows actual executions such as health-check runs.
-
Stubbed workflow completion (
src/server/router.ts,src/server/ui.ts,src/server/ws.ts,src/hub/ws-node.ts,src/memory/store.ts,src/tools/builtin/memory_search.ts) — update checks now hit the correct endpoint, computer-use screenshots/actions are backed by persisted data, pending remote directives are listed from live state, import history is persisted, and memory search now respects session scope and approval flow. -
Model Quartermaster and supervisor selection (
src/model-quartermaster/arbiter.ts,src/model-quartermaster/mod.ts,src/security/supervisor.ts) — budget and health constraints now filter candidates, estimated quality is derived from active signals, and the supervisor can consult MQM when model selection is enabled. -
Workspace global path fix (
src/workspace/paths.ts) — global workspace paths now resolve to the current workspace root so the existing workspace-path contract matches the tests and CLI.
-
Editor & VCS default directories (
src/workspace/paths.ts,src/server/router.ts,src/cli/git-cmd.ts,src/server/ui.ts) — Editor and version control no longer default to the cortex install directory (Deno.cwd()).getGlobalWorkspaceDir()now returnsPATHS.workspacesDir(~/.cortex/data/workspaces). All git API endpoints and the CLI git command usegetGlobalWorkspaceDir()as fallback. Editor defaults to the first available agent workspace; VCS agent selector defaults to the first available agent.
Added — Agent Builder Overhaul: Multi-Select Dropdowns, 6 New Sub-Agent Types, Clone, & Enhanced Config
-
6 new built-in sub-agent types (
src/agent/sub-agent-types.ts) — Security Auditor (vulnerability assessment), Debugger (root cause analysis), Architect (system design & trade-offs), DevOps Engineer (infrastructure & CI/CD), Data Analyst (queries & insights), UI/UX Designer (accessible interfaces). Each with domain-specific system prompts and curated tool sets. -
Agent builder multi-select dropdowns (
src/server/ui.ts) — Replaced comma-separated text inputs for tools and tags with interactive multi-select dropdowns:-
Tools dropdown — Checkbox list grouped by prefix (
file_,web_,code_, etc.) with real-time search/filter, fetched dynamically from the tool registry - Tags dropdown — Common tag suggestions as checkboxes plus free-form custom tag input with Enter-key support; selected tags rendered as removable chips
- Both dropdowns close on outside click
-
Tools dropdown — Checkbox list grouped by prefix (
-
Icon picker (
src/server/ui.ts) — 30-emoji grid popup for visually identifying agents at a glance; triggers open on click, closes on outside click -
Agent category & version (
src/config/config.ts,src/server/ui.ts) — Newcategoryfield (general/specialist/assistant/creative/analytics/ops/custom with emoji labels in dropdown) andversionstring for agent classification. Displayed as badges on agent cards. -
Agent cloning (
src/agent/manager.ts,src/server/router.ts,src/cli/agent-cmd.ts,src/server/ui.ts) —cloneAgent()deep-copies an existing agent with a new ID. Exposed as:-
POST /api/agents/:id/cloneREST endpoint -
cortex agent clone <source-id> <new-name>CLI command - Clone button on each agent card in the UI
-
-
Tool registry API (
src/server/router.ts) — NewGET /api/tools/listendpoint returns all registered tool names from the global registry, powering the tools multi-select dropdown. -
Enhanced CLI options (
src/cli/agent-cmd.ts) —cortex agent createandupdatenow accept--icon,--category, and--versionflags.cortex agent showdisplays all new fields. -
Agent icon & category display (
src/server/ui.ts) — Agent cards now show the assigned emoji icon, version badge, and category badge at a glance.
-
Real-time sub-agent progress in chat UI — Sub-agent work is now displayed as live-streamed, collapsible cards in the main chat. Each sub-agent shows its type, task description, spinning progress indicator, streaming output, and completion status (DONE/FAILED). (
src/tools/types.ts,src/tools/builtin/sub_agent.ts,src/server/ui.ts,src/server/ws.ts) -
Tool progress streaming API — New
ToolProgressEventdiscriminated union andonProgresscallback onToolContextenables any tool to stream real-time progress events to the client during execution. (src/tools/types.ts) -
Scoring-based metacognition system — Replaced the linear if-else chain with a weighted scoring engine across four decision dimensions (delegate, parallelize, plan_with_rollback, direct). Added confidence scores, signal breakdown, expanded keyword sets, and more delegation triggers (multi-step code tasks, code+research combos, deep investigation). (
src/agent/metacog.ts) -
Stronger system prompt guidance — Meta-cognition prefix now uses directive language ("You MUST use the sub_agent tool"), includes available sub-agent type descriptions, and frames delegation as the recommended approach for complex tasks. (
src/agent/metacog.ts) -
Bulk skill deletion — New
deleteSkills()function supports mass deletion of skills in a single operation. The REST APIDELETE /api/skillsaccepts multiple?name=params or a JSON body{ names: [...] }. The UI bulk action bar now makes one HTTP call instead of N. Theskill_writetool exposes abulk_deleteoperation. All paths include proper dependency checking (co-deleted skills are excluded), LIKE wildcard escaping, and transaction safety. (src/memory/skills.ts,src/server/router.ts,src/server/ui.ts,src/tools/builtin/skill_write.ts)
-
9 built-in channel plugins — Full
ChannelPlugininterface implementations for all major communication platforms:-
DiscordChannelPlugin— Gateway v10 WebSocket, rich embeds, threads, file upload, reactions, rate limiting (50 req/s) -
SlackChannelPlugin— Socket Mode, Block Kit rich messages, interactive buttons, thread support, file uploads -
TelegramChannelPlugin— Long-polling + webhook modes, inline keyboards, multi-format file uploads, Markdown formatting -
TeamsChannelPlugin— Microsoft Graph API, Adaptive Cards, OAuth client credentials flow, SharePoint file upload -
MattermostChannelPlugin— WebSocket + REST v4, threads, reactions, typing indicators -
RocketChatChannelPlugin— DDP WebSocket protocol, threads, reactions, file uploads -
WhatsAppChannelPlugin— Cloud API integration, media upload (image/video/audio/doc), reaction support, webhook handling -
GoogleChatChannelPlugin— Chat API, service account JWT auth (RS256 via Web Crypto), card messages, threads -
LarkChannelPlugin— Tenant access token, interactive cards, multi-format uploads
-
-
Shared infrastructure (
src/channels/_shared/):-
WebSocketManager— Reusable WebSocket client with auto-reconnection, heartbeat management, message queuing (bounded at 1000) -
HttpClient— Typed HTTP client with retry logic, timeout handling, rate limit detection, FormData awareness -
RateLimiter— Token bucket algorithm with bounded queues (10000), per-platform configuration -
Logger— Structured logging utility with level filtering (trace/debug/info/warn/error)
-
-
Channel configuration store (
src/channels/store.ts) — Full CRUD for channel configs, vault-backed encrypted credential storage, helper to buildChannelConfigfrom records -
Database migrations:
-
028_channel_sessions.sql— Platform session tracking with platform/channel/user indexes -
029_channel_messages.sql— Bidirectional message mapping with direction tracking -
030_channels_config.sql— Channel configuration with vault refs and agent assignment
-
-
CLI channel management (
channelscommand):-
cortex channels— List all configured channels -
cortex channels add— Interactive setup for all 9 platforms with credential collection -
cortex channels start/stop <id>— Channel lifecycle management -
cortex channels test <id>— Connection validation without full activation -
cortex channels remove <id>— Secure deletion with confirmation
-
-
Documentation: Quick reference guide (
docs/channels-quick-reference.md) with setup instructions, troubleshooting, and performance tips for all platforms
-
Discord adapter refactored —
DiscordAdapterrenamed toDiscordChannelPlugin, implements fullChannelPlugininterface (9/9 methods), legacy adapter preserved asdiscord_legacy.ts
-
HttpClient FormData Content-Type bug — No longer adds
application/jsonheader to FormData requests (which broke file uploads) -
Telegram polling offset — Added
offsetparameter togetUpdatesto prevent duplicate message processing - Slack WebSocket reconnection — Disabled built-in WebSocketManager auto-reconnect for Slack (URLs expire, must fetch new URL)
- Bounded queues — WebSocketManager (1000) and RateLimiter (10000) now enforce maximum queue sizes to prevent memory exhaustion
- API error messages — Slack, Telegram, Lark, and WhatsApp now include API error details in thrown exceptions
- Message truncation warnings — Discord (2000), Slack (4000), Telegram (4096), WhatsApp (4096) now log warnings when messages are truncated
-
Observability connection tests — Replaced fake
setTimeoutstubs with real HTTP pings:-
POST /api/observability/test-otlp— pings configured OTLP endpoint and reports status -
POST /api/observability/test-langfuse— authenticates and pings Langfuse API health endpoint - UI buttons now show real connection results instead of hardcoded success messages
-
-
Sub-agent process management — Now queries real OS processes:
-
GET /api/processes/sub-agents— usespgrep+psto list running sub-agent-entry processes - Config save now persists timeout/retries via
PUT /api/config - UI displays live PID + command for each running sub-agent
-
-
CPL YAML import — Now parses actual YAML from the editor textarea:
- Extracts
name,kind,pattern,effectfrom YAML key-value pairs - Posts parsed values to
POST /api/policiesinstead of hardcoded placeholder
- Extracts
-
Prometheus metrics parser — Improved parsing and display:
- Handles label-bearing metrics (metric_name{labels} value)
- Separates gauges and counters (detects
_total,_count,_sumsuffixes) - Shows labels inline for better metric identification
-
Stub endpoints wired to real backends — 20+ previously empty stub endpoints now return real data:
- Router history/decisions: reads from QM
qm_patternsandqm_decisionstables - Metacognition history/decisions: queries
lens_eventsfor metacognition/reflection events - Supervisor cache: exposes live
decisionCacheentries via newgetDecisionCacheEntries()export - Supervisor history: queries
lens_eventsfor supervisor_decision/access_control events - Tool stats: reads from QM
qm_tool_statstable - Daemon logs: reads actual log files from
PATHS.dataDirandPATHS.logFile - Sandbox images: queries Docker CLI for real image list
- Router history/decisions: reads from QM
-
Config persistence wired — 7 PUT endpoints now persist to config instead of no-op:
- Voice TTS/STT/VAD: persists provider, voice, model, threshold to config
- Sandbox config: persists runtime, languages, timeout, memory/output limits to config
- Memory heuristics: triggers actual
runHeuristicCycle() - Memory embeddings: persists provider/model/dimensions to config
- Security supervisor: persists provider/model/cacheTTL to config
- Security classification: persists custom classification levels to config
- Computer config: persists resolution/dpi to config
-
Supervisor cache inspection — New
getDecisionCacheEntries()returns live cache state
- Security supervisor GET now reads from actual config instead of hardcoded defaults
- Phase 2 scaffolding: 6 new Phase-2 UI pages and 24 REST endpoints for Phase 2 navigation and data fetch.
- Phase 2 endpoints scaffolded at /api/phase2/page{n}/{content|config|state|stats} (six pages, 24 endpoints).
- Global left-nav persistence groundwork: ensure Tools & Policies appear and remain visible across page switches.
-
Security supervisor system — Three-layer LLM-based access control for sensitive data:
- Data classification: automatic sensitivity detection (SECRET/SENSITIVE/NORMAL/PUBLIC)
- LLM supervisor: fast model selection (Gemini 2.0 Flash, GPT-4o Mini) with decision caching
- Human approval: CLI and Web UI approval flows with temporary grants (1-hour TTL)
-
Data sensitivity metadata — New
sensitivitycolumns in all databases:-
cortex.db: sessions, agents -
memory.db: episodic_memory, semantic_memory, reflection_memory, graph_entities -
lens.db: lens_events (audit logs) - One-time backfill migration classifies all existing data
-
-
Sensitivity classification engine — Pattern-based detection:
- SECRET patterns: passwords, API keys, tokens, SSNs, credit cards, private keys
- SENSITIVE patterns: email, phone, addresses, confidential markers
- Default security-first approach (non-empty = sensitive)
-
Consolidated tool registration — Eliminated 125+ lines of duplication across 4 entry points:
- Centralized
registerAllBuiltins()insrc/tools/registry.ts - 43 builtin tools grouped by category
- Applied to ws.ts, cli/chat.ts, service-entry.ts, sub-agent-entry.ts
- Centralized
-
memory_search tool — Agent memory search with automatic security supervision:
- Search across episodic, semantic, reflection, and graph memory tiers
- Hybrid search: keyword matching + vector similarity (embedding-powered)
- Time-decay scoring (episodic 14-day, semantic 30-day half-lives)
- Tier filtering and optional session scoping
- Automatic sensitivity classification on results
- Security supervisor integration for SENSITIVE/SECRET hits
-
db_query tool — Read-only database querying with security supervision:
- Query cortex/memory/lens/plugins/session databases
- Strict read-only enforcement (blocks INSERT, UPDATE, DELETE, DROP, ALTER, CREATE)
- Multiple output formats: table (ASCII), JSON, CSV
- Automatic sensitivity classification and audit trail
-
json_query tool — JSONPath-like expression support (
$.property, $ .array[0], $.array[*])- Operations: read, count, filter, set, delete; recursive descent with $.**
-
regex_utils tool — Regular expression utilities with capture group support
- Operations: match, replace, test, split, exec; flags: g, i, m, s
-
env_manager tool — Environment variable management with whitelist-based set security
-
code_snippet tool — Code block extraction from markdown with line numbers and language detection
-
structured_extract tool — LLM-powered entity/relationship extraction with JSON-Schema validation
- Multi-format input (text, HTML, JSON), pattern-based extraction, streaming JSONL output
-
browser tool — Headless browser automation with security supervision:
- Playwright-powered: navigate, click, type, screenshot, snapshot, evaluate, wait
- Base64 PNG screenshot output, accessibility snapshots, configurable timeout (30s)
-
docs_search tool — Official library documentation search via Context7
- 25+ libraries, version-specific docs, 24-hour result caching, fuzzy library name resolution
-
image_analyze tool — Multimodal image analysis via 18+ LLM providers
- Local files, data URLs, base64; detail level control, MIME type detection
-
schedule tool — Cron-based job scheduling with full lifecycle: create/list/cancel/status/due
-
Enhanced file_diff tool — Unified diff format, lookahead matching, configurable output formats
Five implementation phases took the SPA from partial to full coverage across all backend systems. The sidebar was restructured from 8 sections / 37 items down to 5 sections / 25 items.
New Management Pages (14):
| Page | Description |
|---|---|
| Codegraph | D3.js interactive force-directed graph, symbol search, impact analysis, path tracer |
| Workflows | Visual workflow designer with JSON editor, run history, approval queue |
| Eval Runner | Suite browser, run configuration, results dashboard, baselines, regression diff |
| MCP Server | Model Context Protocol connections, tool browser, server start/stop |
| Vault | AES-256-GCM credential store, table view, audit log, export/import |
| Computer Use | Screenshot gallery, action log, display configuration |
| Remote Agents | Distributed agent deployment with status badges, directive history |
| Daemon Health | 5 process cards, IPC health pings, log tails, restart controls, auto-refresh |
| Tools | Tool registry catalog with parameter schemas, capability badges, toggles |
| Metacognition | Task assessment tester, decision distribution, assessment history |
Page Extensions (18 tabs/sections added to existing pages):
| Page | Extensions |
|---|---|
| Settings | Providers comparison, Router dashboard, Security Supervisor config, Metrics, Observability |
| Memory | Privacy (PII redaction, retention), Heuristics (12 auto-categorization rules), Embeddings |
| Agents | Sub-Agent Types (5 type cards with tool allow-lists, maxTurns), Process Management |
| Code Runner | Sandbox Config (runtime, languages, Docker/gVisor status) |
| Policies | Classification (4-level sensitivity rules, pattern list, content tester), CPL YAML editor |
| Skills | Export/Merge/Dependencies/Health actions |
| Editor | Workspace History tab |
| Quartermaster | Config button |
| Automation | Webhook Test-Fire button |
| VCS | Git Diff viewer |
Orphaned Endpoints Connected (10): Skills export/merge/dependencies/health, workspace history, QM/MQM config, voice providers, webhook test-fire, git diff
Sidebar Restructure: 8 sections → 5 sections, 37 items → 25 items. Merged 8 standalone pages into 5 tabbed anchor pages with persistent global sub-navigation bar. Anchors: Infrastructure (Services/Nodes/Daemons), Automation (Triggers/Workflows/Eval/Jobs), Tools & MCP, Security (Policies/Vault), Remote Access (Remote/Computer).
+90 REST API endpoints across codegraph, workflows, eval, MCP, vault, computer, remote, daemons, import/export, update, reflection, providers, router, tools, memory, metacognition, sub-agents, voice, sandbox, supervisor, and classification.
Infrastructure: D3.js v7 CDN, in-memory storage for eval/workflow engines, injectSubNav()
global tab bar system, page extension framework with DOM-safe injection.
-
Route ordering: Moved
/api/agents/sub-typesbefore wildcard/api/agents/:idregex match to prevent 404s (static routes must precede regex wildcards in the if-else chain) -
Sub-nav persistence: Replaced page-local sub-nav bars with a single global
#global-subnavbar outside page divs, preventing tabs from disappearing on page switches -
Memory extension tabs:
switchMemExtTabnow properly hides all 5 main memory panes when showing Privacy/Heuristics/Embeddings content; main memory tabs hide extension content -
Agents/Code Runner/Policies tabs: Replaced fragile DOM selectors (
div:last-of-type,[style*="overflow-y:auto"]) with stable element IDs and stored references -
JS escaping: Fixed 4 instances of literal
\nin inline strings rendering as actual newlines in the output HTML, breaking browser JavaScript parsing -
Orphan page cleanup: Removed unreachable
status,importexport,update,reflection, andvoicepage divs and JS code after they were removed from the PAGES array
- All sensitive data access now requires LLM supervisor review or human approval
- Agents cannot access sensitive memory, audit logs, or databases without justification
- Temporary grants prevent repeated approval prompts for same operation
- Supervisor decisions cached per session (1-hour TTL) to reduce costs
- New
docs/SECURITY_SUPERVISOR.md— architecture guide with diagrams - Updated
docs/TOOLS_CONFIGURATION.md— security model section - Updated
README.mdwith full Web UI table and REST API reference - 14 comprehensive unit tests for classification and approval systems
-
Code intelligence system — New
src/codegraph/module with tree-sitter WASM parser for 14+ languages. AST extraction, call resolution, complexity estimation, and code graph storage inmemory.db. -
Code graph schema — 14 node labels (CodeProject, CodeFile, CodeFunction, CodeClass, CodeInterface, etc.), 18 edge types (CALLS, IMPORTS, DEFINES, IMPLEMENTS, INHERITS, HTTP_CALLS, ASYNC_CALLS, DECORATES, etc.). Full-text search via FTS5 on code_nodes. Supports all tree-sitter languages with lazy-loading from CDN.
-
6 code intelligence tools — Auto-exposed via MCP server and WebSocket handler:
-
code_index: Full repository indexing with incremental sync, file change detection, and chunked bulk insert -
code_search_symbol: FTS5-backed symbol search across projects -
code_trace_path: Bidirectional call graph traversal (inbound/outbound) with depth limits and hotspot analysis -
code_get_architecture: System architecture diagram extraction (layers, modules, dependencies) -
code_analyze_impact: Blast radius analysis (callers, callees, dead code detection, complexity) -
code_list_projects: Project registry with language stats and node/edge counts
-
-
Codegraph resolver — 6-strategy call target resolution: exact symbol match, method on class, wildcard import, relative import path, type inference, fallback search. Supports JS/TS/Python/Go/Rust/Java/Kotlin import syntax.
-
Batch-aware codegraph sync — Incremental indexing pipeline with file hashing, bounded directory walk (200K file limit, 100 depth), and BFS-batched query execution (2 queries/level instead of N+1). WASM integrity validation for tree-sitter.
- Migration SQL parsing — Collapsed multi-line SQL statements to single lines to avoid parser failures during migration application. Removed FTS5 triggers to simplify initial deployment.
-
Embedding-based skill retrieval —
findMatchingSkills()now accepts anEmbeddingProvider; ranks skills via cosine similarity against precomputed embeddings with lexical fallback.buildSkillEmbeddingIndex()precomputes embeddings from skill name + description + content. Embedder is passed through from the agent loop and server startup. -
Skill deduplication —
findSimilarSkills()detects near-duplicate skills via embedding similarity.mergeSkill()combines steps, descriptions, and content from two skills, archives the source, and bumps the target version.deduplicateExtractedSkill()auto-runs after each LLM extraction session. -
Skill lifecycle management — 6-state lifecycle:
candidate → verified → released → degraded → deprecated → archived. Built-in skills default toreleased, LLM-extracted skills start ascandidate.promoteSkill()transitions up,deprecateSkill()/degradeSkill()transition down. Deprecated/archived skills are excluded from agent matching and the available list. -
Skill health system —
getSkillHealth()computes a composite score from utility (usage + success), redundancy (duplicate penalty), freshness (time-decay from last use), and failure risk (1 − success rate).runSkillHealthMaintenance()auto-deprecates stale/low-quality LLM skills. -
Quality signals —
utility_score(Bayesian rolling average with success bonus),freshness(30-day half-life decay, computed bycomputeSkillFreshness()),token_cost. All updated onrecordSkillSuccess()/recordSkillFailure(). -
Security trust tiering — 4-tier system on
trust_tiercolumn: 1 (untrusted/LLM-extracted), 2 (provisional), 3 (trusted/human-authored), 4 (vetted/built-in).filterReliableSkills()gates agent exposure based on tier + success rate. Trust stars rendered in system prompt and web UI. -
Skill dependency graph —
depends_onandconflicts_withcolumns (JSON arrays of skill names).getSkillDependents()/getSkillDependencies()traverse the graph.deleteSkill()blocks deletion if other skills depend on the target. -
Hierarchical skill organization —
parent_skill_idcolumn enables skill trees. Built-in skills can declare parent relationships viaBuiltinSkill.parentSkillId. -
Improved LLM skill extraction — Prompt upgraded with few-shot examples (good extraction vs. non-reusable pattern), validation rules, prerequisite capture, and expected outcomes. Max tokens increased from 512 → 1024. Steps now require tool name and params placeholders.
-
Skill evaluation benchmark — New
tests/skills_eval_test.tswith 13 tests covering: CRUD, lifecycle promotion, lexical search, reliability filtering, merge, dependencies, health scores, freshness computation, health maintenance, stats metrics, extraction rejection/validity, and lifecycle-filtered listing. -
Server API endpoints —
POST /api/skills/merge,POST /api/skills/deprecate,POST /api/skills/promote,GET /api/skills/dependencies?name=,GET /api/skills/health?name=. ExistingGET /api/skillsnow supports?lifecycle=filter. -
Skill management UI — Lifecycle badges (color-coded by state), trust tier stars (★☆☆☆ to ★★★★), utility/freshness scores in stats bar. Health check button runs maintenance. Promote/deprecate buttons per skill. Lifecycle filter tabs (Released, Deprecated). All rendered in both card and list views.
-
skill_writetool — Expanded from 3 operations to 8:create,update,delete,merge,promote,deprecate,dependents,dependencies. New params:lifecycle,trust_tier,depends_on,conflicts_with,parent_skill_id,reason,source_name. -
skill_readtool — Addedlifecyclefilter parameter; listings now show trust stars and lifecycle badges. -
load_skilltool — Output now includes lifecycle, trust tier, utility score, and freshness. Auto-recordslast_used_aton load. -
Agent loop — Skill matching delegates to embedding-based retrieval when embedder is available. Uses
filterReliableSkills()instead of inline filtering. Auto-deduplicates after LLM extraction. -
Startup —
registerBuiltinSkills()accepts optionalEmbeddingProvider; builds embedding index as fire-and-forget after registration. Server startup passes config-built embedder. -
BuiltinSkillinterface — AddedparentSkillId,dependsOn,conflictsWithoptional fields. -
DB migration 023 — Adds 14 columns + 5 indexes to
procedural_memory.
- Extensions page — Redesigned Installed and Discover tabs from list layout to responsive card grid with colored icon headers, expandable readme support, and richer metadata display.
-
Persistent memory file formatting — Fixed
appendToMemoryFile()insertion point calculation;sectionBody.slice(lastBullet).indexOf('\\n')always returned 0, causing new entries to be inserted before the last bullet instead of after it. -
Chat auto-scroll —
appendBubble()and chunk handler now userequestAnimationFramefor scroll-to-bottom to ensure DOM layout is complete before scrolling.restoreSession()adds a delayed secondary scroll for mid-conversation resume.
-
Session titles — Sessions now auto-generate a title from the first 60 characters of the first
user message. Added
updateSessionName()in sessions DB layer,PATCH /api/sessions/:idAPI endpoint, and title display in chat header, sidebar, and sessions list. -
Session archiving — Added archive and restore buttons to the sessions list. Archived sessions
are shown with reduced opacity. Archive API already existed (
POST /api/sessions/:id/archive); UI now exposes it.
-
Services/agents page loading — Added
agents: loadAgentsandservices: loadServicestoshowPage()loaders so pages render on initial navigation instead of requiring a manual refresh click. -
Skills tag filtering — Replaced flat button pills with a
<select>dropdown filter for skill tags to declutter the toolbar when many tags are present. -
Policy management — Added
enabledcolumn topolicy_rules(migration 022), enable/disable toggle checkboxes, inline editing of pattern and reason, and an add-policy form in the Policies page. New API endpoints:PATCH/DELETE /api/policies/:id,PUT /api/policies/:id/toggle,POST /api/policies. - Discover tab filtering — Marketplace Discover tab now hides plugins and agents that are already installed, keeping the page clean and focused on new content.
-
Voice CLI subcommands — Rewrote
voicecommand to use correct Cliffy subcommand API pattern.voice enable,voice disable,voice status,voice set-voice, andvoice set-speedall now execute correctly instead of showing help text. -
OpenAI streaming parameters — Streaming calls now correctly pass
max_tokens,temperature, andtop_p; previously they were dropped causing unconstrained token generation. -
o-series model support — Added o1/o3 detection in both
openai.tsandopenai-compatible.ts; reasoning models now usemax_completion_tokensinstead ofmax_tokensand omit unsupportedtemperature/top_pparameters. -
Google Gemini generation config —
temperature,topP, andmaxOutputTokensare now properly passed togenerateContent()andgenerateContentStream(), fixing silent parameter drops. -
Tool registration —
file_copyandfile_movetools are now registered in all three tool maps (chat CLI, WebSocket server, sub-agent entry), making them callable. -
File undo/redo — Undo now uses
resolveWorkspacePath()for path validation, supports restore of rename and delete operations, and correctly parsesfile_rename.tslog format. Redo now correctly restores the original edit content rather than re-applying the undo.
-
Enhanced tools registered —
file_read_enhanced,web_search_enhanced, andweb_fetch_enhancedare now registered in the chat CLI and WebSocket server tool maps. -
Web domain policy validation — Extended domain policy checks to cover
web_fetch,firecrawl,brave_search,tavily_search,serpapi_search, and all enhanced web tools. Node directive validation also now includes web domain policy checks. -
FILE_TOOLS set — Added
file_copy,file_move,file_undo,file_redo, andfile_globto the path-validation set in bothvalidateToolCallandvalidateNodeDirective. -
WASM plugin loading — WASM plugins are no longer skipped in
loadAllPlugins. The loader now correctly dispatches toloadWasmPlugin()fortype: 'wasm'plugins.
-
AbortSignal propagation — Added
AbortSignalsupport toopenai,anthropic,cohere, andollamaproviders for request cancellation and timeout enforcement. -
Vault enforcement —
usage_limit,expires_at, andallowed_agentsare now checked before credential decryption. Access logging is now fire-and-forget to prevent logging failures from breaking credential retrieval. -
Cohere provider — Added
top_pparameter support with!= nullguard, wrappedtemperaturein null guard for both complete and stream, added content block coercion for multimodal inputs, and wrapped stream JSON parsing in try/catch for malformed NDJSON lines. -
Ollama provider — Added
top_pparameter support, fixed inconsistent default values betweencomplete()andstream()(both now usetemperature: 0.7,num_predict: 4096), removed duplicateOllamaResponseinterface, and wrapped stream JSON parsing in try/catch. -
Bedrock provider — Added
topPtoinferenceConfigand null guards onmaxTokensandtemperatureparameters. -
Hardcoded versions — Replaced hardcoded
'0.20.0'version strings in MCP server and remote agent withgetVersion()fromsrc/config/version.ts(reads VERSION file). -
Service log capture —
getServiceLogs()now reads last 200 lines fromstderr.loginstead of returning an empty string. -
Lens metrics — Added
writeMetric(),getMetrics(), andgetSessionCostTotal()store functions for thelens_metricstable. -
Router error logging — Empty catch blocks in
buildCascadeRouterandbuildThresholdRouternow log warnings with the error message. -
WASM host functions — Implemented
http_request(fetch with timeout),get_config(env vars), andset_state/get_state(in-memory Map). WASM tool execution now correctly encodes and passes the tool name toplugin_execute_tool. -
OpenClaw migration —
openclaw-migrate.tsis now wired into theimportcommand as afilessubcommand instead of being dead code.
-
FTS query sanitization — Added
sanitizeFtsQuery()helper to strip FTS5 special characters from search queries in both episodic and semantic memory search. -
Memory retention — Retention enforcement now covers
semantic_memoryandreflection_memoryin addition toepisodic_memory. -
Eval runner —
toolCallsMadeis now tracked viaAgentTurnResultinstead of being hardcoded to 0. -
Tool result formatting —
formatToolResultsnow emitstruncatedandoutputLengthattributes in<tool_result>XML tags. -
File patch cleanup — Temp
.patchfiles are now cleaned up in a try/finally block to prevent leaks on process crash. -
Skill write — Step
descriptionnow correctly reads fromstep.descriptionwith fallback tostep.action. -
Speak/Listen tools — Added
['network:fetch']capabilities to both tools. -
Miscellaneous — Removed duplicate
web_fetchtool entry in WebSocket server tool map; fixed inconsistentOllamaResponseinterface duplication; added null guards on Bedrock inference config parameters; placedafterTextvariable outside try block infile_patchto fix scoping.
- AGENTS.md — Updated LLM provider count from 12 to 24.
-
Consolidated settings navigation — reduced 11 settings tabs to 4 grouped tabs:
- General — Agent behavior, user profile, UI & appearance, web authentication
- AI & Models — LLM providers, model routing (RouteLLM)
- Tools & Extensions — Voice & TTS, tool API keys, computer use (GUI automation)
- System — Automatic updates, plugin updates, logging, OTLP, Grafana, Langfuse
-
Consolidated sidebar navigation — reduced 7 nav sections to 5 with smarter categorization:
- Core — Dashboard, Chat, Sessions (moved from Management)
- Intelligence — Memory, Skills, Soul (moved from Configuration), Activity
- Development — Editor, Code Runner, Version Control (merged Git+GitHub), Projects (moved from Management)
- Infrastructure — Agents, Services, Nodes, Jobs, Automation (merged Hooks+Triggers), Channels
- System — Settings, Policies, Extensions (merged Plugins+Marketplace), Analytics, Quartermaster
-
Merged related pages with internal tab navigation:
- Git + GitHub → Version Control (Local / Remote tabs)
- Hooks + Triggers → Automation (Hooks / Triggers tabs)
- Plugins + Marketplace → Extensions (Installed / Discover tabs)
-
Fixed duplicate Plugin Panels section in sidebar navigation
-
Computer Use Tool (
computer) — enables AI agents to interact with graphical user interfaces through screenshots, mouse control, and keyboard input; supports 15 different actions including screenshot capture, clicking (left/right/middle/double/triple), mouse movement and dragging, text typing, keyboard shortcuts, scrolling, and wait operations -
Virtual Display Management (
src/computer-use/display.ts) — automatic X11 virtual display (Xvfb) lifecycle management with display number allocation to support multiple concurrent sessions, health checking, and graceful shutdown -
Screenshot Capture (
src/computer-use/screenshot.ts) — flexible screenshot capture supporting multiple tools (scrot, ImageMagick, xwd) with automatic fallback, PNG and JPEG format support, configurable quality settings, and smart file storage to avoid tool output truncation -
Mouse Control (
src/computer-use/mouse.ts) — comprehensive mouse automation via xdotool including precise coordinate-based movement, all click types, click-and-drag operations, scrolling in all directions, and cursor position tracking -
Keyboard Control (
src/computer-use/keyboard.ts) — full keyboard automation supporting text typing with configurable delays, individual key presses, key combinations (ctrl+s, alt+tab, etc.), key holding for specified durations, and normalized key name mapping for cross-platform compatibility -
Action Executor (
src/computer-use/executor.ts) — orchestrates display, mouse, and keyboard controllers with configurable timeouts, error handling, screenshot directory management, and action validation - Security Integration — computer use actions integrated with policy validation system, approval gates requiring user confirmation for each action, sensitive data detection (passwords, API keys) with automatic blocking, and comprehensive audit logging via Cortex Lens
- Computer Use Settings UI — dedicated settings tab in web UI for configuring display resolution (640-3840 x 480-2160), runtime selection (Native Xvfb or Docker), screenshot format and quality, action timeouts, approval requirements, and Docker image configuration
-
Docker Support (
docker/computer-use.Dockerfile) — pre-built Docker image with Ubuntu 22.04, Xvfb, xdotool, scrot, XFCE desktop environment, Firefox, Chromium, LibreOffice, and automatic Xvfb startup for isolated GUI automation - Configuration System — computer use configuration stored in main config file with enable/disable toggle, all settings persisted across restarts, and tool automatically disabled when not configured
-
Tool Capabilities — added four new capability types:
computer:screenshot,computer:mouse,computer:keyboard, andcomputer:controlfor granular permission control -
Policy Support — added
computerpolicy kind to security system for fine-grained access control of computer use actions -
Documentation (
docs/computer-use/README.md) — comprehensive guide covering requirements, installation instructions for multiple Linux distributions, usage examples, available actions with parameters, common key names, security features, troubleshooting guide, example workflows (web research, document editing), and architecture overview -
Tests (
tests/computer-use/display_test.ts) — automated tests for display management including availability checks, lifecycle management, and multi-display support
Requirements (Linux):
-
xvfb— X Virtual Frame Buffer for virtual displays -
xdotool— Command-line X11 automation for mouse and keyboard -
scrot— Screenshot utility (or ImageMagick as fallback) -
x11-utils— X11 utilities
Installation:
# Debian/Ubuntu
sudo apt-get install xvfb xdotool scrot x11-utils
# Fedora/RHEL
sudo dnf install xorg-x11-server-Xvfb xdotool scrot xorg-x11-utils
# Arch Linux
sudo pacman -S xorg-server-xvfb xdotool scrot xorg-utilsAvailable Actions:
-
screenshot— capture current display state -
left_click,right_click,middle_click— click at coordinates -
double_click,triple_click— multi-click operations -
mouse_move— move cursor to coordinates -
left_click_drag— drag from one point to another -
left_mouse_down,left_mouse_up— fine-grained click control -
type— type text string -
key— press key or key combination (e.g., "ctrl+s", "alt+tab") -
hold_key— hold key for specified duration -
scroll— scroll in any direction with configurable amount -
wait— pause execution between actions
Security Features:
- All actions require user approval by default (configurable)
- Actions validated against security policies before execution
- Sensitive data detection prevents typing passwords/API keys
- All operations logged in Cortex Lens audit system
- Runs in isolated virtual display (not host display)
- No direct filesystem access (use separate file tools)
- Tools & APIs Settings Tab — new settings tab in web UI for managing tool API keys and configurations without editing config files or using CLI
-
Tool Configuration API — REST endpoints (
GET/PUT/DELETE /api/tools/config) for managing tool settings programmatically - Vault Integration — tool API keys stored securely in encrypted vault (AES-256-GCM) with automatic fallback to environment variables
- Visual Tool Management — see configured vs. available tools, add/edit/remove API keys through intuitive UI
- Supported Tools — Brave Search, Tavily Search, Firecrawl (API key + self-hosted URL), SerpAPI configuration
-
Masked Key Display — configured keys shown with first 6 and last 4 characters visible (e.g.,
sk-abc...xyz)
-
Web Search Cache System (
src/tools/builtin/web/cache.ts) — persistent caching for web search results with TTL (1 hour default), automatic cleanup, and cache size management (max 1000 entries) -
Enhanced Web Search (
web_search_enhanced) — multi-provider search with intelligent fallback (Brave → Tavily → DuckDuckGo), automatic retry on failure (up to 2 attempts), result caching, and provider preference support -
Enhanced Web Fetch (
web_fetch_enhanced) — improved content extraction with HTML-to-Markdown conversion, better entity decoding, automatic retry with exponential backoff (up to 3 attempts), improved error messages with actionable suggestions, and more realistic User-Agent headers
-
File Copy Tool (
file_copy) — copy files or directories to new locations with overwrite protection, git integration, automatic parent directory creation, and edit logging -
File Move Tool (
file_move) — move or rename files/directories efficiently with atomic operations, overwrite protection, git tracking for both source and destination, and edit logging -
File Diff Tool (
file_diff) — compare two files with unified diff format showing additions/deletions, configurable context lines (default 3), change statistics, and context collapsing for readability
-
Enhanced File Read (
file_read_enhanced) — advanced file reader with automatic language detection (40+ languages including TypeScript, Python, Rust, Go, etc.), smart binary file detection (by extension and content analysis), large file warnings (>1MB) with chunked reading suggestions, improved metadata display (file size, line count, language), and better error handling with specific error codes
-
Tool call JSON leaking during streaming (
src/server/ws.ts) — tool calls split across multiple WebSocket chunks now properly buffered and stripped; prevents incomplete JSON fragments like{"tool":"web_search"...from appearing in UI during live streaming before page refresh
-
Tool registration — computer tool now registered in all entry points: CLI chat
(
src/cli/chat.ts), WebSocket server (src/server/ws.ts), service processes (src/processes/service-entry.ts), and sub-agent processes (src/processes/sub-agent-entry.ts) -
Import maps (
deno.json) — added@std/encoding/base64dependency for screenshot base64 encoding with proper submodule mapping for Deno's module resolution -
Security policy system — extended
PolicyKindtype to includecomputerfor fine-grained access control of computer use actions; all computer use operations now flow through policy validation with automatic sensitive data detection -
Configuration schema — extended
CortexConfiginterface withcomputerUsesettings including enable/disable toggle, display resolution, runtime selection, screenshot options, and approval requirements; all settings persisted in main config file - All tools now include structured
errorInfowith error codes (INVALID_URL,HTTP_ERROR,TIMEOUT, etc.), retry flags, suggested actions, and context data - Consistent retry logic across network-dependent tools (2-3 attempts with exponential backoff and configurable delays)
- Better error messages throughout the tool system with specific guidance on resolution
- Enhanced content extraction in web fetch with improved HTML stripping and markdown formatting
- Workspace tool exports updated to include new file management tools
- Settings UI now includes Tools & APIs tab and Computer Use tab for easy configuration management
- WebSocket chunk handling now uses buffering to prevent split tool calls from leaking through
-
Reasoning inspection panel (
src/server/ui.ts) — new🔬 Reasoningtoggle button appears during agent operations when tools are used; clicking reveals a collapsible panel showing raw tool calls, execution results, and agent decision-making; panel auto-hides when response completes for a clean default UX -
Real-time incremental streaming (
src/agent/loop.ts) — chunks now emit to client as they arrive during buffered streaming mode, eliminating delays from full-response buffering; maintains ability to parse tool calls while providing live UI updates for multi-round tool execution flows
-
Logger registry (
src/utils/logger.ts) — configurable logging system with pluggable transports (console, file, OTLP), per-namespace log levels, and structured JSON output -
File transport — warning-level and above written to
~/.cortex/data/cortex.logby default; all levels written when verbose mode configured -
cortex logCLI (src/cli/log-cmd.ts) —show,tail,clear,set-level,path, andstatussubcommands for log management from the terminal - Logging settings UI — new Logging tab in Settings with controls for level (debug/trace), file logging toggle, rotation settings, OTLP endpoint, Grafana dashboard link, and Langfuse
-
Langfuse tracing (
src/observability/langfuse.ts) — trace per agent turn, generation span per LLM round with token usage metrics, span per tool call with input/output capture -
OTLP export (
src/observability/otel.ts) — OpenTelemetry trace/span export compatible with Grafana Tempo, Jaeger, and other OTLP receivers -
Settings persistence —
PUT /api/configapplies logging configuration changes live without requiring a server restart -
Observability docs (
docs/observability.md) — comprehensive guide covering log levels, configuration, CLI commands, namespaces, OTLP setup, and Langfuse integration
-
Configurable model pricing — every provider now accepts an optional
pricingconfig map that overrides built-in defaults; pricing visible incortex models show; all 22 providers wired -
Provider context windows (
src/llm/router.ts) —PROVIDER_DEFAULT_CONTEXT_WINDOWSexport for dynamic context window lookup per provider, preventing silent truncation -
Individual message deletion —
DELETE /api/sessions/:id/messages/:messageIdendpoint for removing specific messages from a session with real-time UI delete button on hover
- Projects page — CRUD management for workspace projects with name, description, and agent assignment; stats bar with project count
- Hooks page — pipeline hook management with enable/disable toggles, stage selection, and admin-only visibility controls
- Triggers page — trigger management with cron/GitHub/file-watch type selectors, directory/file pattern fields, branch filters, and enabled toggles
- Channels page — channel adapter configuration with type selectors (Discord), API token fields, enable/disable toggles, and admin-only flags
-
Marketplace card redesign — new
.card-mpCSS with colour-derived icons, hover lift animations, version badges, monospace slugs, and green "installed" detection badges - Marketplace plugin version enrichment — proxy checks GitHub releases/tags for real version numbers with 1-hour cache; installed plugins/agents detected via API and shown with green badges
- Activity page enhanced — replaced separate Logs page with unified Activity view featuring level filter (errors/warnings), line limit selector (50/100/200/500), auto-refresh toggle, actor column, and inline error formatting
- SVG banner — new banner with CortexPrism logo, title, tagline, and version badges added to README and docs
-
Tool call JSON leaking into responses (
src/server/ws.ts) — replaced fragile regex pattern with robust brace-depth walker algorithm that properly handles nested JSON, escaped characters, and string boundaries; correctly strips{"tool":...,"args":{...}}patterns of arbitrary depth -
Missing output after tool execution (
src/agent/loop.ts) — multi-turn tool execution (search → synthesis) now shows final response in real-time without requiring page refresh; incremental streaming sends chunks immediately instead of waiting for full buffering -
Tool call JSON persisted to database (
src/agent/loop.ts) — responses are now stripped of tool calls before storage in session history, ensuring clean session records and past conversations remain readable and professional -
Duplicate
reasoningBtnvariable declaration (src/server/ui.ts) — renamed secondconstdeclaration toreasoningBtnToggleto fixSyntaxError: Identifier has already been declared; nestedcaseblocks in aswitchshare the same scope -
Reasoning panel showing raw XML/tool calls (
src/server/ui.ts) — panel now extracts only reasoning content via regex instead of displaying unfilteredcapturedReasoningwith structured tool calls and markup tags -
Reasoning panel persisting across messages (
src/server/ui.ts) — panel DOM element now properly removed via.remove()oncase 'start'instead of only hidden withdisplay: none -
Reasoning panel force-closed on response completion (
src/server/ui.ts) — removed unnecessaryreasoningPanelOpen = falseand panel hide incase 'done'so user maintains control over panel visibility -
cortex restartport conflict — usesfuser -k <port>/tcpto kill actual server process instead of shell wrapper, fixingAddrInUseon restart
-
Tool call handling strategy (
src/server/ws.ts,src/agent/loop.ts) — captured all raw reasoning separately from cleaned output; reasoning sent to client as optional 'reasoning' message type; WebSocket handler double-checks stripping with brace-depth walker for defensive consistency - Logs page merged into Activity — removed separate Logs page and consolidated into enhanced Activity page with level filtering, line limits, auto-refresh, and actor column
- USER.md format requirements — documented format expectations in soul.ts for consistent UI parsing
-
Plugin update system (
src/plugins/update.ts) — checks for new plugin versions via GitHub Releases API with automatic fallback to the Tags API for repos that tag commits directly without creating a formal Release; semver tags (vX.Y.Z/X.Y.Z) are preferred -
PluginUpdateConfig(src/config/config.ts) — new config blockpluginUpdatewith fieldscheckOnStartup,autoUpdate,checkIntervalHours, andgithubToken; deep-merged on load so defaults are never lost when upgrading from an older config file -
Plugin update startup check & scheduler (
src/cli/daemon.ts) — on daemon start, checks all installed plugins for updates; ifautoUpdateis enabled applies them automatically; periodic re-checks are scheduled viaschedulePluginUpdateChecks -
GET /api/plugins/check-updates(src/server/router.ts) — returns per-plugin version status (current, latest, updateAvailable, error) usingpluginUpdate.githubTokenfrom config -
POST /api/plugins/update-all(src/server/router.ts) — applies all available plugin updates and returns per-plugin success/error detail -
Plugin Updates settings card (
src/server/ui.ts) — new card in the Updates settings pane with interval, GitHub token (with PAT generation link), startup and auto-update checkboxes, and Save Plugin Settings, Check Now, and Update All action buttons with inline results panel -
Provider-specific LLM settings (
src/config/config.ts,src/llm/types.ts,src/llm/openai-compatible.ts,src/llm/ollama.ts,src/agent/loop.ts,src/server/ws.ts) — each provider now exposes its unique parameters end-to-end from config →CompletionOptions→ provider adapter:-
Anthropic / Google / OpenAI —
reasoningEffort(low / medium / high) already wired; now surfaced as a labelled dropdown in the Edit modal ("Extended Thinking", "Thinking Budget", "Reasoning Effort") -
OpenRouter —
httpRefererandxTitleinjected asHTTP-Referer/X-Titlerequest headers -
Perplexity —
searchRecencyFilter(month / week / day / hour),returnCitations,returnImagesforwarded assearch_recency_filter,return_citations,return_imagesbody fields -
Together AI / Fireworks / Novita —
repetitionPenaltyforwarded asrepetition_penalty -
Ollama —
numCtx→num_ctx,numThread→num_threadinoptionsobject;keepAlive→keep_aliveat request-body level; bothcomplete()andstream()wired -
LM Studio —
numCtx,keepAliveforwarded via the OpenAI-compatible path -
LiteLLM —
dropParams→drop_paramsbody field to silently ignore unsupported parameters -
Venice AI —
includeVeniceSystemPrompt→venice_parameters.include_venice_system_prompt
-
Anthropic / Google / OpenAI —
-
PROVIDER_EXTRA_FIELDSmetadata (src/server/ui.ts) — declarative per-provider field descriptor map (select/number/text/checkbox) that drives a dynamic "Provider Settings" section injected into the Add/Edit Model modal when a provider with extra fields is selected -
Provider card summary badges (
src/server/ui.ts) — configured provider cards in Settings now display active extra settings inline (reasoning effort, repetition penalty, recency filter, num_ctx, keep-alive, citations, drop-params, venice-prompt) -
PUT /api/config/providerbody widened (src/server/router.ts) — accepts all new provider-specific fields so the modal save correctly persists them -
11 new LLM providers — Cerebras, Fireworks, Perplexity, NVIDIA NIM, Moonshot (Kimi), Novita
AI, LM Studio, LiteLLM, Hugging Face Inference Router, Alibaba (Qwen), and Venice AI; each
implemented as an
OpenAICompatibleProvidersubclass with verified base URLs and auth from official docs (src/llm/cerebras.ts,fireworks.ts,perplexity.ts,nvidia.ts,moonshot.ts,novita.ts,lmstudio.ts,litellm.ts,huggingface.ts,alibaba.ts,venice.ts) -
Model listing for all new providers (
src/server/models.ts) — dedicated*Models()functions registered in theLISTERSmap; Perplexity falls back to a static curated list as it exposes no/modelsendpoint -
Dynamic provider + model selects in agent modal (
src/server/ui.ts) — agent create/edit modal now populates providers from/api/providers/configured(only keys with API key set) and auto-fetches models for the chosen provider viaonAgentProviderChange() -
GET /api/providers/configured(src/server/router.ts) — returns only providers that have an API key (orbaseUrlfor Ollama) configured, used by the agent modal and QM settings -
Quartermaster unified page (
src/server/ui.ts) — merged the former separate "Quartermaster" and "Model Intel" nav items into a single page with Tool Orchestration and Model Intelligence section tabs plus a ⚙ settings panel -
QM Settings panel (
src/server/ui.ts,src/server/router.ts) — inline settings to enable/disable Model Intelligence, pin a dedicated QM provider + model (ideal for Ollama/LM Studio), choose strategy (conservative / balanced / aggressive), and set the observe threshold; saved viaPOST /api/qm/config -
GET/POST /api/qm/config(src/server/router.ts) — read and writemodelSelectionconfig block including newquartermasterProviderandquartermasterModelfields -
POST /api/qm/reset(src/server/router.ts) — clears all learned QM patterns, decisions, tool stats, and signal weights -
GET /api/qm/patterns(src/server/router.ts) — dedicated endpoint for learned tool-sequence patterns, replacing the patterns tab's reuse of/api/qm/health -
QM patterns tab rework (
src/server/ui.ts) — now pulls real pattern rows (tool sequence, hit/success counts, avg confidence) from/api/qm/patterns; renders a progress bar per pattern -
QM decisions tab rework (
src/server/ui.ts) — shows aggregate accuracy header, signal contribution per decision, session suffix, and pending-evaluation count -
First-time password setup (
src/server/router.ts,src/server/ui.ts) —POST /api/auth/change-passwordnow skips session auth when no password exists yet; settings Security tab dynamically shows "Set Password" vs "Change Password" and hides the current-password field on first use; a new session cookie is returned immediately after the password is set -
quartermasterProvider/quartermasterModelconfig fields (src/config/config.ts) — optional fields onModelSelectionConfigto pin model routing to a specific provider -
Request-flow architecture doc (
docs/request-flow.md) — Mermaid flowchart covering the full lifecycle of a user message through pipeline hooks, metacognition, hybrid memory, LLM rounds, tool execution, sub-agents, reflection, and output streaming -
Memory health CLI (
src/cli/memory-cmd.ts) —cortex memory healthprints per-tier stats (total, active, stale counts; avg decay, importance, and access frequency) for episodic, semantic, graph, and reflection memory with colour-coded decay indicators -
Memory heuristics CLI (
src/cli/memory-cmd.ts) —cortex memory heuristicsmanually triggers a full heuristic learning cycle and reports rows affected per pass (importance boosted, decay slowed, relations strengthened, auto-tagged) -
updated_atonepisodic_memory(src/db/migrations/020_episodic_updated_at.sql) — adds the missing column (backfilled fromcreated_at) that hourly consolidation was silently failing to write; also registers the six missinggraph_relation_typesrows (related_to,is_part_of,is_instance_of,contradicts,supports,causes) -
Server log file (
src/cli/serve.ts,src/config/paths.ts) — background server process now redirects all stdout/stderr to~/.cortex/data/server.log(appending across restarts) via a shell redirect, replacing the previous silent/dev/nulldiscard;PATHS.serverLogexposes the canonical path -
Agent loop debug tracing (
src/agent/loop.ts) —[loop]prefixedconsole.logstatements on every tool round: turn ID, tool presence, stream mode, response length/preview, detected tool call names, per-tool execution results (success, output length, error), prose emission length, and final response emission path
-
Plugin auto-update HTML parse crash (
src/plugins/update.ts) —applyPluginUpdatewas fetching the GitHub repo homepage URL as a JSON manifest, receiving HTML and crashing withUnexpected token '<'; GitHub-sourced plugins now download the archive tarball at the resolved tag (refs/tags/vX.Y.Z.tar.gz) instead -
Direct URL fallback skips GitHub URLs (
src/plugins/update.ts) — the manifest re-fetch fallback incheckUpdateForRownow excludesgithub.comURLs, which are exclusively handled by the Releases/Tags API path -
githubTokenthreaded throughapplyPluginUpdate(src/plugins/update.ts,src/cli/daemon.ts,src/server/router.ts) — token is now passed to the internalcheckUpdateForRowcall, preventing unauthenticated GitHub API rate-limit failures that caused fallthrough to the HTML fetch path -
Route ordering for
/api/plugins/check-updates(src/server/router.ts) — moved specific routes before theGET /api/plugins/:namecatch-all which was intercepting them and returning 404 -
Daily semantic decay was a no-op (
src/memory/consolidate.ts) —runDailyConsolidationqueried the non-existent columnlast_accessed_at; corrected tolast_accessed(the actual schema column), so decay scores are now updated on every daily cycle -
Heuristic cycle metrics always reported zero (
src/memory/heuristics.ts) —boostImportanceFromAccessandslowDecayForFrequentAccessboth hardcodedreturn 0; they now usedb.client.executeto obtainrowsAffectedand return the real updated-row count -
Half-life extension only fired once (
src/memory/heuristics.ts) —slowDecayForFrequentAccessguarded withhalf_life_days <= default, preventing re-triggering after the first extension; changed to< maxso frequently-accessed memories keep extending toward the ceiling on each cycle -
Reflection patterns duplicated on every turn (
src/agent/reflect.ts) —storeReflectionusedON CONFLICT DO NOTHINGwith a random ID, so the same pattern string accumulated hundreds of rows; it now looks up bypatterntext first and performs a weighted confidence update +supporting_eventsincrement on existing rows, only inserting when the pattern is genuinely new -
Memory injection missing metadata context (
src/memory/inject.ts) —formatHitonly showed label and age; it now also surfacescategory,tags,topics, andentitiesinline so the LLM receives richer context for each recalled memory -
Noisy knowledge graph entities (
src/memory/graph.ts) —extractAndStoreEntitieswas creating graph nodes for every capitalized word (e.g. "User", "Assistant", "Based", "String"); anENTITY_STOP_WORDSset now filters common English words and agent-specific noise before insertion -
Bare JSON tool calls leaked to chat UI (
src/agent/loop.ts) —stripToolCallMarkupused a non-greedy regex\{...\}that stopped at the first}, so nested args like{"tool":"file_read","args":{"path":"..."}}were only partially removed and the remainder was rendered in the UI; replaced with the same brace-depth walker used byextractBareToolCalls, collecting full-span regions right-to-left before removal -
Tool call JSON leaked to chat UI (
src/agent/loop.ts) — round 0 previously streamed the raw LLM response (including{"tool":"...","args":{...}}JSON or<tool_call>XML) directly toonChunkbefore tool call detection ran; all rounds now use a buffered internalstream()call when tools are registered, and only clean prose is forwarded to the client -
<tool_result>XML leaked to chat UI (src/agent/loop.ts,src/server/ws.ts) — raw<tool_result ...>XML blocks were forwarded viaonChunkafter each tool execution; theonChunkcall for tool results is removed, and thews.tsonChunkhandler now strips<tool_call>,<tool_result>, and bare JSON tool objects as a client-side safety net -
Duplicate tool call execution (
src/tools/executor.ts) —parseToolCallsran both the<tool_call>XML regex andextractBareToolCallson the same text, causing every<tool_call>{"tool":...}</tool_call>to be parsed and executed twice; fixed by stripping XML regions from the text before the bare JSON scan -
LLM hang on tool follow-up rounds (
src/agent/loop.ts,src/llm/openai-compatible.ts,src/llm/types.ts) — tool follow-up rounds usedcomplete()which stalled indefinitely on slow providers (DeepSeek) when given large contexts; all tool rounds now use bufferedstream()with a 90-secondAbortSignaltimeout;signal?: AbortSignaladded toCompletionOptionsand wired throughOpenAICompatibleProvider.stream()andcomplete() -
Model looping on tools without producing a final answer (
src/agent/loop.ts) — follow-up prompt after tool results now escalates per round: when ≤1 rounds remain the model receives a hard instruction to stop calling tools and deliver its final response immediately
-
Voice & TTS system (
src/voice/,src/tools/builtin/speak.ts,src/tools/builtin/listen.ts,src/cli/voice-cmd.ts) — full voice pipeline: speech-to-text via OpenAI Whisper, text-to-speech via OpenAI TTS (or optional ElevenLabs), energy-based VAD, audio format conversion with ffmpeg fallback, voice channel plugin implementingChannelPlugin, andspeak/listenagent tools -
Voice WebSocket protocol (
src/server/ws.ts) — newWsMsgvariants (audio_chunk,audio_end,speak,audio,voice_state) for real-time audio streaming, server-side transcription, and TTS playback; transcribed speech is dispatched directly into the agent loop -
Voice API routes (
POST /api/voice/transcribe,POST /api/voice/synthesize,GET /api/voice/synthesize/:text,GET /api/voice/providers) — REST endpoints for audio transcription and speech synthesis -
Auto-TTS pipeline hook (
src/voice/pipeline.ts) —post-outputhook that automatically synthesizes agent text responses to audio whenvoice.autoTTSis enabled; audio is forwarded to the WebSocket client before thedonesignal -
Voice settings in Web UI (
src/server/ui.ts) — Voice & TTS settings tab with provider selection, default voice, language, auto-TTS toggle, and ElevenLabs API key; microphone button in chat input bar with CSS recording animation; speaker button on each assistant message for on-demand TTS; voice indicator with speaking pulse animation -
Voice activity detection (
src/voice/vad.ts) — energy-based VAD with configurable frame size, speech threshold, silence timeout, and minimum speech duration -
Voice CLI command (
cortex voice enable|disable|status|set-voice) — manage voice mode and default voice from the terminal -
voiceDataDirpath (src/config/paths.ts) — dedicated voice cache directory under the data directory -
Service management commands (
src/cli/start.ts) —cortex startandcortex restartcommands for managing the daemon and web UI server processes -
Silent install and uninstall operations (
src/cli/install.ts,src/cli/service-helper.ts) —--yesflags and non-interactive mode for automated setup scripts -
macOS launchd
HOMEfix (src/cli/daemon.ts,src/cli/serve.ts,src/utils/platform.ts) — launchd plist now writes the correctHOMEvalue from environment instead of requiring a manual placeholder edit -
Web UI file upload (
src/server/ui.ts,src/server/ws.ts,src/server/router.ts) — attach files (PDFs, images, documents) directly in the chat input bar via a new 📎 button. Files are sent as base64 over WebSocket alongside chat messages, saved to both the working directory and agent workspace for tool access, and displayed as inline previews in the chat log -
Multimodal content types (
src/llm/types.ts) —Message.contentnow supportsContentBlock[](text, image, document) in addition to plain strings, enabling multimodal LLM providers to receive images and documents natively -
Multimodal LLM provider support — Anthropic (
src/llm/anthropic.ts) maps content blocks to nativeimage/documentblocks; OpenAI and OpenAI-compatible providers (src/llm/openai.ts,src/llm/openai-compatible.ts) map images toimage_urlparts; Google (src/llm/google.ts) maps toinlineDataparts; Ollama (src/llm/ollama.ts) maps images to theimagesarray; Bedrock (src/llm/bedrock.ts) extracts text from content blocks for Converse API -
PDF text extraction (
src/utils/pdf.ts) — new utility usingpdf-parse(PDF.js) to extract readable text from uploaded PDFs. Integrated intofile_readtool (src/tools/builtin/file_read.ts) for on-demand extraction, and into the WebSocket handler for immediate inline preview in the chat message -
Upload endpoint (
POST /api/upload) — REST endpoint for programmatic file uploads, accepts{ filename, mimeType, data (base64) }and saves to$DATA_DIR/uploads/ -
Session resume on page refresh (
src/server/ws.ts) —processChatMessagenow accepts and reuses the client-providedsessionIdfrom WebSocket chat messages, so page refresh resumes the existing conversation (with full history) instead of creating a new session -
Text-only model image handling (
src/server/ws.ts) — image content blocks are only sent to providers known to support multimodal input (Anthropic, Google); for other providers a clear message is appended noting the limitation and suggesting a provider switch, with the file saved to disk for reference -
Raw tool call filtering in session restore (
src/server/ui.ts) —restoreSession()now detects assistant messages containing raw{"tool":...}JSON and renders them as compact⚙ tool_namebubbles instead of displaying the raw JSON verbatim -
Uploaded files written to both working directory and agent workspace (
src/server/ws.ts) — ensuresfile_readandfile_listtools can find the file regardless of which workspace root they resolve to -
web_fetchtool (src/tools/builtin/web_fetch.ts) — fetch any URL and return cleaned plain text (strips HTML, scripts, and styles). Supports configurable max length -
file_globtool (src/tools/builtin/workspace/file_glob.ts) — find files matching glob patterns (e.g.**/*.ts,*.pdf). Returns relative paths sorted by modification time, respectsworkspace: "agent"/"global"parameter -
shelltool wired in (src/tools/builtin/shell.ts,src/server/ws.ts) — local shell command execution tool was already built but not registered; now wired into the default tool set with safety filtering against destructive commands
-
Agent loop (
src/agent/loop.ts) —AgentTurnOptionsnow accepts optionaluserContentBlocksfor multimodal user messages; when provided, the last user message in history is replaced with content blocks so the LLM receives the full multimodal context. After tool execution, a follow-up instruction is embedded in the tool result message ("Based on the tool output above, provide your complete response. Do NOT make additional tool calls unless absolutely necessary") to force the LLM to produce analysis rather than stopping after raw tool output -
LLM router (
src/llm/router.ts) —chooseModel()updated to extract text fromContentBlock[]for scoring, maintaining compatibility with multimodal messages -
file_readtool (src/tools/builtin/file_read.ts) — addedworkspaceparameter ("agent"/"global") matching other file tools; path resolution now usesresolveWorkspacePath()to find files in the agent workspace; PDF output capped at 150 lines / 8000 chars to avoid context exhaustion; description prominently mentions PDF auto-extraction -
code_exectool description (src/tools/builtin/code_exec.ts) — now explicitly warns that the sandbox has NO access to host files or workspace, no package managers available -
System prompt augmentations (
src/server/ws.ts) — two new sections appended:-
## File Context— tells the agent uploaded content is included inline and to analyze it directly without callingfile_readunless necessary -
## Environment— warns thatcode_execruns in an isolated Docker sandbox with no host filesystem access; use file tools for all file operations
-
-
PDF inline preview (
src/server/ws.ts) — extracted text wrapped in=== BEGIN/END DOCUMENT ===markers; preview capped at 2000 chars to keep initial context lean; when extraction fails, an explicitfile_read("filename.pdf")hint is included -
File-upload prompt (
src/server/ws.ts) — when files are uploaded without a text message, the effective prompt is now explicitly directive: "Read, analyze, and provide a thorough evaluation — include: Summary of key content, Main points and findings, Your assessment and any recommendations"
-
PDF extraction silent failure (
src/utils/pdf.ts) —pdf-parsewas receivingBuffer.from()when it requiresUint8Arrayin Deno, causing silent extraction failures. Fixed by passing the rawUint8Arraydirectly -
code_execDocker filesystem blindness — agent was runningfind /,strings,pip installin the Docker sandbox which has no host filesystem access, wasting tool rounds. Fixed by adding warnings to both thecode_exectool description and the system prompt## Environmentsection -
Tool output displayed without analysis — after
file_readreturned PDF text, the agent would stop without producing a natural language analysis. Fixed by embedding a follow-up instruction directly in the tool result user message and telling the agent to analyze inline content directly rather than re-reading it via tools
-
Unified service installation (
src/cli/install.ts) —cortex installandcortex uninstalltop-level commands that install both the daemon supervisor and web UI server as system services in a single step -
Server service installation (
src/cli/serve.ts) —cortex serve installandcortex serve uninstallsubcommands for installing only the web UI server as a system service -
--with-serverflag (src/cli/daemon.ts) —cortex daemon install --with-serverinstalls both the daemon and server services together -
Shared service helper (
src/cli/service-helper.ts) — cross-platform service management module generating systemd user units (Linux), launchd agents (macOS), and NSSM/Task Scheduler instructions (Windows) for both daemon and server, with correct per-platform binary path and home directory resolution -
Server service templates —
deploy/cortex-server.service(systemd user unit) anddeploy/com.cortexprism.server.plist(launchd agent) for manual deployment -
Extended Windows installer (
deploy/install-service.bat) — now installs both daemon and server with--daemon-only/--server-onlyflags for selective installation via NSSM or Task Scheduler
-
Daemon service install (
src/cli/daemon.ts) — refactored to use shared service helper; macOS launchd plist now writes the correctHOMEvalue from environment instead of requiring a manual placeholder edit -
macOS launchd agent (
deploy/com.cortexprism.plist) — now dynamically writesHOMEenvironment variable at install time
-
Windows path resolution — All
import.meta.urlpathname usages replaced withfromFileUrlfrom@std/pathto fix broken/C:/Users/...paths on Windows (affects db migrations, update installer, version detection, daemon spawning, and sub-agent/service spawning) -
Windows path separators — Hardcoded
/path concatenation replaced withjoin()/dirname()in server router, plugins context, inline SPA UI code, file watcher, and plugin install -
Windows process management — Added cross-platform
findDenoProcesses(),killDenoProcesses(),killProcessById(), andkillChildProcess()helpers with PowerShell fallbacks on Windows. Replaced allpgrep,pkill, and directSIGTERMusages across CLI commands, agent sub-processes, service manager, and daemon supervisor -
Windows shell execution — Hardcoded
shcommands replaced withgetShellCommand()which uses PowerShell on Windows (executor process, scheduler process, jobs CLI) -
Windows temp directory — Hardcoded
/tmp/cortexsocket directory replaced withgetTempDir()fallback. Screenshot temp paths also fixed -
Windows home directory —
Deno.env.get('HOME')withoutUSERPROFILEfallback in plugins and import/migration CLI commands replaced with centralizedresolveHomeDir() -
Windows editor default —
vifallback in soul-cmd replaced withnotepadon Windows -
Workflow engine —
dfandfreeUnix commands wrapped in try/catch for Windows compatibility -
Workspace path validation —
startsWith('/')replaced withisAbsolute()for correct detection of Windows absolute paths (e.g.,D:\...); container check handles both\and/ -
Server stability —
Deno.serve()result awaited with error handler to prevent silent crash on port bind failure; daemon child process stderr piped for error visibility; missedSIGTERMin serve restart flow replaced withkillProcessById() -
libSQL database —
file:URL backslashes normalized to forward slashes for Windows compatibility -
Test suite — Cross-platform fixes for workspace tests:
fromFileUrlfor SQL migration paths,join()for path assertions,isAbsolute()for path containment checks, delay after db close for Windows file-locking
-
Cross-platform support (macOS & Windows) — CortexPrism now runs natively on all three major platforms alongside existing Linux support:
-
Platform detection utility (
src/utils/platform.ts) —isWindows(),isMacOS(),isLinux(),getShellCommand(),getExeSuffix()helpers used throughout the codebase -
Cross-platform shell execution (
src/tools/builtin/shell.ts) — PowerShell on Windows (-NoProfile -Command),shon Unix. Expanded safety filter with Windows-specific blocked commands (del /f /s /q C:\,format,Remove-Item -Recurse -Force) -
Cross-platform file permissions (
src/utils/permissions.ts) —makeExecutable()andmakePrivate()abstractions that are no-ops on Windows,chmodon Unix. AllDeno.chmod()call sites migrated -
Windows home directory resolution (
src/config/paths.ts) —HOMEDRIVE/HOMEPATHfallback in addition toHOME/USERPROFILE -
Cross-platform sandbox runners (
src/sandbox/executor.ts) —.exesuffixed binaries on Windows, platform-awarekillProcess()helper (SIGTERM on Unix, bare kill on Windows), platform-specific Docker Desktop installation messages -
Cross-platform git hooks (
src/triggers/git-hooks.ts) —$(date -Iseconds)replaced with Deno-generated ISO timestamps -
Cross-platform update installer (
src/update/installer.ts) —powershell Expand-Archivefor zip extraction on Windows,tar.exeon Windows,getExeSuffix()for binary naming
-
Platform detection utility (
-
Desktop automation — macOS (
src/desktop/darwin.ts) —screencapturefor screenshots,osascriptfor keystrokes,pbpaste/pbcopyfor clipboard,cliclickfor mouse actions and drags. FullDesktopAutomationinterface implementation -
Desktop automation — Windows (
src/desktop/windows.ts) — PowerShell + .NETSystem.Windows.Forms/System.Drawingfor screenshots, mouse positioning, clicks, drags, keystrokes, and clipboard. FullDesktopAutomationinterface implementation -
Desktop automation abstraction (
src/desktop/types.ts) —DesktopAutomationinterface withexecuteDesktopAction(),getDockerfile(),getEntrypointScript(). Platform-dispatching facade insrc/desktop/automation.tsselects the correct implementation at runtime viaDeno.build.os -
Daemon service installation (
src/cli/daemon.ts) —cortex daemon installandcortex daemon uninstallcommands for all platforms:-
Linux:
systemctl --uservia~/.config/systemd/user/cortex-daemon.service -
macOS:
launchctl load/unloadvia~/Library/LaunchAgents/com.cortexprism.daemon.plist -
Windows: NSSM-based service or directs to
deploy/install-service.bat
-
Linux:
-
Deployment configs —
deploy/cortex-daemon.service(systemd user unit),deploy/com.cortexprism.plist(launchd agent),deploy/install-service.bat(Windows NSSM/Task Scheduler setup) -
CI/CD expansion (
.github/workflows/ci.yml,.github/workflows/release.yml) — Test matrix expanded to[ubuntu-latest, macos-latest, windows-latest]. Tauri build job added with platform matrix (deb/dmg/msi) -
Platform documentation —
docs/install/macos.md,docs/install/windows.md,docs/COMPATIBILITY.md(feature parity matrix across all platforms) -
Windows installer (
install.ps1) — PowerShell-based installer: clones repo, installs Deno if missing, createscortex.batwrapper, adds to user PATH -
Package distribution manifests — Homebrew formula (
packaging/homebrew/cortex.rb), Chocolatey nuspec + install script (packaging/chocolatey/), Scoop bucket (packaging/scoop/cortex.json), winget manifest (packaging/winget/) -
Code signing guide (
packaging/CODE_SIGNING.md) — macOS codesign/notarization + Windows signtool instructions for desktop app distribution
- Desktop automation refactored from single Linux-only
automation.tsto platform-dispatching architecture with three independent implementations sharing a commonDesktopAutomationinterface. Public API (executeDesktopAction,getDockerfile,getEntrypointScript) unchanged for backward compatibility
-
macOS screenshot args —
screencaptureformat flag was duplicated in argv. Fixed to pass single-t png/-t jpg -
macOS keypress — Changed from
key code(numeric codes only) tokeystrokewith AppleScriptusing {modifiers}syntax for proper key name support
- Dashboard as default landing page — Dashboard now opens first on load instead of Chat, providing an immediate system overview. Dashboard moved from "Monitoring" to "Core" nav section with active-state highlighting on load.
- Navigation consolidation — Removed standalone Status page; all Status content (system overview, KPI cards, daemon status, system resources, activity feed) merged into the Dashboard as configurable widgets. Sidebar simplified with Dashboard as the primary Core entry.
-
Three new Dashboard widgets covering the old Status page functionality:
- Server Info (2×1) — Uptime, LLM Provider/Model, Cortex Build version, System Status
- Enhanced System Resources (2×2, up from 2×1) — Memory/Disk bars plus CPU Cores and Platform panels
- Enhanced Daemon Status (2×2, up from 1×1) — Detailed daemon cards with status dots, descriptions, online count, and operational-status warning banner
-
Dashboard Config REST API (
GET/PUT /api/dashboard/config) — Persists widget layout to~/.cortex/dashboard.json, enabling programmatic dashboard manipulation -
dashboard_manageLLM tool — Agent-accessible tool for CRUD operations on dashboard widgets directly through chat. Supportslist,add,remove, andupdateoperations. Registered in all four execution contexts (CLI chat, WebSocket/dashboard chat, services, sub-agents). -
Custom HTML widget type — LLM agents can craft fully custom dashboard widgets with arbitrary
HTML and inline CSS via the
dashboard_managetool. Supports optionaltitleoverride andrefreshinterval (min 5s). Script tags and event handlers are stripped for safety. Hidden from the manual UI widget picker (agent-only creation).
- Default dashboard layout reconfigured to 8 widgets: KPI Cards, Server Info, Daemon Status (2-row), Memory Stats, System Resources (2-row), Recent Sessions (2-row), Token Chart, and Recent Activity
- Memory Stats widget widened from 1×1 to 2×1 for better readability
- Command palette (Ctrl+K) entry for Status merged into Dashboard entry
-
Drag-and-drop in Dashboard — Fixed swap logic to exchange widget positions in the array
instead of invisible
row/colmetadata fields, which previously produced zero visual change because CSS grid auto-flow follows array order, not metadata -
Drag-start prevention — Strengthened edit-mode guard by setting
effectAllowed = "none"in addition topreventDefault()for browsers that ignorepreventDefaultondragstart
-
Soul system expansion — Overhauled agent identity system with richer defaults, more
personality options, and new CLI commands:
- Expanded DEFAULT_SOUL — Now 10 sections (Identity, Behavior, Output Format, Tool Usage, Memory, Sub-Agents, Safety & Ethics, Learning & Adaptation, Limitations) with detailed behavioral guidance for tool usage, output formatting, and ethical conduct
- USER.md template — Expanded with Goals & Objectives, Current Projects, Technical Environment, Communication preferences, and Learning Interests sections
- MEMORY.md template — Restructured with About the User, Project Context, Key Decisions, Preferences, and Ongoing Work sections
- 4 new personality templates — Creative, Analyst, Teacher, and Minimalist, bringing the total to 7 personality options during setup
-
cortex soul templates— List all available personality templates with descriptions -
cortex soul apply-template <name>— Apply a personality template to SOUL.md -
cortex soul validate— Validate SOUL.md structure against recommended sections -
Template consolidation — All personality templates centralized in
src/agent/soul.ts, eliminating 3 duplicate copies across the codebase
- Soul fallback — DEFAULT_SOUL runtime fallback kept concise (~15 lines) while the expanded template is used exclusively for file initialization, preventing behavioral regression for agents without a custom SOUL.md
- Personality spelling — Standardized on American English "Behavior" across all templates
-
Security: Prototype-safe template name validation using
Object.hasOwn()instead ofinoperator - Performance: Replaced unnecessary dynamic imports with static imports in CLI and server
-
Model Quartermaster — Intelligent LLM Selection System (
src/model-quartermaster/) — A learning-based model selection engine that dynamically routes requests to the most appropriate LLM based on task characteristics, historical performance, cost constraints, and learned patterns. Registered as a pipeline hook (@cortex/model-quartermaster, priority 5) atpre-llmandpost-llmstages. Key components:- 6-signal prediction engine — historical performance by task category, episodic memory hits, cost optimization, quality estimation, trajectory patterns (recent model usage), and reflection feedback are fused via weighted combination to predict the best model before each LLM call
-
Three-mode decision system — predictions above 0.85 confidence use
enforcemode (override model selection); above 0.65 usesuggest(hint injected to system prompt); otherwisedeferto default provider -
Adaptive learning — signal weights update via EMA (
new = old + lr × (reward - old)) with decaying learning rate (0.05 → 0.995 decay), driven by quality and cost efficiency feedback - Observation-first startup — MQM starts in observe-only mode until 50 LLM calls are observed, then activates and begins making predictions
-
Three arbiter strategies —
conservative(prefers cheaper models, high confidence required),balanced(standard thresholds for cost/quality balance),aggressive(prioritizes quality, lower thresholds) -
Task categorization — Automatic classification of requests into
code,analysis,creative,factual, orconversationcategories using heuristic keyword matching - Context fingerprinting — Multi-feature context extraction (message length, code detection, question count, complexity estimation) for pattern matching and signal scoring
-
SQLite schema (
019_model_quartermaster.sql) — 5 tables:mqm_model_stats,mqm_signal_weights,mqm_decisions,mqm_session_state,mqm_patternswith full audit trail per decision -
Lens audit events — 5 new event types (
mqm_prediction,mqm_observation,mqm_weight_updated,mqm_pattern_learned,mqm_mode_changed) logged for observability -
Configuration —
modelSelectionconfig section incortex.jsonwithenabled,mode,observeThreshold,enforceConfidence,suggestConfidence,costBudget,qualityThreshold, andallowedProviderssettings -
Pipeline integration — New
pre-llmandpost-llmhook stages feed MQM predictions into the agent loop, with automatic provider/model override for enforce decisions
-
Server UI Quartermaster dashboard (
src/server/ui.ts) — New "Quartermaster" nav tab in the Monitoring section with three sub-tab panes:- Overview — 6 stat cards (mode badge, observations, predictions, correct, overall/recent accuracy), Chart.js line chart for accuracy trends (bucket + rolling average), horizontal signal weight bars with gradient fill, and grid of top-10 tool stats with color-coded success rate bars
- Patterns — Session-level prediction accuracy grouped by session ID with bar charts and automate/suggest/defer mode breakdowns
- Decisions — Reverse-chronological decision log with color-coded mode dots, predicted vs actual tool display, confidence percentages, signal names, and correctness indicators (✓/✗/⏳)
- Fetches
/api/qm/healthand/api/qm/recentendpoints, follows existingswitchMemoryTabsub-tab pattern, and auto-loads on nav click viashowPage()loader dispatch
-
Pipeline hook stages — Added
pre-llmandpost-llmstages to the pipeline system, enabling hooks to run immediately before and after every LLM call within the agent loop
-
Release artifact binary naming — Compiled binaries inside platform-specific tarballs were named
cortex-x86_64-linux(etc.), but the installer expectedcortex. Thecortex updatecommand failed with "Extracted binary not found" for all binary installs. Fixed by compiling with--output cortexand keeping platform names only on the archive filename. -
Source-mode tarball extraction — When
git checkoutfails during a source-mode update, the GitHub tarball fallback extracted files into a nested subdirectory (cortex-0.26.0/) instead of the install root. Health checks compared the wrong VERSION file and falsely reported failure. Fixed by passing--strip-components=1totarfor source tarball fallbacks. -
Source-mode rollback — Rollback for source installs was a stub that always returned "must be done manually via git". Additionally, the rollback guard required
prevBinaryPath(always empty for source mode), blocking all source rollbacks. Implemented full source rollback viagit checkout v${prevVersion}with fetch, checkout, manifest update, and health check. -
Install script fixes (
docs/design/install.sh) — The one-line installer failed in three ways: (1)deno task setupreferenced a non-existent task (changed todeno run --allow-all src/db/migrate.ts); (2) thecortexcommand was never created on PATH after install — added a wrapper script at~/.deno/bin/cortex; (3) the quick-start instructions required manuallycd-ing to the install directory instead of using thecortexcommand directly. -
Setup wizard non-TTY guard — Running
cortex setupwithout a terminal (e.g., from a piped installer) caused the Cliffy prompt to hang or show the web onboarding prompt unexpectedly. Added an early return whenDeno.stdin.isTerminal()is false, running only migrations and printing a hint. -
Welcome screen hang — The "Press Enter to begin" prompt used raw stdin mode with a buggy listener that passed the byte count
ntonew Uint8Array(n)instead of the actual buffer data. Enter keypresses were never detected, causing an indefinite hang. Fixed by using cooked-modeDeno.stdin.read(buf)directly. -
Welcome screen rendering artifacts — The previous Unicode block-letter ASCII logo used
\r-based typewriter animation that garbled rendering on many terminals, displaying partial text like "CORT" instead of "CORTEX". Replaced with a simpler block-character banner (▄█░▀) in the style of OpenClaw, printed line-by-line without carriage-return tricks. -
Health check path construction —
healthCheckSource()built file paths with string concatenation (${installPath}/VERSION) instead ofjoin(), producing double-slash paths. Fixed by usingjoin()from@std/path.
-
Quartermaster — Tool Orchestration Learning System (
src/quartermaster/) — A background subsystem that learns when and how to select tools by observing the agent's reasoning trajectory. Registered as a pipeline hook (@cortex/quartermaster, priority 6) at bothpre-toolandpost-toolstages. Key components:- 5-signal prediction engine — trajectory history, episodic memory hits, tool success statistics, task context (metacog), and reflection confidence are fused via weighted combination to predict the next tool before the LLM decides
-
Three-mode decision system — predictions above 0.9 confidence for safe read-only tools use
automatemode; above 0.6 usesuggest(hint injected to LLM); otherwisedeferto LLM -
Adaptive learning — signal weights update via EMA (
new = old + lr × (reward - old)) with decaying learning rate, driven by reflection feedback on prediction accuracy - Observation-first startup — Quartermaster starts in observe-only mode (always DEFER) until 50 tool calls are observed, then activates
- Context fingerprinting — 12-feature vector (tool round, file count, error context, metacog-derived flags, session age) for pattern matching without query text dependency
-
SQLite schema (
018_quartermaster.sql) — 5 tables:qm_patterns,qm_signal_weights,qm_tool_stats,qm_decisions,qm_session_statewith full audit trail per decision -
CLI commands (
cortex qm) —patterns,weights,stats,decisions,trace <turn>,dashboard(ASCII visualization with accuracy bars and trends),accuracy,reset,reset-all -
REST API —
GET /api/qm/summary,/api/qm/accuracy,/api/qm/recent,/api/qm/weights,/api/qm/stats,/api/qm/healthexposing live monitoring data -
Prometheus metrics — 7 new metrics (
cortex_qm_predictions_total,cortex_qm_predictions_correct,cortex_qm_observations_total,cortex_qm_accuracy,cortex_qm_weights,cortex_qm_patterns_total,cortex_qm_confidence) registered in/metricsendpoint -
Lens audit events — 5 new event types (
qm_prediction,qm_decision_evaluated,qm_weight_updated,qm_pattern_learned,qm_mode_changed) logged for session replay and observability -
Tool output parsing robustness — New
extractBareToolCalls()fallback parser handles LLM outputs missing<tool_call>wrapper tags by extracting bare JSON{"tool": ..., "args": ...}objects, improving tool call reliability across all providers
-
Proper skill steps — All 12 builtin skills now define 5 concrete, actionable steps instead of storing the full markdown content as a single step. Each step has
action(what to do) anddescription(how to do it). Steps are displayed in the skill designer UI and available to agents via the steps API.
-
BuiltinSkill interface — Added optional
steps?: SkillStep[]field. Skills can now define ordered procedures.registerBuiltinSkills()uses defined steps or falls back to single-step format for backward compatibility.
-
Skill designer UI null reference errors — Added existence checks before calling
addEventListener()on DOM elements. Skill designer HTML is now verified to exist before JavaScript tries to attach listeners, preventing "Cannot read properties of null" errors. -
Skill designer metadata field restoration — Restored original metadata fields (
sd-name,sd-desc,sd-trigger,sd-frontmatter-preview) alongside new metadata fields. Fixed "Cannot set properties of null" error when editing skills. - Steps tab display — Steps now render as individual cards instead of a single massive block containing the full markdown content.
-
Model configuration CLI (
src/cli/models-cmd.ts) —cortex modelscommand with four subcommands:-
list— display all configured providers with model, reasoning effort, context window, temperature, and max tokens -
show <provider>— detailed view of a single provider's settings including API key status and base URL -
set <provider> <key> [value]— set model, reasoningEffort (low/medium/high), contextWindow (tokens), temperature, maxTokens, or topP. Omitting the value unsets the field -
available [provider]— fetch available models from a provider's API with the currently configured model marked
-
-
Reasoning effort / extended thinking — new
reasoningEffortfield onProviderConfigandCompletionOptions, mapped to provider-specific APIs:-
Anthropic (
src/llm/anthropic.ts) —thinking.budget_tokenswith budget tiers: low=1024, medium=4096, high=16384 -
Google (
src/llm/google.ts) —thinkingConfig.thinkingBudgetwith same tier mapping -
OpenAI (
src/llm/openai.ts) —reasoning_effortparameter (o-series models) -
OpenAI-compatible (
src/llm/openai-compatible.ts) —reasoning_effortparameter (DeepSeek R1, Grok-3, etc.)
-
Anthropic (
-
Context window display — new
contextWindowfield onProviderConfig(informational, shown inmodels listandmodels show, not enforced at API level) -
Built-in skills system (
src/skills/builtin/,src/memory/skills.ts) — Skills now ship with the application as embedded TypeScript modules.registerBuiltinSkills()auto-loads built-in skills (cortex-dev,frontend-design) and filesystem skills from.cortex/skills/into the database at startup. Skills are injected into the system prompt at session start as an<available_skills>XML block, rather than only appearing reactively per-turn. CLI chat and server both callregisterBuiltinSkills()on startup. -
Skill designer (
src/server/ui.ts) — Full-screen split-pane skill editor replacing the basic modal. Three tabbed panels: Content (Markdown editor with live preview), Metadata (name, description, trigger pattern with YAML frontmatter preview), and Steps (visual step editor with add/remove/reorder, tool + params fields). Draggable resize between editor and live markdown preview panels. Keyboard shortcuts:Ctrl+Ssave,Escclose. Export to.cortex/skills/<name>/SKILL.mdvia user-requested endpoint. -
skill_writetool (src/tools/builtin/skill_write.ts) — Agent tool to create, update, or delete skills programmatically. Supports name, description, content, trigger_pattern, and ordered steps with tool/params. Registered in CLI (src/cli/chat.ts) and WebSocket (src/server/ws.ts). -
skill_readtool (src/tools/builtin/skill_read.ts) — Agent tool to inspect specific skills by name or list all skills with origin filtering. Registered in CLI and WebSocket. -
POST /api/skills/export(src/server/router.ts) — Exports a skill to.cortex/skills/<name>/SKILL.mdwith YAML frontmatter.
-
Reasoning effort threads through the entire stack:
AgentTurnOptions,AutofixOptions,reflectOnTurn,consolidateReflections, and all 8+ callers (chat, TUI, WebSocket, sub-agents, services, Discord, run, eval) readreasoningEffortfrom the provider config and pass it to LLM calls -
loadHumanSkills()now scans.cortex/skills/for SKILL.md files..kilo/path references removed —.kilo/is reserved for the Kilo IDE.
- Skills directory path:
.kilo/skills/references removed from the Cortex skills system. All skill loading and export now use.cortex/skills/.
-
Agent panel (right sidebar) (
src/server/ui.ts,src/db/sessions.ts,src/server/router.ts) — Expandable right sidebar in the chat panel showing agent and sub-agent sessions with status dots, channel type badges, turn counts, and last-activity times. Sub-agents are nested under their parent sessions with expand/collapse toggles. Hover action buttons for close, archive, delete, and resume. Clicking a session switches the chat to that session's full message history. NewGET /api/sessions/treeendpoint returns parent sessions with nested children in a single batch query. NewPOST /api/sessions/:id/closeandPOST /api/sessions/:id/archiveendpoints for session lifecycle management. Archived sessions excluded from the tree view. -
Structured tool errors (
src/tools/types.ts,src/tools/executor.ts) —ToolErrorInfowithcode,message,retryable,suggestedAction, andcontextfields. All tool failures now carry machine-readable error metadata.formatToolResultsrenders error codes and suggested actions in tool result XML. Outputs over 8,000 characters are truncated at the presentation layer only — full output preserved in theToolCallResultobject withtruncatedandoutputLengthmetadata. -
Context compaction middleware (
src/pipeline/builtin.ts) —@cortex/summarizationhook fires at 80K estimated token threshold (priority 8 atpre-reasonstage), summarizes older half of conversation history into a compacted block, retaining recent messages intact. PII redaction applied to summarized content before injection. -
Tool output sandboxing (
src/pipeline/builtin.ts) —@cortex/tool-output-sandboxhook intercepts large tool outputs atpost-toolstage, stores full output in session-scoped storage for retrieval. -
Build-Verify-Fix enforcement (
src/pipeline/builtin.ts) —@cortex/pre-completion-checklistinjects a self-check system message when the agent emits exit keywords, forcing verification before claiming completion. -
Loop detection (
src/pipeline/builtin.ts) —@cortex/loop-detectiontrackes per-file edit counts and injects warnings after 5+ edits to the same file in one turn. -
Lazy three-tier skill loading (
src/memory/skills.ts,src/tools/builtin/load_skill.ts) — Skills now injected as a compact manifest (name + description + trigger) in the system prompt. Full skill instructions loaded on demand via the newload_skilltool.formatSkillDetail()for comprehensive skill display. -
Eval infrastructure (
src/eval/—types.ts,scorer.ts,runner.ts,src/cli/eval-cmd.ts) —cortex evalCLI command with benchmark suite runner, pattern-based scoring (regex/contains/not_contains), file content verification, regression detection against baseline results, per-category pass/fail statistics, and--save-baseline/--baselineoptions. -
Sandbox gVisor support (
src/sandbox/executor.ts,src/sandbox/agent-sandbox.ts) —gvisoradded as aSandboxRuntimeoption using--runtime=runscfor kernel-level syscall filtering.getAvailableRuntime()auto-detects gVisor availability and prefers it over plain Docker. Supervisor pattern implemented inagent-sandbox.tsfor running agent execution isolated from the control plane. -
Tool registry enhancement (
src/tools/registry.ts) —toolNames()method returning all registered tool names for error suggestions.
-
Validator fail-closed (
src/tools/executor.ts) — When the validator daemon is unreachable, tool calls are now denied withPOLICY_DENIEDerror instead of silently auto-approved. Structured error info provides retry guidance. -
Pipeline hook result handling (
src/pipeline/manager.ts) —injectMessagesfrom hooks now spliced into the message context.storeside effects now persisted to session-scoped storage with accessor and cleanup functions.modifyInputnow applies at any pipeline stage (not just pre-assess). -
Session state cleanup (
src/pipeline/builtin.ts,src/agent/loop.ts) — Per-session state (summarizationStates,loopStatesMaps) cleaned up at turn end to prevent unbounded memory growth. -
Pre-completion checklist as system message (
src/pipeline/builtin.ts) — Changed from appending to LLM response to injecting a system message, so the LLM actually evaluates the self-check before the next reasoning round.
-
gVisor detection double-read (
src/sandbox/executor.ts) — FixedisGVisorAvailable()callingproc.output()twice (second call returning empty data), which silently disabled gVisor sandboxing. -
Eval runner memory DB pollution (
src/cli/eval-cmd.ts) — Changed fromgetMemoryDb()to isolatedinitSessionDb()to prevent eval transcripts from polluting the persistent memory store. -
Duplicate availability functions (
src/sandbox/executor.ts,src/sandbox/agent-sandbox.ts) — ConsolidatedisGVisorAvailable()andisDockerAvailable()intoexecutor.ts, re-exported fromagent-sandbox.ts.
-
Web UI authentication — PBKDF2 password hashing (200K iterations, SHA-256), session management
with 7-day cookie expiry, login page (
/login), onboarding page (/onboarding), andPOST /api/auth/login/POST /api/auth/logout/POST /api/auth/setup-password/POST /api/auth/change-passwordendpoints. Password complexity enforcement (8+ chars, 2 of 4 character classes). -
WebSocket authentication —
/wsendpoint now checks session cookies before upgrading connections; returns 401 whenrequireAuthis enabled and no valid session exists. Public endpoints (/api/health,/api/status,/api/system) bypass auth. -
requireAuthmiddleware (src/server/auth.ts):requireAuth()function for REST endpoints;hasPassword(),verifyPassword(),setupPassword(),changePassword(), session CRUD (createSession/validateSession/destroySession/getActiveSessions), cookie parsing andSet-Cookieheader generation. -
Onboarding CLI (
src/cli/onboarding/): 6-step animated setup flow with password creation, LLM provider selection (9 providers), AI personalization chat, agent personality picker (professional/friendly/developer), telemetry opt-in, and completion screen. Terminal animations, logo rendering, background effects, and personalization profile saving. -
Onboarding REST API —
POST /api/onboarding/provider(test + save provider config),POST /api/onboarding/profile/answer(interactive personalization Q&A),POST /api/onboarding/profile/skip(skip personalization),POST /api/onboarding/personality(set agent personality),POST /api/onboarding/telemetry(opt in/out),POST /api/onboarding/complete(finalize setup),GET /api/onboarding/status(check current state). -
Node Dispatch tool (
src/tools/builtin/node_dispatch.ts): Delegates work to distributed Cortex Nodes for remote execution. Supportsaction="list"(discovery),action="shell"/"file_read"/"file_write"/"code_exec"/"web_search"with node selection bynode_id,tier,group, orcapabilityfilters. Integrated into agent loop, sub-agents, service processes, and WebSocket sessions. -
Session routing (
src/hub/session-routing.ts): Routes node results back to originating sessions viaregisterPending/routeResult/onNodeResultpub/sub. Lens audit events logged for every routed result. -
Node context (
src/agent/node-context.ts): Builds a structured "Distributed Nodes" section for agent system prompts showing connected nodes, their capabilities, tiers, and groups. Injectsnode_dispatchusage instructions into the agent context. -
Plugin developer documentation — Three new docs:
-
docs/plugins/best-practices.md— single responsibility, error handling, input validation, timeout/cancellation, minimal permissions, per-kind guidance (ESM/MCP/WASM), testing, debugging, and anti-patterns. -
docs/plugins/publishing.md— marketplace account setup, web UI and API submission, review process, version management, marketplace API reference, and publishing best practices. -
docs/plugins/submission-standards.md— repository structure, semantic versioning rules, pre-release versioning, AI disclosure requirements (AI.md+aiDisclosuremanifest field), breaking change checklist, dependency versioning, pre-submission checklist (repository/code/versioning/documentation/legal), step-by-step submission guide, CI/CD with GitHub Actions, marketplace review standards, and resubmission guidance.
-
-
Plugin docs expansion —
getting-started.md: trust levels, plugin statuses table, web UI plugin management, setting field types reference, REST API table.developing.md: full lifecycle hook reference (6 hooks +onConfigChange), lifecycle sequence diagram, PluginContext API (state store, config store, logger, host API), enum params example.manifest-reference.md: plugin kinds (ESM/MCP/WASM) with protocol details, expanded capability descriptions, fullPluginModuleexports table, lifecycle hooks table,PluginContextAPI with type signatures,Tool/ToolDefinition/ToolParam/ToolCallResult/ToolContextinterfaces.README.md: architecture diagram, plugin store structure, trust levels table, documentation index. -
Plugin extension points —
onInstall,onActivate,onDeactivate,onUninstalllifecycle hooks;state.delete()andstate.list()onPluginStateStore; MCP tool creation via manifesttoolsdeclarations; middleware (pre/post) and event listener capabilities documented and implemented.
-
Codebase formatting pass — Widespread
deno fmtpass across 65+ source files for consistent line wrapping, import ordering, and bracket style per project config (100-char line width, 2-space indent, single quotes, semicolons). -
Plugin CLI enhancements —
cortex plugins verify,cortex plugins permissions,cortex plugins update --all,cortex plugins permissions --trustsubcommands added. Install from URL supported. - Settings page — Web auth section added to Security tab.
-
Settings page overhaul — Tabbed navigation with 7 organized sections (General, Providers &
Models, Model Router, Updates, User Profile, UI & Appearance, Security). All configuration fields
from
CortexConfigare now exposed in the web UI, including previously hidden settings: update channels, auto-update, user profile personalization, UI animations/background effects/color schemes, and web authentication controls. -
Password change API — New
POST /api/auth/change-passwordendpoint for changing the web UI password from the settings page. Requires current password verification. -
Plugin validation command —
cortex plugins validate [--fix]scans installed plugins for invalid entry points and optionally removes them.
- Plugin initialization order — Plugins now load after database migrations instead of during CLI parsing, preventing errors when the plugins table doesn't exist yet or contains invalid entries. Plugin load failures are now non-fatal with summary reporting.
- Plugin entry point validation — Invalid entry points (relative paths, bare filenames) are rejected with clear error messages before attempting to load.
-
Daemon mode (
cortex serve -d) — Fixed spawn to include--configandcwd, resolving import map errors that caused silent daemon startup failures. -
Daemon restart (
-rflag) — Fixed process detection to correctly find and stop existing server instances before restarting. -
Public status endpoints —
/api/health,/api/status, and/api/systemnow accessible without authentication, ensuring the frontend sidebar and status page show correct daemon states instead of silently falling back to "off". -
Status page crash — Added null guards for
diskandmemoryfields in the system status page to prevent "Cannot read properties of undefined" errors.
-
Distributed agent architecture — Cortex Hub coordinates remote Cortex Nodes over secure
WebSocket connections, replacing SSH-based remote control with a structured protocol:
-
Node Registry (
src/hub/node-registry.ts): DB-backed CRUD for Node records with vault-stored capability tokens. Nodes table (migration 015) tracks identity, tier, status, heartbeat, group, and directive history. -
Secure Node WebSocket endpoint (
src/hub/ws-node.ts):/ws/nodehandler on the Hub with token-based registration, heartbeat/ACK protocol with metrics payload (CPU%, memory, disk), 3-missed-ACK disconnect detection, streaming output viastream_chunk, directive cancel support, config push, and token rotation (rekey). -
Node event system:
onNodeEvent()/emitNodeEvent()firenode.connected,node.disconnected, andnode.errorevents for plugin/pipeline integration. -
Message protocol (
src/remote/types.ts): ExtendedNodeMessagetype with 14 message types includingstream_chunk,heartbeat_ack,cancel,config_update,rekey,NodeMetricsinterface, and backward-compatibleRemoteMessagealias.
-
Node Registry (
-
Capability tiers (
src/hub/capability-tiers.ts): Three deployment profiles constraining Node privileges —root(all tools/paths/commands),sudo(scoped commands via sudoers patterns, restricted paths),unprivileged(read-only + home-directory writes, no shell execution). Tier-aware policy enforcement at the Hub before dispatch and local defense-in-depth on the Node. -
Enhanced Node agent (
src/remote/agent.ts): Streaming output for long-running directives, local tier policy checks before execution, directive timeout enforcement (default 5 min) viaAbortController, exponential backoff reconnection (1s → 30s cap), heartbeat ACK tracking, system metrics collection from/procanddf, cancel/config_update/rekey directive handling.runNodeAgent()replacesrunRemoteAgent()with backward-compatible wrapper. -
Tier-directed validation (
src/security/validator.ts):validateNodeDirective()enforces a 4-layer defense model — tier tool allow-list, tier command restrictions, tier path restrictions, and cross-cutting policy rules with per-node filtering. -
Per-node policy profiles: Migration 016 adds
node_idcolumn topolicy_rulesenabling node-specific policy overrides.checkPolicy()andaddPolicy()accept optionalnodeIdparameter. -
CLI —
cortex node(src/cli/node.ts): 6 subcommands:register(generates token, stores in vault),list,show,deregister,rekey(token rotation),connect(run as a Node with configurable tier/endpoint/timeouts). -
REST API — Node endpoints:
POST /api/nodes(register),GET /api/nodes(list with tier/status/group filters),GET /api/nodes/:id,DELETE /api/nodes/:id(deregister),POST /api/nodes/:id/rekey,GET /api/nodes/:id/metrics,GET /api/nodes/:id/directives,GET /api/nodes/groups. - Web UI — Nodes page: Real-time node monitoring dashboard with summary stat cards, tier/status/ group filter bar, per-node cards with expandable metrics (recent heartbeats: CPU%, memory, disk, active directives, uptime) and directive history tables. 10-second auto-refresh.
-
Prometheus metrics for nodes: 5 new metric families —
cortex_node_directives_dispatched_total,cortex_node_directives_completed_total,cortex_node_directives_failed_total,cortex_node_connections,cortex_node_heartbeat_age_seconds. -
Systemd unit template —
deploy/cortex-node@.servicefor running Cortex Nodes as systemd services with environment variable configuration (CORTEX_NODE_TOKEN,CORTEX_HUB_ENDPOINT,CORTEX_NODE_TIER).
-
src/server/server.tsnow routes/ws/nodeto the new Node WebSocket handler alongside the existing/wsUI WebSocket handler. -
src/db/lens.tsEventTypeunion expanded with 7 node event types:node_connected,node_disconnected,node_heartbeat,node_directive,node_directive_dispatched,node_stream_chunk. -
RemoteAgentInfo,RemoteDirective,RemoteResulttypes insrc/remote/types.tsextended withstream,timeoutMs,NodeMetrics,StreamChunkfields;RemoteMessagerenamed toNodeMessagewith backward-compatible alias. -
dispatchDirective()in ws-node.ts returnsDispatchResult({dispatched, reason}) instead of boolean, with policy validation before dispatch.
-
Unified skills model — skills now track
origin(human|llm) and support full Markdowncontentstorage. Human-authored skills provide domain knowledge and conventions; LLM-extracted skills capture emerging patterns from agent tool sequences. -
Human-authored skill loading — skills can be loaded from
.cortex/skills/<name>/SKILL.mdfiles with YAML frontmatter (name,description,trigger_pattern). API endpointPOST /api/skills/load-humanand "Load .cortex/skills" button in the Web UI. -
Skill CRUD API — new endpoints for creating (
POST /api/skills), reading (GET /api/skills/detail?name=), and deleting (DELETE /api/skills?name=) skills.GET /api/skillsnow supports?origin=human|llmfiltering. -
Skill stats endpoint —
GET /api/skills/statsreturns total/human/llm counts and average success rate. -
Skill injection into agent context —
findMatchingSkills()andformatSkillsForPrompt()now inject relevant skills into the agent's system prompt before each reasoning turn. Skills withorigin='human'are always eligible; learned skills requiresuccess_rate >= 0.3to avoid steering the agent toward unproven patterns. -
Skill extraction from agent turns —
extractSkillFromSession()runs as a fire-and-forget background LLM call whenever 2+ tool calls are made in a turn, analyzing tool sequences to extract reusable skill patterns. Tool parameters are redacted for sensitive keys (api_key,token,password, etc.) before being sent to the extraction LLM. - Redesigned skills Web UI — filter tabs (All / Human / Learned), stats summary bar, click-to-expand skill detail with full content and step listing, and a full modal form for creating/editing human-authored skills with name, description, trigger pattern, and Markdown content fields. Edit buttons on human-authored skill cards load data into the modal pre-filled.
-
Migration 014 — adds
originandcontentcolumns to theprocedural_memorytable inmemory.db.
-
storeSkill()UPDATE now handlesoriginandcontentcolumns, uses conditional version bumping (only increments when steps/description/content actually change), and properly preservesoriginon upsert so human-authored skills don't revert to'llm'. -
listSkills()supports optionaloriginparameter for filtering. - Removed orphaned
maybeExtractSkill()function (replaced by directextractSkillFromSessioncalls in the agent loop).
- Unescaped single quotes in CSS
font-familyvalues inside JavaScript string literals caused browser syntax errors on the skills page. Fixed by removing unnecessary font quotes and using proper\\'escaping in onclick handlers per existing codebase patterns.
-
Memory heuristic learning — AI-driven memory self-improvement that runs daily
- Access tracking: records every retrieval to
access_countandlast_accessed, enabling usage-based reinforcement - Importance boosting: heavily-accessed memories (10+ hits) get +0.15 importance bump, moderate
(5+) get +0.05, with
access_countreset after each boost cycle - Decay slowing: frequently-accessed memories receive a one-time 1.3× half-life extension (episodic 14→18.2 days, semantic 30→39 days), capped at 90/180 days respectively
- Co-occurrence learning: analyzes entity pairs across episodic memories, creates or strengthens
related_tograph relations when entities co-occur 3+ times - Auto-categorization: 12 pattern-based rules auto-tag untagged semantic memories with categories (api, database, frontend, debugging, security, devops, etc.) and tags
- Memory health dashboard: aggregated metrics for active/stale counts, average decay, importance, access frequency, graph entity/relation counts, and reflection confidence
- All heuristic jobs run via
runHeuristicCycle()in the daily consolidation cycle
- Access tracking: records every retrieval to
- Richer memory search — search results now include entities, topics, tags, category, decay score with visual bar, and access count
-
Memory page tabs — rebuilt Web UI with Search, Graph, Reflections, and Health tabs
- Graph tab: entity browser with type badges, click-through traversal showing grouped relations with strength bars, and breadcrumb navigation
- Reflections tab: confidence-ranked pattern list with category badges and confidence bars
- Health tab: per-tier cards with total/active/stale counts, decay distribution bars, average metrics, and graph/reflection overview
-
New API endpoints —
GET /api/memory/health,GET /api/memory/reflections,GET /api/memory/graph/entities?q=,GET /api/memory/graph?entity=&depth= -
Centralized version module — extracted
getVersion()intosrc/config/version.ts, reused by main entrypoint, status API, and update installer
- Heuristic learning column mismatches:
last_accessed_atremoved from episodic (column didn't exist), fixed tolast_accessedon semantic,contextreplaced withmetadata(JSON) on graph_relations INSERT -
slowDecayForFrequentAccessnow guarded against daily compounding (only applies whenhalf_life_daysis at default) -
boostImportanceFromAccessnow resetsaccess_countafter each boost to prevent qualifying set from growing unbounded - Escaped single quotes in
esc()to prevent XSS via entity names in onclick handlers - Replaced dynamic
import('./heuristics.ts')with static import inretrieve()hot path -
getMemoryHealth()now uses 60s in-memory cache to avoid full table scans per request - Removed duplicate
ageStr()function in favor of existingtimeAgo()for consistent relative time formatting -
Pipeline hooks system (
src/pipeline/): 10-stage middleware architecture (pre/post-assess, pre/post-reason, pre/post-tool, pre/post-reflect, pre/post-output). Priority-ordered hook execution within each stage with abort support. Built-in hooks: content safety filter (@cortex/content-safety), prompt injection detector (@cortex/injection-guard), cost tracker (@cortex/cost-tracker), audit logger (@cortex/audit-log). Sync hooks block the pipeline; async hooks fire-and-forget. Timeout enforcement per hook (5s sync, 15s async). CLI:cortex hooks(list/init/disable). API:GET /api/hooks,POST /api/hooks/:name/disable. -
Enhanced onboarding wizard (
src/cli/setup.ts): 4-step first-run wizard (model provider → personality → channels → telemetry). Personality templates generate SOUL.md (professional/friendly/developer/custom). Channel selection (CLI only / CLI+Web / CLI+Discord / all). Connection test validates API key before saving. Post-install summary with next-step commands. -
Event triggers system (
src/triggers/): Webhook receiver with HMAC signature verification (GitHub, GitLab, generic providers). Filesystem watcher usingDeno.watchFswith configurable debounce and pattern matching. Git hook installer auto-placespost-receive/post-commitscripts. Rate limiting with sliding windows and cooldown periods. IP allowlisting for webhook endpoints. Jinja2-style prompt template rendering. Trigger-to-job mapping creates immediate agent turns. CLI:cortex triggers(list/add/remove/install-hooks/uninstall-hooks). API:POST /api/webhooks/:name. -
Observability (
src/observability/): Prometheus-compatible metrics (counter, gauge, histogram) with labels. 15 pre-registered metric families: agent turns/tokens/cost/errors, validator intents approved/rejected, executor actions/duration, scheduler jobs, memory consolidations, system CPU/memory/uptime. Prometheus/metricsendpoint on port 3000. OpenTelemetry-compatible trace spans with OTLP export support.registerMetric(),counterInc(),gaugeSet(),histogramObserve()API. -
Channel plugin API (
src/channels/):ChannelPlugininterface with connect/disconnect/onEvent/send/edit/react/delete/typing/upload. Canonical types for cross-platform events, targets, users, attachments, rich embeds. Channel manager handles registration, start/stop lifecycle, and agent binding. Event handler routing from platform events to agent turns. CLI:cortex channels(list/start/stop). -
MCP server (
src/mcp/server.ts): Cortex operates as a Model Context Protocol server. JSON-RPC 2.0 protocol support (initialize,tools/list,tools/call,resources/list,prompts/list). Dual transport: stdio mode (for Claude Desktop, VS Code) and HTTP mode (GET/POST/mcp). All Cortex tools exposed ascortex.*namespaced MCP tools. Built-in MCP tools:cortex.search_memory,cortex.list_sessions,cortex.health. CLI:cortex mcp(serve/stdio). -
Remote agent protocol (
src/remote/): Headless remote agents connect via WebSocket to a Cortex primary. Primary handles reasoning/memory/credentials; remote handles local filesystem/tools/execution. Registration flow with token authentication. Heartbeat-based health monitoring with automatic reconnection. Directive/result message protocol. Remote agent manager tracks connected agents and routes delegation. CLI:cortex remote(add/connect/remove). -
Terminal UI (
src/tui/terminal.ts): Full-screen interactive terminal interface with split-pane layout (70/30 chat/tools). Raw terminal input handling with ANSI escape codes. Scrollable message pane with user/assistant messages. Tool call status panel showing running/success/error with durations. Input line with command history (up/down navigation). Key bindings: Ctrl+C cancel, Ctrl+L clear, Up/Down history, Enter send. Status bar showing agent state, message count, token usage. CLI:cortex tui. -
Workflow engine (
src/workflow/engine.ts): Deterministic workflow DSL with.step(),.branch()/.if(),.parallel(),.goto(),.waitForApproval(). DAG execution with context passthrough between steps. Parallel step execution withPromise.allerror isolation. Human-in-the-loop approval viaworkflow.approve(). Built-inhealth-checkworkflow. CLI:cortex workflow(list/run/approve). -
Project workspaces (
src/projects/manager.ts): Per-project isolated directories under~/.cortex/data/projects/. Project config stores agent binding, tool allow-lists, and description. Auto-initialized directory structure. CLI:cortex projects(list/create/delete). -
Plugin namespace isolation (
src/plugins/namespace.ts):@author/plugin-nameidentity model with key-based author verification. Tool names auto-prefixed to@author/plugin-name/tool. Short-name aliases withsetToolAlias()/resolveAlias(). Collision detection: same author prefix → error, different authors → no collision. -
UI plugin slots (
src/plugins/ui-slots.ts): 5 slot types (sidebar, panel, modal, timeline-item, widget). Web component-based plugin registration with HTML/JS URL serving. Slot-specific HTML generation for dashboard injection. Message bus API with permission-limited commands (navigate, notification, config, query). -
Desktop automation (
src/desktop/automation.ts): 11 desktop actions (screenshot, click, dblclick, type, keypress, drag, clipboard get/set, wait, move, scroll).xdotool/scrot/xclipwrapper viaDeno.Command. Docker XFCE+noVNC container template with entrypoint script. CLI:cortex desktop(dockerfile/entrypoint/screenshot/click/type/clipboard). -
Desktop app scaffold (
desktop/src-tauri/): Tauri v2 project with system tray, global shortcuts, native notifications. Cargo.toml with tray-icon/notification/global-shortcut features. Main window with hide-to-tray behavior. Quick-ask event bridge. Platform bundle targets (deb, AppImage, dmg, msi). -
Memory backends interface (
src/memory/backends.ts): PluggableMemoryBackendinterface withretrieve()/write(). Backend registration viaregisterMemoryBackend(). Default SQLite backend. Extensible for Postgres, Chroma, Redis. -
Memory privacy controls (
src/memory/privacy.ts): Per-agentMemoryPrivacyPolicywith tier filtering, PII redaction (email, IP, SSN, card, API key patterns), and configurable retention periods.enforceMemoryRetention()for automatic expiry. -
OpenClaw migration tool (
src/cli/openclaw-migrate.ts): Imports SOUL.md, USER.md, MEMORY.md, AGENTS.md, TOOLS.md, and memory markdown files from~/.openclaw/into Cortex data directory. Memory content chunked and imported as session messages. Dry-run mode.
-
Agent loop refactored with pipeline hooks integration at all 10 stages. Built-in hooks auto-registered on first turn.
-
Setup wizard enhanced from single provider selection to full 4-step onboarding with personality templates, channel selection, connection testing, and telemetry consent.
-
Sub-agent type system (
src/agent/sub-agent-types.ts):- Five specialized sub-agent types:
explore(codebase search, read-only),general(full tool access, multi-step),plan(execution plans, read-only),code(file write/edit/shell),research(web search, read-only) - Each type has its own system prompt, tool allow-list, and max turn limit
- Type selection via
typeparameter on thesub_agenttool with enum validation - Type overrides flow through: tool →
spawnSubAgent()→ child process → session creation
- Five specialized sub-agent types:
-
Enhanced sub_agent tool (
src/tools/builtin/sub_agent.ts):- New
typeparameter with enum (explore,general,plan,code,research) - Comprehensive tool description with guidance on when to use sub-agents (parallel work, specialization, deep investigation), when not to use them, what each type does, and parallel usage instructions
- Type-based configuration automatically sets tool allow-lists and turn limits
- New
-
Intelligent delegation detection (
src/agent/metacog.ts):- New task signals:
isExploratory,isCodeTask,isPlanningTask,isComplex -
suggestedSubAgentsoutput field onMetaAssessmentrecommending specific sub-agent types - Enhanced detection: complex code+exploration → delegate to explorer, research+independent → parallelize with sub-agent types, pure exploration → delegate to explorer, destructive multi-step → suggest plan sub-agent
- Meta-cog guidance now includes concrete sub-agent type recommendations in system prompt
- New task signals:
-
Sub-agent guidance in agent soul (
src/agent/soul.ts):- Default SOUL.md now includes a "Sub-Agents" section with clear usage guidelines
- Documents all five sub-agent types, when to use each, and when NOT to use sub-agents
-
Session parent-child tracking:
- Migration 013 adds
parent_session_idcolumn and index tosessionstable (src/db/migrations/013_sessions_parent.sql) -
createSession()now accepts optionalparentSessionIdparameter - Sub-agent entry point persists parent session ID on session creation
- New DB functions:
getChildSessions(),getParentSession(),countChildSessions() -
deleteSession()clears parent references on orphaned children - API endpoint
GET /api/sessions/:id/childrenreturns all sub-agent sessions for a parent
- Migration 013 adds
-
Session parent-child visibility:
- Web UI session list shows channel type badges (explore, code, web, etc.) color-coded by type and
⤷ childbadge for sub-agent sessions - Session detail view shows
← parentlink to navigate up to parent session, and lists sub-agents as clickable links to navigate down into child sessions - CLI
cortex sessionsshows[channel-type]badges,⤷ N sub-agentsfor parents, and⤣ child of <id>for sub-agent sessions
- Web UI session list shows channel type badges (explore, code, web, etc.) color-coded by type and
-
sub_agenttool definition rewritten with comprehensive context for the LLM about delegation strategy, type selection, and parallel usage patterns -
SubAgentTaskinterface gainedsubAgentTypefield for type-based specialization -
spawnSubAgent()applies type-based overrides (system prompt, tools, max turns) before spawning -
sub-agent-entry.tscreates sessions with typed channel labels (subagent:explore,subagent:code, etc.) -
Plugin system Phase 3 — Web UI extension (
src/plugins/extensions/ui.ts,src/server/ui.ts):- Dynamic plugin panel tabs in the Web UI sidebar under "Plugin Panels" section
- Plugin panels render in sandboxed iframes with
postMessagebridge (window.CortexAPI) -
CortexUiApiprovides plugin panels withfetch,getConfig,setConfig,notify,onEvent,emit -
GET /api/plugins/:name/panelandGET /api/plugins/:name/panel.jsroutes serve plugin UI - Host-side
messageevent listener receives plugin notifications as toast messages -
GET /api/plugins/panelsreturns active plugin panels with metadata
-
Plugin system Phase 4 — Security & WASM:
- Permission resolution engine (
resolvePermissions()) merges declared capabilities with user overrides fromplugin_permission_overridestable -
deriveDenoWorkerPermissions()mapsPluginCapability[]toDeno.PermissionOptionsfor Worker sandboxing - SHA-256 integrity verification (
computeSha256(),verifyEntryPointIntegrity()) - Worker-based sandbox (
loadSandboxedEsmPlugin()) with JSON-RPC protocol, 30s init timeout - WASM plugin loader (
loadWasmPlugin()) with host ABI (log,http_request,get_config,set_state,get_state) - CLI:
cortex plugins verify <name>(integrity check),cortex plugins permissions <name> [--set cap=grant|deny](permission management)
- Permission resolution engine (
-
Plugin system Phase 5 — Marketplace integration & updates:
- Plugin update checker (
checkPluginUpdate(),applyPluginUpdate()) queries marketplace/source for newer versions -
cortex plugins update [name] [--all] [--check]— check and apply plugin updates -
cortex marketplace install <slug> [--yes]— install from marketplace with permission preview (highlights sensitive permissions) - Semver-aware version comparison and disable-update-re-enable update flow
- Plugin update checker (
-
UI bug fix: Fixed JavaScript parsing error in GitHub PR/Issue rendering (
\'→\\'escaping in template literal) that prevented the entire UI script from executing
-
plugins-cmd.tsgainedupdate,verify,permissionssubcommands -
marketplace-cmd.tsgainedinstallsubcommand with permission preview - Plugin list/enable/disable in Web UI uses
nameinstead ofid(matches Phase 1 breaking change)
- Unified type system with
PluginCapability,PluginManifest,PluginRow(aligned with migration 005 canonical schema) -
PluginManagersingleton orchestrating full install/enable/disable/remove lifecycle -
PluginContextfactory with scoped state store (plugin_statetable), config store (config.json/plugins.<name>), and namespaced logger -
EventBuswith plugin-scoped event filtering by manifest-declared event types - Tool auto-registration into
globalRegistryon plugin load, deregistration on unload - Lifecycle hooks:
onInstall,onLoad,onActivate,onDeactivate,onUnload,onUninstall,onConfigChange - Schema migration 012 — added
dependencies_json,trust_level,error_message,load_attempts,config_schema_jsoncolumns -
Plugin system Phase 2 — Extension points (CLI, Config, Providers)
- Dynamic CLI command registration from active plugins via
buildCliffyCommand()bridge - Plugin-provided LLM provider registration and factory retrieval
- Settings schema extraction from manifest
ui.settingswith REST endpointGET /api/plugins/:name/settings -
pluginsnamespace onCortexConfigfor per-plugin scoped configuration -
GET/PUT /api/plugins/:name/configendpoints for Web UI plugin settings -
GET /api/plugins/panelsendpoint returning active plugin UI panels
- Dynamic CLI command registration from active plugins via
- Plugin system docs:
docs/plugins/README.md,getting-started.md,developing.md,manifest-reference.md
-
Breaking: Plugin identifiers changed from auto-generated
idto pluginname(PK). API routes/api/plugins/:id→/api/plugins/:name. CLI commands use name instead of id. -
registry.tsrewritten to align with migration 005 canonical schema (24 columns) -
loader.tsrewritten with PluginContext injection and tool auto-registration -
chat.tsandws.tsuseglobalRegistrywith automatic plugin tool loading viapluginManager.loadAll() -
ToolRegistrygainedunregister()method -
CortexConfiggained optionalpluginsfield
-
Automated update system —
cortex updateCLI command with version checking, binary replacement, source git/tarball fallback, health checks, and automatic rollback-
cortex update— check and apply the latest release -
cortex update --check— dry-run check, no changes -
cortex update --channel pre— include pre-release versions -
cortex update --rollback— revert to previous version (24h grace period) -
cortex update --status— show current/latest version and channel -
cortex update --force— bypass dirty working tree check (source mode) -
UpdateConfigin~/.cortex/config.json:channel,checkOnStartup,autoUpdate,checkIntervalHours,githubToken,gpgKeyPath - GitHub API release fetching with 1-hour TTL caching (
~/.cortex/update-cache.json) - Install manifest (
~/.cortex/install.json) tracks source/binary mode, version, and rollback state - SHA-256 checksum verification + GPG signature verification for binary artifacts
- Lock file (
~/.cortex/update.lock) prevents concurrent update operations - Auto-check on daemon startup (notifies of available updates without auto-applying)
-
-
Self-contained binary mode — compiled
deno compilebinary supports--subprocessdispatch for validator, executor, scheduler, and supervisor, replacingdeno run <entry.ts>spawning-
src/main.tsdetects--subprocessflag before CLI parser and dispatches to the correct process function - Supervisor uses
isCompiledBinary()heuristic to choose--subprocess <name>vsdeno run --allow-all main.ts --subprocess <name>for child process spawning -
VERSIONfile at repo root — single source of version truth, enforced againstdeno.jsonin CI - Cross-compilation release workflow (
.github/workflows/release.yml) with matrix build for linux-x64, linux-arm64, darwin-x64, darwin-arm64, windows-x64
-
-
Kilo (AI Gateway) provider — OpenAI-compatible provider for the Kilo API at
api.kilo.ai- New
src/llm/kilo.tsprovider extendingOpenAICompatibleProviderwithkilo/sonnetas default model - Full 7-point registration: config type, default config, router switch, setup wizard, model lister, UI dropdowns, and settings metadata
- New
-
Marketplace connection — new Web UI marketplace page plus CLI commands to install plugins,
import agents, and discover items from cortexprism.io
- Web UI Marketplace page — dedicated page with tabbed browsing for plugins and agents, search bar with debounce, kind/category filters, one-click Install and Import buttons, stats bar showing total plugins/agents/downloads, and proxy API endpoints through the Cortex server
-
cortex plugin install marketplace:<host>/plugins/<slug>— resolves the marketplace: prefix, fetches the plugin manifest from the marketplace API, and installs it -
cortex agent import marketplace:<host>/agents/<slug>— resolves the marketplace: prefix, fetches the agent configuration from the marketplace API, and registers it as a local agent -
cortex agent import <url>— fetches an agent configuration from any URL, registers it as a local agent -
cortex marketplace list plugins— browse available plugins with search, kind, and category filters -
cortex marketplace list agents— browse available agents with search, provider, and category filters -
cortex marketplace categories— list marketplace categories with item counts -
cortex marketplace stats— display marketplace statistics (total plugins, agents, downloads)
-
Session resume — sessions can be reopened and continued across WebSocket reconnects, page
reloads, and CLI sessions
-
resumeSession()/deleteSession()DB functions insrc/db/sessions.ts -
POST /api/sessions/:id/resumeendpoint to reopen closed sessions -
DELETE /api/sessions/:idnow cleans up per-session DB files and session rows - WebSocket resume — existing
sessionIdfrom client reopens the per-session DB and reactivates the session - CLI
--resume/-sflag to resume an existing session by ID - Web UI "Continue" button on session list items and detail view
- Session detail view shows
session_messagesinstead of raw Lens events -
restoreSession()now reopens the session server-side via the resume API
-
-
Session persistence in chat UI —
sessionIdstored inlocalStorage, messages restored from session DB on page load - Per-agent session filtering — sessions page scoped by agent ID
- Token usage analytics — per-model breakdown with daily token/cost totals
- Command palette agent/session search — quick search across agents and sessions
- Agent workspace/session counts — displayed in agent cards in the UI
-
createSessioncrash on resume — check for existing session before INSERT to avoid primary key conflict - Chat session message query — fixed
/api/sessions/:id/messagesto querysession_messagestable -
file_renamelogging — missing audit trail entries - Undo/redo path filter — incorrect path matching that could apply operations to wrong files
- Global workspace undo/redo endpoints — missing route registrations
-
file_changeWebSocket events — broadcast on edits, renames, deletes - Editor delete button — now fires correctly from the UI
- CodeMirror
toTextArearemoveChildcrash — wrapped in try-catch for detached DOM - Editor layout, nested file creation, global workspace file read path group
- Agent/global workspace REST API — ensure workspace dir exists before access, strip leading slash from URL wildcard paths
- JS escape sequences consumed by outer template literal — use double backslash for
\',\n, and\/inside script blocks
-
10 new LLM providers (
src/llm/):-
Google Gemini (
google.ts) — native SDK integration with streaming and usage metadata -
Mistral AI (
mistral.ts) — OpenAI-compatible, uses Mistral's API -
Groq (
groq.ts) — fast inference via OpenAI-compatible API -
DeepSeek (
deepseek.ts) — DeepSeek Chat and Reasoner models -
OpenRouter (
openrouter.ts) — unified access to 200+ models -
xAI (Grok) (
xai.ts) — Grok models via xAI API -
Together AI (
together.ts) — 100+ open-source models -
AWS Bedrock (
bedrock.ts) — Converse API with Claude, Llama, Titan models -
Cohere (
cohere.ts) — Command R+ via Cohere v2 API -
OpenAICompatibleProvider(openai-compatible.ts) — reusable base class for any OpenAI-compatible API
-
Google Gemini (
-
Daemon supervisor with auto-restart (
src/processes/supervisor-process.ts):- Spawns and monitors validator, executor, and scheduler processes
- Auto-restarts crashed children with exponential backoff (
min(2^n × 1s, 30s)) - Graceful SIGINT/SIGTERM shutdown of all children
-
cortex daemon start— spawns supervisor in the background -
cortex daemon run— runs supervisor in the foreground (for systemd/tmux)
-
cortex serve --daemon/-d— run the HTTP server as a background daemon process -
Auto-start daemons —
cortex chatandcortex serveautomatically start the daemon supervisor if not already running -
cortex daemon restart— restart all daemon processes (stop + 1s delay + start) -
cortex serve --restart/-r— restart a background server by killing the existing process on the same port before starting a new one -
cortex stop— stop all background processes (HTTP server + daemons) with a single command-
--server-onlyand--daemon-onlyflags for targeted shutdown
-
-
cortex serve --stop/-s— stop a background HTTP server by port - LLM settings redesign — Add Model modal, model fetching from provider APIs, fine-tuning controls (temperature, max tokens, top-p)
-
Provider config —
ProviderConfignow supports optionalsecretKeyfield for providers requiring separate secret keys (e.g., AWS Bedrock) -
ProviderKindunion extended to include all 15 supported providers
-
serve -dverifies the server is actually running before exiting -
serve --restartexcludes own PID frompgrepresults -
serve --restartpreserves original--hostsetting by reading/proc/<pid>/cmdline
-
Workspace infrastructure (
src/workspace/) — agent-scoped private workspaces + shared global workspace:-
paths.ts—resolveWorkspacePathwith path traversal protection,ensureAgentWorkspace,getAgentWorkspaceDir,getGlobalWorkspaceDir -
git.ts—gitInit,gitAutoCommit,gitEnsureBranchviaDeno.Command
-
-
src/db/migrations/011_workspace.sql—workspace_configandfile_edit_logtables with agent/session/file tracking -
11 file system tools (
src/tools/builtin/workspace/):-
file_write— create/overwrite files with workspace targeting (agent|global) -
file_edit— line-based operations (insert/replace/delete) and search-replace blocks -
file_patch— unified diff patching via git apply or built-in fallback -
file_delete— delete with recursion support, refuses to delete workspace root -
file_rename— rename/move files within same workspace -
file_list— directory listing with type markers and optional recursive mode -
file_tree— indented tree view with configurable max depth -
file_info— file/directory metadata (size, type, timestamps, permissions) -
file_search— regex grep across workspace files with include filter -
file_undo/file_redo— revert/restore edits viafile_edit_logtable
-
-
Workspace REST API (
src/server/router.ts):- Global workspace file CRUD at
/api/workspace/files/*path - Per-agent workspace file CRUD at
/api/workspace/agents/:agentId/files/*path - Undo/redo endpoints for agent workspaces
- History query at
/api/workspace/history - Git log/diff/commit endpoints for agent workspaces
- Global workspace file CRUD at
-
Git-backed workspaces — every agent edit auto-commits with
workspace/<agent-id>branch naming -
CodeMirror 5 web editor (
src/server/ui.ts):- "Editor" tab in sidebar with file tree browser
- Per-agent and global workspace tabs
- Syntax highlighting for JS, TS, Python, HTML, CSS, Markdown, YAML, SQL
- Save (Ctrl+S), undo/redo buttons
- File creation, unsaved changes indicator, git status display
-
Path-based policy checking (
src/security/validator.ts,src/security/policy.ts) — file tool paths validated againstpathpolicy rules before execution -
ToolContextextended withagentIdandworkspaceDirfields -
ToolCapabilityextended withfs:list,fs:edit,fs:delete,fs:search -
PATHS.workspacesDirconfig getter - Workspace tools registered in WebSocket chat and sub-agent entry point
-
Setup flow —
cortex setupnow includes provider key configuration for all 15 providers
-
Command palette —
Ctrl+K/Cmd+Koverlay for instant page navigation with search, keyboard arrows, and Enter to navigate - Sidebar quick search — filter input at top of nav to show only matching pages
- Sidebar section headers — pages grouped into Core, Intelligence, Management, Configuration, Monitoring categories
- Active nav indicator — left accent bar on active page item
- Sidebar reorganized: Chat moved to first position (primary page), sections with descriptive headers, improved visual hierarchy with active state indicator bar
- Jobs page merged with Cron: Cron modal moved into Jobs page, standalone Cron nav item removed, "+ New Job" button added to Jobs page header
- Default landing page changed from Status to Chat — more natural entry point
- Activity page (formerly Lens) renamed in nav for clarity
- Reduced net nav items from 16 to 15 by merging Cron into Jobs
-
Sub-agent system (
src/agent/sub-agent.ts):-
spawnSubAgent()spawns a child Deno process, communicates via stdin/stdout JSON-line protocol -
src/processes/sub-agent-entry.ts— process entry point: receives task via stdin, runsagentTurnwith its own provider/model/tools/identity, streams response chunks -
src/tools/builtin/sub_agent.ts— agents can delegate independent tasks to sub-agents with configurable agent ID, model, provider, tools, system prompt; runs concurrently
-
-
Micro-service manager (
src/services/manager.ts):-
registerService,listServices,getService,updateService,deleteService— CRUD for service definitions incortex.db -
startService,stopService— spawn/kill service processes with PID tracking - Health monitoring loop with configurable interval
- Auto-restart with exponential backoff on crash
-
startAutoServices— boot-time launch of auto-start services
-
-
src/processes/service-entry.ts— Service process entry point: runs a persistent agent with HTTP server (if port configured), handles/chatand/healthendpoints -
cortex serviceCLI (src/cli/service-cmd.ts) — 7 subcommands: list, show, create, update, delete, start, stop -
src/db/migrations/010_services.sql— services table with fields for agent config, port, health check, auto-restart, env vars - Service REST API endpoints: CRUD + start/stop
- Web UI Services page — service cards with status indicator, start/stop buttons, agent/model/tools/port details
-
sub_agenttool registered in both WebSocket chat and CLI chat
-
Agent manager (
src/agent/manager.ts):-
registerAgent,getAgent,getDefaultAgent,listAgents,updateAgent,deleteAgent,selectAgent,loadAgentIdentity -
ensureDefaultAgent— ensures a default agent always exists in config -
resolveAgentTools— tool allow-list resolution
-
-
cortex agentCLI (src/cli/agent-cmd.ts) — 7 subcommands: list, show, create, update, delete, select, inspect - Agent REST API — 8 endpoints for agent CRUD and identity inspection
-
WebSocket agent support —
select_agentandnew_sessionmessage types, per-agent provider/model/tools/soul in chat -
Agent selection in CLI chat —
--agentand--list-agentsflags - Web UI Agents page — dedicated management page with CRUD modal and chat header agent selector
-
Config persistence —
agentsregistry anddefaultAgentfield in cortex config file
- SVG icon system — replaced all emoji nav icons with Feather-style SVGs
- Responsive sidebar — hamburger toggle for mobile layout
- Toast notification system — feedback for all write actions across the UI
- Skeleton loading screens — shimmer placeholders on Status page
- Visual empty states — contextual icons and messages across all data pages
- Page transitions — smooth fade-in animations on navigation
-
Relative time display —
timeAgoformatting in Lens event timeline - Chat header — session badge, New Chat button, History button
- API key masking — Settings shows "✓ set" instead of full key value
- Card hover effects — subtle elevation on interactive elements
- Custom scrollbar styling — dark theme scrollbars throughout
- Daemon process crash — added
--allow-ffipermission for libsql native binding
-
Plugin management (
src/cli/plugins-cmd.ts,src/plugins/registry.ts,src/plugins/loader.ts):-
cortex plugins list— list installed plugins with kind/version/status -
cortex plugins install <source>— install from file, URL, or marketplace reference -
cortex plugins enable/disable/remove— lifecycle management - ESM plugin loading via dynamic
import(), MCP plugin loading via JSON-RPC POST - WASM plugin type defined but not yet supported
-
-
Web UI pages:
- Plugins page — list, enable/disable toggle, remove, install modal (name, kind, entry point, description, author)
- Soul page — full-screen editor for SOUL.md / USER.md / MEMORY.md with file switcher, save, path breadcrumb, quick-append to MEMORY.md
- Cron/Jobs page — job list with status badges, last/next run times, trigger-now/cancel/delete, New Job modal with preset command hints
- Logs page — monospace log table colour-coded by event type (errors red, llm_call purple, tool_call yellow, memory blue, policy orange); level filter, line count picker, auto-refresh toggle
-
New REST API endpoints:
-
GET/POST /api/plugins,POST /api/plugins/install -
POST /api/plugins/:id/enable|disable,DELETE /api/plugins/:id -
POST /api/jobs,POST /api/jobs/:id/cancel|trigger,DELETE /api/jobs/:id -
GET /api/soul/:file(soul|user|memory),PUT /api/soul/:file POST /api/soul/memory/appendGET /api/logs?lines=N&level=error|warning
-
- Status page — active sessions, version, uptime, daemon pings, memory/disk bars, recent sessions
- Analytics page — Chart.js token usage chart (stacked bar, daily), per-model breakdown table, cost totals
- Sessions page — full list with FTS search, export JSON, delete; detail view with full message history
- Settings page — live config editor (agent name, provider, max turns, stream), API key management per provider, model router toggle/threshold
-
New API endpoints:
GET /api/config,PUT /api/config,PUT /api/config/provider,GET /api/analytics?days=N,GET /api/system,GET /api/sessions/search?q=,DELETE /api/sessions/:id - Fix route ordering: sessions/search moved above :id wildcard
- Sidebar layout: nav, session list, daemon status footer
- Markdown rendering via marked.js for agent responses
- Chat bubbles (user right-aligned, agent left)
- Animated typing indicator with token counter
- 6 pages: Chat, Lens, Memory, Jobs, Skills, Policies
- Lens: filterable event timeline with colour-coded event types
- Memory: stat cards (episodic/semantic/reflection/procedural counts) + search
- Skills: success rate bars, step badges, trigger patterns
- Policies: allow/deny table with kind, pattern, priority
- Auto-resize textarea, Enter to send, Shift+Enter for newline
- Provider/model label and daemon health in sidebar
-
ws.tsswitched toloadSoulContext(SOUL+USER+MEMORY)
-
Memory system (5-tier):
- T3 semantic: SQL decay pre-filter, 500-row cap (
src/memory/) - T4 graph: entity extraction, BFS traversal, retrieval integration
- T4 procedural: skills.ts — store/match/record/extract
- T5 consolidation: hourly/daily/weekly runners, cron scheduler
- Streaming token/cost tracking across all LLM providers
- T3 semantic: SQL decay pre-filter, 500-row cap (
-
Agent system:
- Meta-cognition pipeline step: pre-LLM task assessment
- SOUL.md family: USER.md + MEMORY.md loaded into system prompt
-
IPC & Processes:
- Unix socket transport with newline-delimited JSON framing
- Validator, Executor, Scheduler standalone daemon processes
- Intent client with transparent validator routing
-
cortex daemon start/status/stopCLI
-
Security:
- CPL YAML policy language parser and importer
-
cortex policy init/importCLI - Lens EventType expanded from 8 to 35 types
-
Channels & Plugins:
- Discord Gateway WebSocket adapter with per-user sessions
- Plugin system foundation: ESM + MCP registry and loader
-
cortex import openclaw/jsonmigration tool
Initial release of CortexPrism — open-source agentic harness system with multi-provider LLM support, 5-tier memory, parallax security, plugin system, and web UI.
- CLI agent chat with 5 LLM providers (Anthropic, OpenAI, Ollama, plus 10 more added in subsequent versions)
- Multi-tier memory (episodic, semantic, graph, procedural, consolidation)
- Policy-based security with YAML policy language
- Plugin system (ESM, MCP)
- Discord channel integration
- Web UI for chat, system management, and monitoring
- Session management and analytics
CortexPrism — Open-source AI agent operating system · Discord · Apache 2.0 License · Built with Deno 2.x + TypeScript
- Agent Loop
- Built-in Agents
- Metacognition
- Memory System
- Skills System
- Sub-Agents
- Built-in Tools
- Code Intelligence
- Code Sandbox
- Cross-Agent Context Protocol
- Prompt Lab
- PKM Assistant
- Voice Pipeline
- Computer Use
- Browser Tool
- Git & GitHub
- Scheduler & Jobs
- Dashboard
- Observability
- A2A Protocol
- MCP Gateway
- Distributed Nodes
- Memori Checkpoints
- Eval System
- Workflow Engine
- Triggers
- Projects
- TUI
- Glossary
- Update System
- Chrome Bridge
- Swarm
- AgentLint
- Model Benchmarking
- Smart Context
- Cost Optimizer