WeKnora/migrations/versioned
nullptr-error 5df788dc77
feat(sandbox) (#2301)
* cubesandbox support

* feat(agent): add sandbox shell execution, file management tools, and Artifacts collection/download system

- Add three sandbox agent tools: shell_exec / sandbox_ls / sandbox_read
  - shell_exec: safely execute shell commands in session sandbox with timeout & output truncation
  - sandbox_ls: enumerate files under sandbox artifact output directory with recursive listing & pagination
  - sandbox_read: read sandbox file content with offset-based chunked reading
- Add Artifacts system:
  - ArtifactCollector: real-time collection of sandbox tool output files, attached to messages
  - /api/artifacts/{session_id}/{message_id}/{filename}: download endpoint for frontend
  - ChatArtifactsDrawer.vue: frontend artifacts sidebar UI
  - DB migration 000066_message_artifacts: add artifacts column to messages table
- Attachment sandbox staging: upload user attachments to session sandbox on QA request for skill tool access
- Update Agent Prompts: add shell/sandbox tool usage constraints and safety rules
- Extend Agent Observe: include agent steps in Langfuse observability tracing
- Refactor Sandbox SessionManager: support session-scoped file listing, reading, and status queries
- Frontend: render artifact events in AgentStreamDisplay, i18n updates for 4 locales
- Add comprehensive tests: shell_exec_test, sandbox_read_test, artifact_collector_test, etc.

* feat(agent):add remote sandbox client abstract  & client errors

* feat(sandbox): implement Redis binding store with distributed lifecycle lock;

* feat(sandbox): add remote session lifecycle with ownership context

Implement remoteSessionLifecycle to coordinate persistent remote sandboxes
across multi-instance deployments. Supports Resolve (lazy provision,
recovery, race-safe create) and Destroy with compare-delete semantics.
Add ownership context isolation to decouple remote resource cleanup from
request cancellation.

* feat(sandbox): add CubeRemoteClient adapter for RemoteSandboxClient

Implement CubeRemoteClient as a provider-neutral RemoteSandboxClient
implementation. Error normalization, timeout mapping, and metadata
support are fully integrated. SDK details remain private to the
adapter.

* refactor(sandbox): decouple SessionBoundManager from Cube

Remove internal/sandbox/cube.go (CubeSandbox, sync.Map reaper). Add
RemoteSandbox as provider-neutral Sandbox interface implementation.
Rewrite SessionBoundManager to depend on RemoteSandboxClient +
SessionSandboxBindingStore + SessionExistenceChecker, with all
lifecycle ops delegated to remoteSessionLifecycle (Redis + distributed
lock). Application-layer interfaces migrated to RemoteDirEntry/StatEntry
with time.Time ModTime. Cleanup delegated to provider idle-timeout.

* refactor(agent): enhance session capability handling in sandbox manager

- Introduced sessionFileStore and sessionShellExecutor functions to centralize capability checks for session-scoped file and shell execution.
- Updated agent service to register tools based on the presence of session filesystem capabilities, improving compatibility with various sandbox backends.
- Refactored tests to validate behavior when session capabilities are absent, ensuring robust handling of different sandbox types.
- Removed Cube-specific checks, promoting a more provider-neutral approach to session management.

* refactor(sandbox): add E2B backend, modernize Cube adapter, and enable multi-instance Redis binding

- Add e2b_remote_client.go (~850 lines) — full RemoteSandboxClient implementation
  covering lifecycle, execution, and filesystem ops (ListDir/Stat/MakeDir/Remove)
- Wire E2B into NewManagerFromType and container/bootstrap path (buildE2BManager)
- Dependency: matiasinsaurralde/go-e2b v0.1.0

- Cut ~1500 lines of legacy SDK wrapper (cube_client.go, cube_envd.go,
  cube_defaults.go) and replace with direct *cubesandbox.Client usage
- Parse CubeProxy URL directly in adapter (parseProxyURL), removing the
  old hand-rolled envd transport layer
- Pass lifecycle extra fields (onTimeout, autoResume) via SDK CreateOptions.Extra
- Target Cube deployment v0.5.1

- Add RemoteNetworkPolicy to RemoteCreateRequest with AllowInternetAccess,
  AllowPublicTraffic, AllowOut/DenyOut — shared by Cube and E2B adapters
- Both adapters default to permissive (internet+public on) for backwards compat

- Add selectSessionBindingStore() — Redis-backed or in-memory, controlled by
  WEKNORA_SANDBOX_REDIS_NAMESPACE / WEKNORA_REDIS_NAMESPACE
- Add repositorySessionExistenceChecker — checks session existence via DB
  (gorm.ErrRecordNotFound → not exists, transient errors → preserve binding)
- newSandboxManager() now accepts redisClient + sessionRepo; deprecated
  hardcoded NewMemorySessionSandboxBindingStore() in production path

- buildSessionCreateRequest default timeout action: Kill → Pause+AutoResume
  (Cube and E2B). Sessions survive brief idle periods; providers still
  handle TTL-based reaping.

- buildSessionCreateRequest() and effectiveHTTPTimeout() parameterized
  by RemoteProvider (was hardcoded to Cube Config fields)
- NewSessionBoundManager validates provider and delegates defaults to
  per-provider apply*Defaults helpers

- Legacy SDK wrapper: cube_client.go, cube_envd.go, cube_defaults.go,
  cube_envd_test.go, cube_net_diag_test.go, cube_test.go (~2500 lines)
- Unused helpers: DefaultManager.validateExecution, IsRemoteTerminal,
  IsRemoteUnsupported, IsRemoteTransient, ShouldPreserveRemoteBinding
- Dead Config fields: CubeEnvdPort, CubeIdleTTL, AllowedCmds
- Dead ExecuteResult method: GetOutput
- Unused test: session_artifacts_integration_test.go
- Preloaded skill: sandbox-test-python

- Extract shared httpErrorKind() from per-adapter normalize functions
- Add SupportsFilesystemEnumeration capability flag — gates SessionFileStore
  advertisement (E2B returns true post-reconnect, Cube always true)
- Fix stale comments: Cube-only → remote backends, remove "tomorrow"/"future"
- Bump session sandbox TTL defaults: 604800s → 300s (.env.example)
- Update docs/agent-skills.md: full multi-instance deployment guide

Total: 29 files, +1188 / -3721

* feat(agent): bind collected skill artifacts to owning message in resource registry

When ArtifactCollector persists a skill-generated file it now registers a
resource:// binding (owner_type=message, owner_id=assistantMessageID,
relation=artifact) in addition to the messages.artifacts JSONB record. This
mirrors how knowledge uploads and chat attachments bind their resources, so
artifacts can be enumerated and garbage-collected through the resource
registry instead of only via the message JSONB column.

- ArtifactCollector: inject ResourceCatalog, add messageID to Collect/
  maybePersist, and add best-effort bindArtifactResource (binding failures are
  logged, never drop the artifact; only resource:// refs are bound).
- agent_stream_handler: pass assistantMessageID into Collect.
- Renumber message_artifacts migration 000066 -> 000077 to resolve the
  version collision with existing migrations (upstream now uses 000075/000076).
- Tests: update collector signatures and add coverage for the binding path
  and for graceful degradation when Bind fails.

Note: binding applies to newly generated artifacts only; existing rows are
not backfilled.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(sandbox): harden remote sandbox security and artifact collection

Disable Cube local fallback so skill scripts never run on the host when
the remote provider is unavailable. Require Redis for cube/e2b binding
unless WEKNORA_SANDBOX_ALLOW_MEMORY_BINDING=true for single-node dev.

Collect artifacts with WithoutCancel so user stop does not drop files,
reject shell_exec work_dir outside /workspace, and refuse session-scoped
Execute when a local fallback would be engaged.

* fix(ci): gofmt sandbox files and resolve artifact drawer type error

Apply gofmt to PR-touched Go files and narrow ChatArtifactsDrawer
props in AgentStreamDisplay so session-id is always a string.

* fix(sandbox): adapt to upstream main after rebase

Renumber the message_artifacts migration 000077 -> 000079: upstream now
uses 000077_remove_wiki_log and 000078_chunk_editing_and_custom_metadata.

Declare empty model-handle policies for shell_exec / list_sandbox_files /
read_sandbox_file. Upstream added a coverage test requiring every
UI-exposed tool to declare one; sandbox output is arbitrary skill-authored
content, so it gets the same treatment as execute_skill_script.

Co-authored-by: Cursor <cursoragent@cursor.com>

* feat(sandbox): replace single tenant sandbox config column with a configs table to support multi-sandbox config per tenant.

* feat(sandbox): add sandbox config entity, cordon lease and session pin field

* feat(sandbox): add sandbox config repository with tenant scoping and cordon lease

* feat(sandbox): stamp sandbox config ID onto sandbox metadata

* feat(sandbox): scope sandbox listing, release and reaping to a single config

* feat(sandbox): resolve managers per config and refuse cordoned or missing configs

* feat(sandbox): implement session pinning and config identity change detection

- Add SessionSandboxPinner with read/pin/clear to bind session to config
- Refactor four entry points (execute/attachment/artifact/destroy) to use pinned config
- Add config_identity.go to detect identity changes by effective values (APIURL/APIKey/Domain/ProxyURL)
- Add SandboxIdentityChanged with key-masked comparison to prevent false 409 conflicts
- Fix artifact collection for default backend and destroy for legacy empty-pin sessions

* feat(sandbox): add multi-tenant sandbox config management and HTTP APIs

Service layer:
- Add sandbox config business service supporting CRUD and inventory listing
- For non-identity changes (e.g., template, TTL), save directly without locking or remote interactions
- For identity changes (e.g., API key, endpoint), reject save if there are still live sandboxes under this config on the remote side,
  and return structured inventory details (sandbox count, affected sessions, related agents) for frontend prompting
- Before deleting a config, check remote live sandboxes; if occupied, reject and prompt user to end sessions or create a new config
- Identity comparison based on effective values to avoid normal saves being misidentified as credential rotation

HTTP interfaces and routing:
- Add REST endpoints for sandbox config (List/Create/Get/Update/Delete/Inventory)
- Mask sensitive credentials (API key, etc.) in all read responses
- Return 409 with structured inventory details on rejection scenarios
- sandbox-check probing supports specifying an existing config_id directly
- Remove old handler file, consolidate validation logic into service layer
- DI wiring and route registration for all six endpoints

* feat(sandbox): add sandbox_config_id field to allow agent referencing named sandbox config

- Add SandboxConfigID field to CustomAgentConfig with omitempty; empty value falls back to global defaults
- Validate config existence on create/update; return 400 if not found
- Inject sandboxConfigService into CustomAgentHandler
- Add unit tests covering field serialization and validation logic

* feat(sandbox, agent): Migrate sandbox config to multi-config CRUD, support named backend selection and workspace scripts policy

Migrate frontend API from legacy KV single-config to /sandbox-configs REST interface, supplement type definitions, detection methods and policy fields; refactor sandbox settings page to multi-config card grid, manage configs with cube/e2b tabs, add editor drawer for create/edit/delete, connection testing and occupancy hints, and add workspace scripts policy toggle; add sandbox config dropdown in Agent editor skill section, integrate config caching, and support selecting named config or falling back to deployment default.

* feat(sandbox): Unify sandbox disable semantics and add tenant-level policy master switch

- Backend: Unify interception in resolveTenantSandboxForConfig with priority: global disable > tenant disable > default fallback > named config; add deploymentSandboxDisabled() using env var to avoid mis‑impacting named E2B; update WorkspaceSandboxPolicy comment as master switch for entire workspace; add unit tests for various scenarios.
- Frontend: Sync i18n copy: button text changed to "Disable/Enable sandbox execution"; confirmation dialog clarifies impact scope; success/failure messages aligned.
- Semantic layering: WEKNORA_SANDBOX_MODE=disabled disables globally; tenant‑level "Disable sandbox execution" only disables for the current workspace.

* feat(sandbox): Add SSRF protection, Agent binding to named configs, and reference query capabilities

- Add outbound URL security guard to validate Cube/E2B API/Proxy addresses against SSRF (including cloud metadata), support allowing private endpoints via env var, link-local always blocked
- Add named backend type validation, only cube/e2b can be stored as workspace named config
- Add sandbox config ID field to Agent at runtime, resolve sandbox for attachments and execution based on Agent's selected named config instead of always global default
- Add query to list Agents referencing a sandbox config ID, useful for deletion/changes to show dependents
- Adapt artifact collector and other callers to fill missing resolve signature parameter

* fix(sandbox): fix session teardown and config-update, add HTTP pool sharing for Cube

Session teardown & deletion ordering
- Move sandbox destroy (and pin `Clear`) before soft‑delete operations (`DeleteSession`/`BatchDeleteSessions`/`DeleteAllSessions`) to prevent remote sandbox leaks and stale pins.
- Pass deployment‑wide `SessionBoundManager` as fallback into `resolveTenantSandboxForConfig` for sentinel pins (`"-"`) to support deployment‑default sessions.

## Config update edge cases
- When identity fields change but old credentials cannot build a client or list config sandboxes, log a warning and proceed with the update instead of returning `sandbox_inventory_unverifiable`; live sandboxes still return 409.
- UI: move `sandboxes_still_live` / `unverifiable` alerts to the top of the sandbox config drawer and auto‑scroll on save refusal and connectivity check results.

Artifact collection for Cube skills
- Pre‑create `/workspace/output` via envd with correct ownership/permissions for `DefaultSandboxExecUser` to ensure Cube skill artifacts are collected properly by `ArtifactCollector`.

HTTP pool sharing for named Cube configs
- Named sandbox configs rebuilt a client on every `Resolve`, causing fresh TCP connections to CubeAPI and the envd proxy on each request.
- Add `CubeTransportPool` and `cubeSplitTransport`:
  - Control plane traffic reuses the same `SharedTransport` as E2B.
  - Data plane traffic uses a guarded transport cached per proxy host:port, preserving the sandbox `Host` header.
- Wire the pool through the tenant resolver `buildClient`; keep SDK defaults for the deployment‑default manager and connectivity probes.

* feat(sandbox): sandbox execution DefaultUser change from root to user

* fix(multi-sandbox-config-per-tenant): align deployment config with tenant resolver and centralize defaults

- Merge form overrides onto DeploymentConfig() via WEKNORA_SANDBOX_* env vars
  instead of DefaultConfig() hardcoded values, allowing empty fields to inherit
  from .env rather than Go constants
- Centralize deployment baseline parsing in sandbox/defaults.go with
  DeploymentConfig, CubeConfigFromEnv, E2BConfigFromEnv
- Delegate container startup to shared helpers to avoid drift
- Propagate tenant env_vars through ResolveEffectiveConfig into
  buildSessionCreateRequest for both Cube and E2B session sandboxes

* fix(multi-sandbox-config-per-tenant): fix some bugs frontend.

* fix(sandbox): guard check-path dials, fix staging gate and shared-agent binding tenant

Three defects found while reviewing the remote sandbox work:

- The Cube connectivity probe and the deployment-default Cube/E2B managers
  built clients without a guarded transport, so an admin-supplied api_url or
  proxy_url could reach link-local addresses via DNS rebinding even though
  save-time validation passed. All three now dial through the same outbound
  guard the per-tenant resolver enforces.

- Attachment staging was gated on the process-wide manager, so a workspace
  pointing an agent at a named Cube/E2B config while the deployment default
  stayed docker/local would run its tools remotely against an empty
  /workspace/input. The gate now resolves the manager the session actually
  runs on.

- Session to sandbox bindings were keyed by the tenant in context, which a
  shared agent deliberately swaps for the agent owner's so models, KBs and
  named configs resolve in the sharing workspace. Session deletion only ever
  knows the session's own tenant, so teardown looked up a key nobody wrote
  and abandoned a paused MicroVM that keeps billing. The binding tenant is
  now carried separately and survives CloneContext.

* chore(sandbox): renumber migrations above upstream and de-collide test stub

Upstream main took 000079 (knowledge_folder_path) and 000080
(knowledge_base_auto_tag_config) while this branch was open, so the three
sandbox migrations move to 000081-000083. golang-migrate requires unique,
ordered versions, and the RAISE NOTICE labels move with the file names.

Main also added a handler test declaring stubSessionService in the same
package; the artifact download test's configurable variant is renamed rather
than merged, since the two stubs answer GetSession differently.

---------

Co-authored-by: hailongzhao <hailongzhao@tencent.com>
Co-authored-by: wizardchen <wizardchen@tencent.com>
2026-08-10 21:28:20 +08:00
..
000000_init.down.sql feat(database): update database initialization to conditionally handle embeddings 2025-12-10 17:13:30 +08:00
000000_init.up.sql fix(schema): expand knowledge source length 2026-06-05 15:12:25 +08:00
000001_agent.down.sql feat(database): update database initialization to conditionally handle embeddings 2025-12-10 17:13:30 +08:00
000001_agent.up.sql feat(database): update database initialization to conditionally handle embeddings 2025-12-10 17:13:30 +08:00
000002_embeddings.down.sql feat(database): update database initialization to conditionally handle embeddings 2025-12-10 17:13:30 +08:00
000002_embeddings.up.sql feat(database): update database initialization to conditionally handle embeddings 2025-12-10 17:13:30 +08:00
000003_chunk_flags.down.sql feat: 新增FAQ推荐标签和批量操作支持,优化标签删除逻辑 2025-12-12 19:57:08 +08:00
000003_chunk_flags.up.sql feat: 新增FAQ推荐标签和批量操作支持,优化标签删除逻辑 2025-12-12 19:57:08 +08:00
000004_drop_vlm_model_id.down.sql fix: 强制移除knowledge_bases表中的历史vlm_model_id字段 2025-12-22 13:11:31 +08:00
000004_drop_vlm_model_id.up.sql fix: 强制移除knowledge_bases表中的历史vlm_model_id字段 2025-12-22 13:11:31 +08:00
000005_mentioned_items.down.sql feat: 支持在消息流中展示@的知识库和文件 2025-12-22 13:11:31 +08:00
000005_mentioned_items.up.sql feat: 支持在消息流中展示@的知识库和文件 2025-12-22 13:11:31 +08:00
000006_custom_agents.down.sql refactor: 调整智能体配置,增强智能体选择与状态管理 2025-12-26 21:31:02 +08:00
000006_custom_agents.up.sql refactor: 调整智能体配置,增强智能体选择与状态管理 2025-12-26 21:31:02 +08:00
000007_embeddings_tag_id.down.sql feat: 支持FAQ两级优先级标签过滤 2025-12-30 19:44:53 +08:00
000007_embeddings_tag_id.up.sql docs: sync changes to v0.2.8 changelog 2025-12-31 19:54:03 +08:00
000008_migrate_untagged_faq.down.sql feat: 支持删除文档类型标签 2026-01-15 19:38:16 +08:00
000008_migrate_untagged_faq.up.sql fix: guard pg_search update with skip_embedding 2026-03-19 22:03:09 +08:00
000009_add_last_faq_import_result.down.sql feat: 支持删除文档类型标签 2026-01-15 19:38:16 +08:00
000009_add_last_faq_import_result.up.sql feat: 支持删除文档类型标签 2026-01-15 19:38:16 +08:00
000010_add_seq_id.down.sql feat: 为 FAQ 和标签引入 seq_id 支持 2026-01-14 17:13:44 +08:00
000010_add_seq_id.up.sql feat: 为 FAQ 和标签引入 seq_id 支持 2026-01-14 17:13:44 +08:00
000011_pg_search_update.down.sql feat(migrations): add pg_search extension update migration files 2026-01-30 19:30:35 +08:00
000011_pg_search_update.up.sql fix: guard pg_search update with skip_embedding 2026-03-19 22:03:09 +08:00
000012_organizations.down.sql feat(agent): enhance agent and skill management features 2026-02-09 11:40:25 +08:00
000012_organizations.up.sql feat(agent): enhance agent and skill management features 2026-02-09 11:40:25 +08:00
000013_engine_configs.down.sql feat: introduce WeKnora Lite edition with lightweight configuration and deployment 2026-03-02 21:21:49 +08:00
000013_engine_configs.up.sql refactor: remove mineru_api_base_url from ParserEngineConfig and related components 2026-03-03 13:24:20 +08:00
000014_storage_provider_config.down.sql feat: introduce storage provider configuration and enhance backward compatibility 2026-03-02 21:21:49 +08:00
000014_storage_provider_config.up.sql feat: introduce storage provider configuration and enhance backward compatibility 2026-03-02 21:21:49 +08:00
000015_add_is_fallback.down.sql feat: add fallback response handling and UI indicators 2026-03-05 18:14:14 +08:00
000015_add_is_fallback.up.sql feat: add fallback response handling and UI indicators 2026-03-05 18:14:14 +08:00
000016_add_kb_pinned.down.sql feat: add pinning functionality for knowledge bases 2026-03-05 18:14:14 +08:00
000016_add_kb_pinned.up.sql feat: add pinning functionality for knowledge bases 2026-03-05 18:14:14 +08:00
000017_mcp_builtin.down.sql feat(security): add AES-256-GCM encryption for API keys at rest 2026-03-09 10:35:07 +08:00
000017_mcp_builtin.up.sql feat(security): add AES-256-GCM encryption for API keys at rest 2026-03-09 10:35:07 +08:00
000018_extend_tenant_api_key.down.sql feat(security): add AES-256-GCM encryption for API keys at rest 2026-03-09 10:35:07 +08:00
000018_extend_tenant_api_key.up.sql feat(security): add AES-256-GCM encryption for API keys at rest 2026-03-09 10:35:07 +08:00
000019_add_agent_duration_ms.down.sql chore: update AWS SDK dependencies and add database migrations 2026-03-09 11:46:56 +08:00
000019_add_agent_duration_ms.up.sql chore: update AWS SDK dependencies and add database migrations 2026-03-09 11:46:56 +08:00
000020_add_message_knowledge_id.down.sql chore: update AWS SDK dependencies and add database migrations 2026-03-09 11:46:56 +08:00
000020_add_message_knowledge_id.up.sql chore: update AWS SDK dependencies and add database migrations 2026-03-09 11:46:56 +08:00
000021_im_channel.down.sql feat: implement IM channel sessions and update message handling 2026-03-16 02:40:42 +08:00
000021_im_channel.up.sql feat: implement IM channel sessions and update message handling 2026-03-16 02:40:42 +08:00
000022_message_images.down.sql feat: implement IM channel sessions and update message handling 2026-03-16 02:40:42 +08:00
000022_message_images.up.sql feat: implement IM channel sessions and update message handling 2026-03-16 02:40:42 +08:00
000023_im_channel_kb_id.down.sql feat(im): add file support and knowledge base integration 2026-03-17 22:23:24 +08:00
000023_im_channel_kb_id.up.sql feat(im): add file support and knowledge base integration 2026-03-17 22:23:24 +08:00
000024_im_channel_bot_identity.down.sql feat(im): add file support and knowledge base integration 2026-03-17 22:23:24 +08:00
000024_im_channel_bot_identity.up.sql feat(im): add file support and knowledge base integration 2026-03-17 22:23:24 +08:00
000025_message_channel.down.sql feat(knowledge): add channel support to knowledge entries and related components 2026-03-25 22:08:29 +08:00
000025_message_channel.up.sql feat(knowledge): add channel support to knowledge entries and related components 2026-03-25 22:08:29 +08:00
000026_chunks_query_indexes.down.sql feat(agent): enhance chunk search functionality to include total chunk counts 2026-03-25 22:08:29 +08:00
000026_chunks_query_indexes.up.sql feat(agent): enhance chunk search functionality to include total chunk counts 2026-03-25 22:08:29 +08:00
000027_message_rendered_content.down.sql feat(prompt): enhance context and intent classification in templates 2026-03-26 18:57:12 +08:00
000027_message_rendered_content.up.sql feat(prompt): enhance context and intent classification in templates 2026-03-26 18:57:12 +08:00
000028_im_thread_session.down.sql [NELO-1102] feat(im): add thread-based session mode for IM channels 2026-03-30 10:43:14 +08:00
000028_im_thread_session.up.sql [NELO-1102] feat(im): add thread-based session mode for IM channels 2026-03-30 10:43:14 +08:00
000029_datasource_tables.down.sql feat(web-search): refactor web search provider 2026-03-31 20:22:34 +08:00
000029_datasource_tables.up.sql fix(migrations): correct migration numbers and remove broken trigger 2026-04-03 11:31:21 +08:00
000030_web_search_providers.down.sql feat(web-search): refactor web search provider 2026-03-31 20:22:34 +08:00
000030_web_search_providers.up.sql fix(migrations): correct migration numbers and remove broken trigger 2026-04-03 11:31:21 +08:00
000031_add_asr_config.down.sql feat(asr): add ASR model connection check and update related components 2026-04-02 21:27:27 +08:00
000031_add_asr_config.up.sql fix(migrations): correct migration numbers and remove broken trigger 2026-04-03 11:31:21 +08:00
000032_vector_stores.down.sql feat: add VectorStore entity, repository, and migrations 2026-04-09 01:39:51 +08:00
000032_vector_stores.up.sql feat: add VectorStore entity, repository, and migrations 2026-04-09 01:39:51 +08:00
000033_add_video_info_to_chunks.down.sql fix: 修正视频相关迁移文件版本号冲突,从 000032 改为 000033 2026-04-10 22:01:42 +08:00
000033_add_video_info_to_chunks.up.sql fix: 修正视频相关迁移文件版本号冲突,从 000032 改为 000033 2026-04-10 22:01:42 +08:00
000034_add_attachments.down.sql fix: rename sql file 2026-04-14 14:54:21 +08:00
000034_add_attachments.up.sql fix: rename sql file 2026-04-14 14:54:21 +08:00
000035_add_credentials.down.sql refactor(weknoracloud): update credential handling and configuration 2026-04-15 11:37:24 +08:00
000035_add_credentials.up.sql refactor(weknoracloud): update credential handling and configuration 2026-04-15 11:37:24 +08:00
000036_kb_vector_store_id.down.sql feat: add vector_store_id column to knowledge_bases for per-KB vector store binding 2026-04-20 19:53:44 +08:00
000036_kb_vector_store_id.up.sql feat: add vector_store_id column to knowledge_bases for per-KB vector store binding 2026-04-20 19:53:44 +08:00
000037_wiki_and_indexing.down.sql feat(wiki): implement folder management features in wiki API 2026-06-16 23:51:29 +08:00
000037_wiki_and_indexing.up.sql feat(wiki): implement folder management features in wiki API 2026-06-16 23:51:29 +08:00
000038_im_session_agent_id.down.sql fix(im): isolate IM sessions per agent and recover from deleted sessions 2026-04-28 20:53:06 +08:00
000038_im_session_agent_id.up.sql fix(im): isolate IM sessions per agent and recover from deleted sessions 2026-04-28 20:53:06 +08:00
000039_session_user_id_and_pin.down.sql feat(sessions): add keyword search, user-scoped pinning, and IM source visibility 2026-04-30 16:23:00 +08:00
000039_session_user_id_and_pin.up.sql feat(sessions): add keyword search, user-scoped pinning, and IM source visibility 2026-04-30 16:23:00 +08:00
000040_wiki_log_entries.down.sql perf(wiki): move ingest log to event table and index to on-demand API 2026-05-08 21:48:52 +08:00
000040_wiki_log_entries.up.sql perf(wiki): move ingest log to event table and index to on-demand API 2026-05-08 21:48:52 +08:00
000041_task_queue_and_wiki_indexes.down.sql perf(wiki-ingest): scale to 4w-doc KBs + generic task queue / dead-letter 2026-05-10 00:01:06 +08:00
000041_task_queue_and_wiki_indexes.up.sql refactor(task_queue): enhance claim handling and test coverage 2026-07-09 17:41:07 +08:00
000042_mcp_tool_approval.down.sql feat(agent): human-in-the-loop approval for MCP tool calls (#1173) 2026-05-10 22:57:12 +08:00
000042_mcp_tool_approval.up.sql feat(agent): human-in-the-loop approval for MCP tool calls (#1173) 2026-05-10 22:57:12 +08:00
000043_tenant_rbac.down.sql refactor(rbac): address PR 1 review feedback 2026-05-18 17:28:58 +08:00
000043_tenant_rbac.up.sql feat(rbac): add tenant_members schema and auth wiring (PR 1 of 3, #1303) 2026-05-18 17:28:58 +08:00
000044_audit_log.down.sql feat(migration): add index on created_at for audit_logs 2026-05-18 17:28:58 +08:00
000044_audit_log.up.sql Remove redundant Wiki operation log 2026-07-28 11:18:33 +08:00
000045_org_tenant_members.down.sql fix(rbac): dedup pending join/upgrade requests per (org, tenant, type) 2026-05-18 17:28:58 +08:00
000045_org_tenant_members.up.sql fix(rbac): dedup pending join/upgrade requests per (org, tenant, type) 2026-05-18 17:28:58 +08:00
000046_org_owner_tenant_id.down.sql fix(rbac): pin organization owner tenant in DB instead of deriving at runtime 2026-05-18 17:28:58 +08:00
000046_org_owner_tenant_id.up.sql fix(rbac): pin organization owner tenant in DB instead of deriving at runtime 2026-05-18 17:28:58 +08:00
000047_user_resource_favorites.down.sql feat(favorites): implement user favorites and recents functionality 2026-05-18 17:28:58 +08:00
000047_user_resource_favorites.up.sql feat(favorites): implement user favorites and recents functionality 2026-05-18 17:28:58 +08:00
000048_tenant_invitations.down.sql feat(invitations): implement pending invitations feature with polling and dialog 2026-05-18 17:28:58 +08:00
000048_tenant_invitations.up.sql feat(invitations): implement pending invitations feature with polling and dialog 2026-05-18 17:28:58 +08:00
000049_user_preferences.down.sql feat(user-preferences): implement user preferences management with backend support 2026-05-18 17:28:58 +08:00
000049_user_preferences.up.sql feat(user-preferences): implement user preferences management with backend support 2026-05-18 17:28:58 +08:00
000050_user_kb_pins.down.sql feat(knowledge-base): implement per-user pinning for knowledge bases 2026-05-18 17:28:58 +08:00
000050_user_kb_pins.up.sql feat(knowledge-base): implement per-user pinning for knowledge bases 2026-05-18 17:28:58 +08:00
000051_custom_agents_creator_backfill.down.sql feat(i18n): update localization files for improved clarity and consistency 2026-05-18 17:28:58 +08:00
000051_custom_agents_creator_backfill.up.sql feat(i18n): update localization files for improved clarity and consistency 2026-05-18 17:28:58 +08:00
000052_models_managed_by.down.sql feat(builtin-models): add managed_by column to models table 2026-05-26 11:37:03 +08:00
000052_models_managed_by.up.sql feat(builtin-models): add managed_by column to models table 2026-05-26 11:37:03 +08:00
000053_system_admin_and_settings.down.sql refactor(migrations): remove deprecated user system admin migration files and introduce new system settings migration 2026-05-26 21:13:56 +08:00
000053_system_admin_and_settings.up.sql refactor(migrations): remove deprecated user system admin migration files and introduce new system settings migration 2026-05-26 21:13:56 +08:00
000054_invitation_tokens.down.sql feat(rbac): add multi-use share-link invitations for invite_only mode (#1504) 2026-05-27 19:42:01 +08:00
000054_invitation_tokens.up.sql feat(rbac): add multi-use share-link invitations for invite_only mode (#1504) 2026-05-27 19:42:01 +08:00
000055_knowledge_processing_spans.down.sql feat(migrations): add knowledge_processing_spans table and rollback script 2026-05-28 15:14:45 +08:00
000055_knowledge_processing_spans.up.sql feat(migrations): add knowledge_processing_spans table and rollback script 2026-05-28 15:14:45 +08:00
000056_knowledge_pending_subtasks.down.sql feat: add knowledge parse cancellation with finalizing post-process state 2026-05-28 20:16:02 +08:00
000056_knowledge_pending_subtasks.up.sql feat: add knowledge parse cancellation with finalizing post-process state 2026-05-28 20:16:02 +08:00
000057_models_display_name.down.sql feat(migrations): add display_name column to models table 2026-05-29 17:03:42 +08:00
000057_models_display_name.up.sql feat(migrations): add display_name column to models table 2026-05-29 17:03:42 +08:00
000058_expand_knowledge_source.down.sql fix(schema): expand knowledge source length 2026-06-05 15:12:25 +08:00
000058_expand_knowledge_source.up.sql fix(schema): expand knowledge source length 2026-06-05 15:12:25 +08:00
000059_embeddings_hnsw_1024.down.sql fix(migrations): update migration comments for HNSW index 2026-06-08 12:20:37 +08:00
000059_embeddings_hnsw_1024.up.sql fix(migrations): update migration comments for HNSW index 2026-06-08 12:20:37 +08:00
000060_embed_channels.down.sql feat(embed): add backend embed channels with auth and rate limiting (#1657) 2026-06-12 23:10:39 +08:00
000060_embed_channels.up.sql feat(embed): add backend embed channels with auth and rate limiting (#1657) 2026-06-12 23:10:39 +08:00
000061_wiki_page_hierarchy.down.sql feat(wiki): implement folder management features in wiki API 2026-06-16 23:51:29 +08:00
000061_wiki_page_hierarchy.up.sql feat(wiki): implement folder management features in wiki API 2026-06-16 23:51:29 +08:00
000062_mcp_oauth.down.sql feat(mcp): add OAuth2 authorization for MCP services 2026-06-22 20:19:31 +08:00
000062_mcp_oauth.up.sql feat(mcp): add OAuth2 authorization for MCP services 2026-06-22 20:19:31 +08:00
000063_knowledge_multi_tags.down.sql feat: support multi-tag for document knowledge (#1790) 2026-06-26 00:18:48 +08:00
000063_knowledge_multi_tags.up.sql feat(frontend): redesign tag sidebar chips and tag edit dialog 2026-06-26 10:52:52 +08:00
000064_principal_model.down.sql feat(migrations): add principal model migration for MCP OAuth and tenant API config 2026-06-30 20:01:05 +08:00
000064_principal_model.up.sql feat(migrations): add principal model migration for MCP OAuth and tenant API config 2026-06-30 20:01:05 +08:00
000065_tenant_api_keys.down.sql fix(api-keys): harden scoped key auth after code review 2026-07-07 12:00:13 +08:00
000065_tenant_api_keys.up.sql test(api-keys): add unit tests for tenant API key validation 2026-07-07 12:00:13 +08:00
000066_expand_knowledge_span_name.down.sql fix(spans): expand knowledge span name column and truncate long wiki names 2026-07-13 10:35:44 +08:00
000066_expand_knowledge_span_name.up.sql fix(spans): expand knowledge span name column and truncate long wiki names 2026-07-13 10:35:44 +08:00
000067_question_suggestions.down.sql feat(agent): add question suggestions with after-answer follow-ups 2026-07-14 11:17:25 +08:00
000067_question_suggestions.up.sql feat(agent): add question suggestions with after-answer follow-ups 2026-07-14 11:17:25 +08:00
000068_storage_backends.down.sql feat(storage): add multi-instance storage backends per workspace 2026-07-15 14:54:39 +08:00
000068_storage_backends.up.sql feat(storage): add multi-instance storage backends per workspace 2026-07-15 14:54:39 +08:00
000069_resource_registry.down.sql feat(resource): add stable resource registry with LLM-context alias compaction 2026-07-15 17:02:43 +08:00
000069_resource_registry.up.sql feat(resource): add stable resource registry with LLM-context alias compaction 2026-07-15 17:02:43 +08:00
000070_temporary_documents.down.sql feat(chat): add session-scoped temporary attachments with async parsing 2026-07-16 17:41:27 +08:00
000070_temporary_documents.up.sql feat(chat): add session-scoped temporary attachments with async parsing 2026-07-16 17:41:27 +08:00
000071_platform_api_keys.down.sql feat(api-keys): add platform-scoped API keys for control-plane automation 2026-07-21 17:21:35 +08:00
000071_platform_api_keys.up.sql feat(api-keys): add platform-scoped API keys for control-plane automation 2026-07-21 17:21:35 +08:00
000072_auth_timestamp_tz.down.sql fix: normalize API key expiry timestamps to UTC (#2137) 2026-07-22 17:09:55 +08:00
000072_auth_timestamp_tz.up.sql fix: normalize API key expiry timestamps to UTC (#2137) 2026-07-22 17:09:55 +08:00
000073_kb_activity_scope.down.sql feat(knowledge): add scoped activity audit trail 2026-07-23 10:50:32 +08:00
000073_kb_activity_scope.up.sql feat(knowledge): add scoped activity audit trail 2026-07-23 10:50:32 +08:00
000074_mcp_oauth_refresh_lease.down.sql fix(mcp): coordinate OAuth token refresh and authorization polling 2026-07-23 15:35:24 +08:00
000074_mcp_oauth_refresh_lease.up.sql fix(mcp): coordinate OAuth token refresh and authorization polling 2026-07-23 15:35:24 +08:00
000075_wiki_page_revisions.down.sql feat(wiki): add page revision history with diff, revert, and manual editing 2026-07-27 15:03:24 +08:00
000075_wiki_page_revisions.up.sql feat(wiki): add page revision history with diff, revert, and manual editing 2026-07-27 15:03:24 +08:00
000076_knowledge_metadata_external_id_index.down.sql fix(migrations): renumber knowledge metadata index migration to 000076 2026-07-27 17:31:28 +08:00
000076_knowledge_metadata_external_id_index.up.sql fix(migrations): renumber knowledge metadata index migration to 000076 2026-07-27 17:31:28 +08:00
000077_remove_wiki_log.down.sql Remove redundant Wiki operation log 2026-07-28 11:18:33 +08:00
000077_remove_wiki_log.up.sql Remove redundant Wiki operation log 2026-07-28 11:18:33 +08:00
000078_chunk_editing_and_custom_metadata.down.sql feat(knowledge): support editable chunks and metadata 2026-07-28 20:23:48 +08:00
000078_chunk_editing_and_custom_metadata.up.sql feat(knowledge): support editable chunks and metadata 2026-07-28 20:23:48 +08:00
000079_knowledge_folder_path.down.sql feat(knowledge): store folder path for folder uploads and expose folder tree API 2026-08-04 20:45:29 +08:00
000079_knowledge_folder_path.up.sql feat(knowledge): store folder path for folder uploads and expose folder tree API 2026-08-04 20:45:29 +08:00
000080_knowledge_base_auto_tag_config.down.sql feat: 增加自动添加标签的功能 2026-08-07 15:01:01 +08:00
000080_knowledge_base_auto_tag_config.up.sql feat: 增加自动添加标签的功能 2026-08-07 15:01:01 +08:00
000081_message_artifacts.down.sql feat(sandbox) (#2301) 2026-08-10 21:28:20 +08:00
000081_message_artifacts.up.sql feat(sandbox) (#2301) 2026-08-10 21:28:20 +08:00
000082_tenant_sandbox_config.down.sql feat(sandbox) (#2301) 2026-08-10 21:28:20 +08:00
000082_tenant_sandbox_config.up.sql feat(sandbox) (#2301) 2026-08-10 21:28:20 +08:00
000083_session_sandbox_config.down.sql feat(sandbox) (#2301) 2026-08-10 21:28:20 +08:00
000083_session_sandbox_config.up.sql feat(sandbox) (#2301) 2026-08-10 21:28:20 +08:00