WeKnora/internal/application/service
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
..
chat_pipeline fix(query-understand): fall back to original query on unparsable output 2026-08-07 15:55:48 +08:00
file fix(security): harden outbound URL SSRF protection (#2626) 2026-08-10 13:24:14 +08:00
metric fix: resolve failing test and build errors 2026-04-22 21:17:29 +08:00
retriever fix(retriever): rebuild a missing vector store engine on demand 2026-07-29 12:25:18 +08:00
agent_history.go feat(llm): introduce request-local source reference aliases 2026-07-17 10:19:43 +08:00
agent_history_test.go feat(llm): introduce request-local source reference aliases 2026-07-17 10:19:43 +08:00
agent_rerank_requirement_test.go feat(agent): enforce model readiness and polish selector UX 2026-06-25 23:33:39 +08:00
agent_service.go feat(sandbox) (#2301) 2026-08-10 21:28:20 +08:00
agent_service_scope_test.go feat(chat): add @Skill/@MCP mentions with scoped agent runtime 2026-06-29 18:09:44 +08:00
agent_service_shell_test.go feat(sandbox) (#2301) 2026-08-10 21:28:20 +08:00
agent_service_test.go fix(agent): exclude processing docs from prompt 2026-05-18 16:49:14 +08:00
agent_share.go fix: harden shared agent source permissions 2026-07-30 12:28:23 +08:00
agent_share_runtime_test.go fix: harden shared agent source selector validation 2026-07-30 12:28:23 +08:00
artifact_collector.go feat(sandbox) (#2301) 2026-08-10 21:28:20 +08:00
artifact_collector_store.go feat(sandbox) (#2301) 2026-08-10 21:28:20 +08:00
artifact_collector_test.go feat(sandbox) (#2301) 2026-08-10 21:28:20 +08:00
audit_log.go fix(audit_log): prevent deadlock in Stop() when Start() is never called 2026-05-18 17:28:58 +08:00
audit_log_retention.go fix(audit_log): prevent deadlock in Stop() when Start() is never called 2026-05-18 17:28:58 +08:00
audit_log_retention_test.go fix(audit_log): prevent deadlock in Stop() when Start() is never called 2026-05-18 17:28:58 +08:00
audit_log_test.go feat(rbac): per-tenant audit log for RBAC events (PR 6, #1303) 2026-05-18 17:28:58 +08:00
chunk.go fix(agent): exclude disabled FAQ entries 2026-07-29 14:40:54 +08:00
chunk_edit_parent_test.go fix(chunks): retain questions across content edits 2026-07-28 20:23:48 +08:00
custom_agent.go fix(wiki): ensure prompt language is always resolved 2026-08-05 16:14:50 +08:00
custom_agent_api_key_scope_test.go feat(agent): enhance suggested questions API with tag scopes 2026-07-17 10:19:43 +08:00
custom_agent_suggestion_limit_test.go fix(agent): honor suggested-questions limit parameter 2026-07-24 10:46:53 +08:00
custom_agent_suggestion_scope_test.go feat(agent): enhance suggested questions API with tag scopes 2026-07-17 10:19:43 +08:00
dataset.go init commit 2025-08-05 15:08:07 +08:00
datasource_delete_sqlite_test.go fix: 修复 SQLite 下删除 DataSource 失败 2026-07-31 11:00:47 +08:00
datasource_result_cap_test.go fix(feishu): resilient large-wiki sync — retry, streaming resume, failure visibility 2026-07-21 16:14:22 +08:00
datasource_service.go feat(feishu-driver): 新增飞书云盘数据源 (#2466) 2026-08-05 19:39:49 +08:00
datasource_service_test.go fix(feishu): resilient large-wiki sync — retry, streaming resume, failure visibility 2026-07-21 16:14:22 +08:00
datasource_stream_test.go fix(feishu): resilient large-wiki sync — retry, streaming resume, failure visibility 2026-07-21 16:14:22 +08:00
datasource_sweep_wiring_test.go fix(knowledge): harden file-type scoped duplicate detection 2026-07-29 10:36:17 +08:00
embed_channel.go fix(agent): honor suggested-questions limit parameter 2026-07-24 10:46:53 +08:00
embed_channel_chunk_test.go feat(embed): add backend embed channels with auth and rate limiting (#1657) 2026-06-12 23:10:39 +08:00
embed_channel_public_config_test.go refactor: remove Neo4j-based conversation memory feature 2026-07-18 23:41:48 +08:00
embed_channel_update_test.go refactor: remove Neo4j-based conversation memory feature 2026-07-18 23:41:48 +08:00
embed_session.go feat(embed): add backend embed channels with auth and rate limiting (#1657) 2026-06-12 23:10:39 +08:00
embed_session_test.go feat(embed): add backend embed channels with auth and rate limiting (#1657) 2026-06-12 23:10:39 +08:00
embed_webhook.go fix(security): harden outbound requests and file previews 2026-07-02 19:15:46 +08:00
embed_webhook_test.go fix(security): harden outbound requests and file previews 2026-07-02 19:15:46 +08:00
evaluation.go fix(evaluation): fix retrieval metrics by mapping chunks back to passage IDs 2026-07-31 11:05:13 +08:00
extract.go refactor(knowledge): make the supported import extension set the single gate 2026-07-31 13:46:56 +08:00
fallback_messages_test.go refactor(agent): introduce modelcontext registry and fix handle-codec bugs 2026-07-27 11:05:43 +08:00
faq_clone_sync.go feat(knowledge): enhance FAQ export functionality 2026-07-23 10:50:32 +08:00
graph.go fix(knowledge): stitch chunks by text overlap, not by position 2026-05-30 17:53:47 +08:00
image_multimodal.go fix: retry document summaries before fallback 2026-08-05 19:29:32 +08:00
image_multimodal_orphan_test.go feat(tests): enhance image multimodal service tests and runtime task handling 2026-07-14 15:38:06 +08:00
image_multimodal_prompt_test.go Add instruction fields to knowledge base configuration 2026-07-13 12:16:19 +08:00
kb_activity.go Remove redundant Wiki operation log 2026-07-28 11:18:33 +08:00
kb_activity_test.go Remove redundant Wiki operation log 2026-07-28 11:18:33 +08:00
kbshare.go feat(knowledge): add scoped activity audit trail 2026-07-23 10:50:32 +08:00
knowledge.go feat(knowledge): browse folders like a file manager and allow re-filing 2026-08-04 20:45:29 +08:00
knowledge_auto_tag.go fix(knowledge): harden auto-tagging and let it respect manual tags 2026-08-07 15:35:58 +08:00
knowledge_auto_tag_test.go fix(knowledge): harden auto-tagging and let it respect manual tags 2026-08-07 15:35:58 +08:00
knowledge_batch_reparse_test.go fix(knowledge): surface batch reparse failures 2026-07-31 19:06:16 +08:00
knowledge_clone_image_test.go fix(knowledge): copy embedded chunk images into exports namespace 2026-07-22 15:27:11 +08:00
knowledge_clone_move.go fix(wiki): ensure prompt language is always resolved 2026-08-05 16:14:50 +08:00
knowledge_create.go fix(chunking): normalize line endings before splitting / 在分块前统一换行符 2026-08-05 19:24:45 +08:00
knowledge_create_folder_test.go feat(knowledge): store folder path for folder uploads and expose folder tree API 2026-08-04 20:45:29 +08:00
knowledge_create_test.go fix(storage): allow image uploads to use file service fallback 2026-07-29 11:36:24 +08:00
knowledge_delete.go fix(wiki): ensure prompt language is always resolved 2026-08-05 16:14:50 +08:00
knowledge_delete_test.go fix(knowledge): clean bound vector stores in batch delete 2026-07-27 11:32:30 +08:00
knowledge_faq.go fix(faq): prevent duplicate entries when a create is retried 2026-08-05 17:05:51 +08:00
knowledge_faq_create_guard.go fix(faq): prevent duplicate entries when a create is retried 2026-08-05 17:05:51 +08:00
knowledge_faq_create_guard_test.go fix(faq): prevent duplicate entries when a create is retried 2026-08-05 17:05:51 +08:00
knowledge_faq_import.go feat(knowledge): enhance FAQ export functionality 2026-07-23 10:50:32 +08:00
knowledge_folder_move_test.go feat(knowledge): browse folders like a file manager and allow re-filing 2026-08-04 20:45:29 +08:00
knowledge_housekeeping.go fix(knowledge): recover tasks safely after server restart 2026-07-14 17:55:26 +08:00
knowledge_housekeeping_test.go fix(knowledge): recover tasks safely after server restart 2026-07-14 17:55:26 +08:00
knowledge_image_cleanup_test.go fix(knowledge): delete extracted images from storage when knowledge is removed 2026-04-02 12:04:04 +08:00
knowledge_index_content.go refactor(knowledge): keep metadata document scoped 2026-07-28 20:23:48 +08:00
knowledge_index_content_test.go fix(knowledge): enqueue stale summary refreshes 2026-07-28 20:23:48 +08:00
knowledge_manual_test.go fix: sanitize tab chars and avoid double .md extension in manual download filename 2026-03-16 18:18:23 +08:00
knowledge_move_gate_test.go fix: reject cross-store reuse_vectors knowledge move 2026-06-05 15:00:41 +08:00
knowledge_move_wiki_test.go fix(knowledge): reconcile wiki state when moving documents across KBs 2026-07-27 15:02:02 +08:00
knowledge_owner_chain_test.go feat(rbac): per-KB ownership for knowledge / chunks / wiki pages (#1303) 2026-05-18 17:28:58 +08:00
knowledge_post_process.go fix(knowledge): address auto-tag review findings 2026-08-07 15:01:01 +08:00
knowledge_post_process_trace_test.go fix: correct graph and multimodal processing traces 2026-07-22 17:38:28 +08:00
knowledge_post_process_wiki_enqueue_test.go fix(wiki): prevent finalizing stalls on enqueue failure 2026-07-28 20:54:48 +08:00
knowledge_process.go fix(security): harden outbound URL SSRF protection (#2626) 2026-08-10 13:24:14 +08:00
knowledge_process_config.go refactor(knowledge): make the supported import extension set the single gate 2026-07-31 13:46:56 +08:00
knowledge_process_config_test.go refactor(knowledge): make the supported import extension set the single gate 2026-07-31 13:46:56 +08:00
knowledge_process_status_test.go fix(knowledge): clear stale error_message on the remaining reprocess paths 2026-08-03 20:14:09 +08:00
knowledge_reparse_test.go fix(knowledge): clear stale errors on reparse 2026-07-28 20:44:34 +08:00
knowledge_shared_access_test.go feat(rbac): lift org membership from per-user to per-tenant (Plan 3, #1303) 2026-05-18 17:28:58 +08:00
knowledge_span_tracker.go fix: correct graph and multimodal processing traces 2026-07-22 17:38:28 +08:00
knowledge_span_tracker_test.go fix(knowledge): enqueue stale summary refreshes 2026-07-28 20:23:48 +08:00
knowledge_storage_config_test.go fix(storage): merge tos/s3/oss/ks3 tenant configs in buildStorageConfig (#1117) 2026-05-06 17:09:42 +08:00
knowledge_summary_reconstruction_test.go fix(summary): preserve rows across table chunks / 修复表格分块摘要丢行 2026-08-05 13:12:59 +08:00
knowledge_summary_refresh.go fix(wiki): ensure prompt language is always resolved 2026-08-05 16:14:50 +08:00
knowledge_summary_refresh_test.go fix(knowledge): harden summary refresh after review feedback 2026-07-28 20:23:48 +08:00
knowledge_summary_sort_test.go fix(knowledge): harden summary refresh after review feedback 2026-07-28 20:23:48 +08:00
knowledge_summary_stale_test.go fix(knowledge): harden summary refresh after review feedback 2026-07-28 20:23:48 +08:00
knowledge_summary_test.go fix: retry document summaries before fallback 2026-08-05 19:29:32 +08:00
knowledge_task_options.go feat(worker): replace aggregate asynq concurrency with per-pool governance 2026-07-13 15:51:06 +08:00
knowledge_task_options_test.go feat(worker): replace aggregate asynq concurrency with per-pool governance 2026-07-13 15:51:06 +08:00
knowledge_util.go refactor(knowledge): make the supported import extension set the single gate 2026-07-31 13:46:56 +08:00
knowledge_util_filetype_test.go refactor(knowledge): make the supported import extension set the single gate 2026-07-31 13:46:56 +08:00
knowledge_util_ssrf_test.go fix(security): harden outbound URL SSRF protection (#2626) 2026-08-10 13:24:14 +08:00
knowledgebase.go feat: 增加自动添加标签的功能 2026-08-07 15:01:01 +08:00
knowledgebase_delete_datasource_test.go fix(knowledgebase): delete data sources when knowledge base is removed 2026-06-23 17:30:38 +08:00
knowledgebase_pr3_test.go fix(retriever): rebuild a missing vector store engine on demand 2026-07-29 12:25:18 +08:00
knowledgebase_search.go feat(agent): enhance suggested questions API with tag scopes 2026-07-17 10:19:43 +08:00
knowledgebase_search_budget_test.go fix(retriever): rebuild a missing vector store engine on demand 2026-07-29 12:25:18 +08:00
knowledgebase_search_fanout.go feat(search): fan-out KB retrieval across bound vector stores 2026-05-20 22:25:39 +08:00
knowledgebase_search_fanout_test.go fix(retriever): rebuild a missing vector store engine on demand 2026-07-29 12:25:18 +08:00
knowledgebase_search_faq.go feat(search): fan-out KB retrieval across bound vector stores 2026-05-20 22:25:39 +08:00
knowledgebase_search_fusion.go feat(retrieval): configurable RRF parameters per tenant 2026-05-06 17:17:07 +08:00
knowledgebase_search_results.go chore(types): add internal only ContentRevision to types.SearchResult 2026-08-06 12:14:25 +08:00
knowledgebase_search_results_edit_test.go fix(agent): exclude disabled FAQ entries 2026-07-29 14:40:54 +08:00
knowledgebase_search_shared.go feat(rbac): lift org membership from per-user to per-tenant (Plan 3, #1303) 2026-05-18 17:28:58 +08:00
knowledgebase_search_storegroup.go fix(retriever): rebuild a missing vector store engine on demand 2026-07-29 12:25:18 +08:00
knowledgebase_task_cancel_test.go fix(kb): retry KB delete when engine resolution is deferred 2026-07-29 12:25:18 +08:00
mcp_service.go fix(mcp): preserve omitted service update fields 2026-08-10 19:14:21 +08:00
mcp_service_test.go fix(test): use resolvable URLs in MCP service update test 2026-08-10 19:25:25 +08:00
mcp_tool_approval_service.go feat(agent): human-in-the-loop approval for MCP tool calls (#1173) 2026-05-10 22:57:12 +08:00
message.go feat(sandbox) (#2301) 2026-08-10 21:28:20 +08:00
message_suggestion.go fix(wiki): ensure prompt language is always resolved 2026-08-05 16:14:50 +08:00
message_suggestion_test.go fix(agent): ground follow-up suggestions and preserve KB scope on click 2026-07-15 19:16:53 +08:00
metric_hook.go fix(evaluation): fix retrieval metrics by mapping chunks back to passage IDs 2026-07-31 11:05:13 +08:00
model.go refactor(terminology): rename user-facing tenant labels to workspace 2026-07-14 16:14:43 +08:00
model_builtin_management_test.go feat(models): let system admins edit builtin model config 2026-07-14 15:56:02 +08:00
model_delete_test.go feat(sandbox) (#2301) 2026-08-10 21:28:20 +08:00
ocr_sanitizer.go feat: use language-neutral English prompts for multilingual LLM responses 2026-03-06 21:08:12 +08:00
ocr_sanitizer_test.go feat: introduce WeKnora Lite edition with lightweight configuration and deployment 2026-03-02 21:21:49 +08:00
organization.go feat(organization): transition membership model to tenant-level and enhance invite functionality 2026-05-18 17:28:58 +08:00
parser_url_security.go fix(security): harden outbound URL SSRF protection (#2626) 2026-08-10 13:24:14 +08:00
parser_url_security_test.go fix(security): harden outbound URL SSRF protection (#2626) 2026-08-10 13:24:14 +08:00
resource.go fix(api): address resource_urls review follow-ups 2026-08-05 14:42:51 +08:00
resource_test.go perf(storage): reuse a live resource access grant per resource 2026-08-05 14:42:51 +08:00
session.go feat(sandbox) (#2301) 2026-08-10 21:28:20 +08:00
session_agent_qa.go feat(sandbox) (#2301) 2026-08-10 21:28:20 +08:00
session_agent_qa_scope_test.go refactor(agent): fix grep scope loss and consolidate per-turn @mention scoping 2026-06-29 18:09:44 +08:00
session_attachment_staging.go feat(sandbox) (#2301) 2026-08-10 21:28:20 +08:00
session_attachment_staging_test.go feat(sandbox) (#2301) 2026-08-10 21:28:20 +08:00
session_knowledge_qa.go feat(sandbox) (#2301) 2026-08-10 21:28:20 +08:00
session_knowledge_qa_test.go fix(chat): emit retrieval references when citation output is disabled 2026-07-17 11:38:35 +08:00
session_model_requirement_test.go fix(agent): address readiness review findings 2026-06-25 23:33:39 +08:00
session_qa_api_key_scope_test.go Refine scoped API key capabilities 2026-07-07 12:00:13 +08:00
session_qa_helpers.go feat(agent): add per-agent citation output toggle 2026-07-17 10:19:43 +08:00
session_sandbox_entry_test.go feat(sandbox) (#2301) 2026-08-10 21:28:20 +08:00
session_sandbox_gating_test.go feat(sandbox) (#2301) 2026-08-10 21:28:20 +08:00
session_sandbox_pin.go feat(sandbox) (#2301) 2026-08-10 21:28:20 +08:00
session_sandbox_pin_test.go feat(sandbox) (#2301) 2026-08-10 21:28:20 +08:00
session_tag_targets_test.go feat(agent): enhance suggested questions API with tag scopes 2026-07-17 10:19:43 +08:00
session_user_scope_test.go fix(sessions): 放行 embed 运行时读取自身会话,修复追问建议 500 与刷新丢对话 2026-07-30 17:51:34 +08:00
skill_service.go feat: adapt preloaded skills to smart-reasoning agent 2026-02-04 20:08:49 +08:00
slug_fuzzy.go perf(wiki-ingest): scale to 4w-doc KBs + generic task queue / dead-letter 2026-05-10 00:01:06 +08:00
slug_fuzzy_test.go perf(wiki-ingest): scale to 4w-doc KBs + generic task queue / dead-letter 2026-05-10 00:01:06 +08:00
storagebackend.go feat(resource): add stable resource registry with LLM-context alias compaction 2026-07-15 17:02:43 +08:00
storagebackend_test.go feat(storage): add multi-instance storage backends per workspace 2026-07-15 14:54:39 +08:00
system_setting.go feat(invitation): add auto-accept switch for inviting registered users 2026-08-10 15:04:29 +08:00
system_setting_validation_test.go feat(worker): replace aggregate asynq concurrency with per-pool governance 2026-07-13 15:51:06 +08:00
tag.go fix(retriever): rebuild a missing vector store engine on demand 2026-07-29 12:25:18 +08:00
temporary_document.go fix: harden shared agent source permissions 2026-07-30 12:28:23 +08:00
temporary_document_test.go feat(chat): add session-scoped temporary attachments with async parsing 2026-07-16 17:41:27 +08:00
tenant.go feat(storage): add multi-instance storage backends per workspace 2026-07-15 14:54:39 +08:00
tenant_api_key.go fix: normalize API key expiry timestamps to UTC (#2137) 2026-07-22 17:09:55 +08:00
tenant_api_key_test.go fix: normalize API key expiry timestamps to UTC (#2137) 2026-07-22 17:09:55 +08:00
tenant_invitation.go fix(invitation): harden auto-accept follow-ups from code review 2026-08-10 15:47:29 +08:00
tenant_invitation_test.go fix(invitation): harden auto-accept follow-ups from code review 2026-08-10 15:47:29 +08:00
tenant_member.go fix(tenant): clear stale home tenant after member removal 2026-08-07 14:35:10 +08:00
tenant_member_test.go fix(tenant): clear stale home tenant after member removal 2026-08-07 14:35:10 +08:00
tenant_sandbox_config.go feat(sandbox) (#2301) 2026-08-10 21:28:20 +08:00
tenant_sandbox_config_test.go feat(sandbox) (#2301) 2026-08-10 21:28:20 +08:00
tenant_sandbox_resolve.go feat(sandbox) (#2301) 2026-08-10 21:28:20 +08:00
tenant_storagebackend_test.go feat(storage): add multi-instance storage backends per workspace 2026-07-15 14:54:39 +08:00
user.go fix(auth): harden self-service change password after #2591 2026-08-07 15:49:58 +08:00
user_auth_token_test.go fix(auth): harden self-service change password after #2591 2026-08-07 15:49:58 +08:00
user_jwt_test.go fix(security): block refresh tokens as bearer and sandbox MCP uploads 2026-07-02 17:08:17 +08:00
user_oidc_security_test.go fix(security): harden outbound requests and file previews 2026-07-02 19:15:46 +08:00
user_provisioning_test.go fix(tenant): clear stale home tenant after member removal 2026-08-07 14:35:10 +08:00
user_resource_favorite.go feat(favorites): implement user favorites and recents functionality 2026-05-18 17:28:58 +08:00
vectorstore.go fix: validate vector store connection addresses against SSRF policy 2026-06-04 15:26:56 +08:00
vectorstore_healthcheck.go fix(security): harden outbound URL SSRF protection (#2626) 2026-08-10 13:24:14 +08:00
vectorstore_healthcheck_ssrf_test.go fix(security): harden outbound URL SSRF protection (#2626) 2026-08-10 13:24:14 +08:00
vectorstore_opensearch_test.go feat(retriever): activate OpenSearch k-NN driver (PR 3 of 3) 2026-05-29 16:32:27 +08:00
vectorstore_ssrf_test.go fix: validate vector store connection addresses against SSRF policy 2026-06-04 15:26:56 +08:00
vectorstore_test.go feat: 增加自动添加标签的功能 2026-08-07 15:01:01 +08:00
web_search.go refactor(terminology): rename user-facing tenant labels to workspace 2026-07-14 16:14:43 +08:00
web_search_provider.go feat: add Metaso web search provider 2026-08-10 13:33:55 +08:00
web_search_provider_test.go feat: add Metaso web search provider 2026-08-10 13:33:55 +08:00
web_search_state.go fix: update environment configuration for debugging and logging, enhance SQLite FTS5 table management, and improve API base URL handling 2026-04-11 18:51:16 +08:00
weknoracloud.go fix(security): harden outbound URL SSRF protection (#2626) 2026-08-10 13:24:14 +08:00
wiki_deleted_kb_guard_test.go fix(tasks): dequeue work for deleted knowledge bases 2026-07-23 12:17:14 +08:00
wiki_folder_prune_finalize_test.go feat(wiki): prune empty folders after document retract 2026-07-22 19:27:22 +08:00
wiki_ingest.go fix(wiki): ensure prompt language is always resolved 2026-08-05 16:14:50 +08:00
wiki_ingest_batch.go fix(wiki): ensure prompt language is always resolved 2026-08-05 16:14:50 +08:00
wiki_ingest_cite.go refactor(agent): introduce modelcontext registry and fix handle-codec bugs 2026-07-27 11:05:43 +08:00
wiki_ingest_cite_test.go refactor(agent): introduce modelcontext registry and fix handle-codec bugs 2026-07-27 11:05:43 +08:00
wiki_ingest_dedup.go fix(wiki): harden slug integrity across ingest and agent write paths 2026-07-24 15:57:08 +08:00
wiki_ingest_dedup_test.go Remove redundant Wiki operation log 2026-07-28 11:18:33 +08:00
wiki_ingest_language_test.go fix(wiki): ensure prompt language is always resolved 2026-08-05 16:14:50 +08:00
wiki_ingest_retry_test.go perf(wiki): move ingest log to event table and index to on-demand API 2026-05-08 21:48:52 +08:00
wiki_ingest_taxonomy.go feat(wiki): implement folder management features in wiki API 2026-06-16 23:51:29 +08:00
wiki_ingest_taxonomy_test.go feat(i18n): add optional embedding model descriptions for multiple locales 2026-06-16 23:51:29 +08:00
wiki_ingest_test.go feat(llm): add prompt-cache observability and wiki cache-friendly prompts 2026-07-23 19:17:30 +08:00
wiki_linkify.go feat: Refactor cross-link injection logic for wiki pages 2026-04-22 21:18:09 +08:00
wiki_linkify_test.go feat: Refactor cross-link injection logic for wiki pages 2026-04-22 21:18:09 +08:00
wiki_lint.go Remove redundant Wiki operation log 2026-07-28 11:18:33 +08:00
wiki_page.go fix(wiki): exclude archived pages from stats queries 2026-08-06 11:41:32 +08:00
wiki_page_revision_test.go feat(wiki): add page revision history with diff, revert, and manual editing 2026-07-27 15:03:24 +08:00
wiki_page_test.go feat(wiki): add page revision history with diff, revert, and manual editing 2026-07-27 15:03:24 +08:00
wiki_slug_handles.go refactor(agent): introduce modelcontext registry and fix handle-codec bugs 2026-07-27 11:05:43 +08:00
wiki_slug_handles_test.go refactor(agent): introduce modelcontext registry and fix handle-codec bugs 2026-07-27 11:05:43 +08:00