Group embed sessions in the sidebar by channel, replace session source filter
with grouping buckets, and align shared chat components with embed theme colors.
Introduce embed_channels storage, publish-token and session-token auth,
origin allowlist enforcement, shared Redis rate limiter, public embed API
routes, webhooks with SSRF validation, and session listing by embed source.
Three related improvements to the IM-session experience:
- Auto-generated titles: a new IM session starts untitled and gets a
content-based title from its first message via the same GenerateTitleAsync
flow web sessions use, instead of an identity title like "user · dm". Falls
back to the identity title when the first message has no text. All platforms.
- In-flight reply recovery (web chat): opening a session whose reply is still
being generated on an IM channel made the web client attach via
continue-stream and fail (the IM answer never streams through this server),
flashing a "stream failed" toast and forcing a manual refresh. Treat a failed
attach to an IM reply (channel === 'im') as recoverable — poll until it
completes, then reload the thread; on timeout surface the standard error.
Web/api replies keep the original behaviour, untouched.
- Source-filter classification: the sidebar filter treats "web" as sessions
with no IM mapping, but the list join excluded soft-deleted mappings, so
/clear'd IM sessions leaked into the user's own web chats. Include soft-deleted
mappings so a session ever bound to an IM channel stays under its platform.
Adds a repository regression test.
IM-channel sessions were mixed in with the user's own chats. The sidebar
now defaults to web sessions; tenants with a configured IM channel get a
source switcher in the "对话" header to reach a specific platform.
- getSessionsList: optional `source` query param
- getMessageList: token-guarded loads (racing source switches / route
changes can't append stale rows) + per-source pagination reset
- SourceSwitcherDropdown: scope dropdown mirroring KBSwitcherDropdown,
scales to many platforms, reuses platform logos, closes on select
- empty state when a source has no sessions
- pure logic in sessionSourceFilter.ts with unit tests; zh/en/ko/ru i18n
- Updated McpSettings.vue, ModelSettings.vue, VectorStoreSettings.vue, and WebSearchSettings.vue to streamline the empty state display for services and models.
- Removed admin-specific add buttons from empty states, enhancing clarity for non-admin users.
- Improved consistency in the presentation of empty states across different settings components.
- Updated the menu component to include a new chat option, improving user navigation.
- Refactored the menu layout to allow for sticky behavior during scrolling, enhancing usability.
- Added localization support for the new chat feature in English, Korean, Russian, and Chinese.
- Adjusted the menu store to reflect the new chat option and maintain consistent menu structure.
- Updated the menu component to include a search button alongside the sidebar toggle in the expanded view, improving accessibility to search functionality.
- Refactored the layout to maintain a consistent design for the logo actions, ensuring a seamless user experience.
- Adjusted CSS styles for the sidebar toggle and search button for better alignment and responsiveness.
- Improved tooltip handling for the search feature to provide clear user guidance.
- Replaced toolbar layouts with a more streamlined header design in McpSettings.vue, VectorStoreSettings.vue, and WebSearchSettings.vue for improved consistency.
- Introduced new button styles for adding services and stores, enhancing visual clarity and user interaction.
- Updated empty state handling to utilize a unified design approach across settings views.
- Adjusted CSS styles for better alignment and responsiveness in service and store cards.
- Added a new section for model type selection in ModelEditorDialog.vue, allowing users to choose between different model types with visual indicators.
- Updated the source selection logic to reflect changes in model type and ensure proper state management.
- Refactored related computed properties to utilize the active model type for better clarity and maintainability.
- Enhanced localization files (English, Korean, Russian, Chinese) to include new translations for model type and type label.
- Improved the layout and structure of ModelSettings.vue for better user experience and accessibility.
- Revised usage steps in English, Korean, Russian, and Chinese localization files for clarity on saving credentials and adding cloud models.
- Introduced a new section in WeKnoraCloudSettings.vue to display the status of cloud model integration based on credential configuration.
- Added utility functions for managing WeKnoraCloud models, including model configuration and existing model checks.
- Enhanced ModelSettings.vue to improve model management actions and confirm deletion prompts.
- Implemented logic to handle adding cloud models with success and failure notifications.
- Updated the openCreateKB method to accept an optional initialSection parameter, allowing for targeted navigation during knowledge base creation.
- Removed the TenantModelsGuide component from KnowledgeBaseList.vue to streamline the UI.
- Adjusted logic in handleCreateKnowledgeBase to conditionally set the initial section based on model readiness, improving user experience.
- Removed unnecessary margins and adjusted padding in AgentList.vue, Chat.vue, and KnowledgeBaseList.vue to enhance the visual layout.
- Updated scrollbar styles to utilize system defaults for a more consistent user experience across components.
- Ensured that sticky headers align properly with the container edges by modifying padding settings.
- Added a new script `build_frontend_dist.sh` to handle the building of frontend static assets.
- Updated `docker-compose.yml` to include a note about running the build script before building the frontend service.
- Modified the GitHub Actions workflow to integrate the new build script for frontend assets.
- Adjusted the Dockerfile to copy built assets directly from the `dist` directory.
- Refined the `.dockerignore` to exclude unnecessary files while keeping the `dist` directory.
- Updated the CreateKnowledgeFromFile function to accept an optional processConfig parameter, enhancing flexibility in knowledge file uploads.
- Modified related service and test files to accommodate the new parameter, ensuring consistent handling across the upload process.
- Removed dependency on utils for schema generation, replacing it with a hardcoded JSON schema for GetDocumentInfoInput.
- Updated the input struct to use omitempty for JSON fields, clarifying that either knowledge_ids or faq_ids may be provided, but both are optional.
- Enhanced documentation for GetDocumentInfoInput to specify the usage of knowledge_ids and faq_ids.
- Introduced a new `useMarqueeSelect` hook to enable marquee selection functionality in the knowledge base view.
- Integrated marquee selection with mouse events to allow users to select multiple items by dragging a selection box.
- Updated the `KnowledgeBase.vue` and `DocumentListView.vue` components to support the new selection feature, including visual indicators for selection mode.
- Enhanced user experience by providing a responsive selection interface that adapts to user interactions.
- Added global styles to remap syntax highlighting colors for dark mode in the document preview component.
- Ensured that all highlighted code blocks are visually accessible against the dark background, improving readability for users in dark mode.
- Enhanced the `reparseKnowledge` function to accept optional process configuration overrides, allowing users to adjust parsing settings during reparse operations.
- Updated the frontend components to integrate reparse capabilities, including the `UploadConfirmDialog` and `KnowledgeBase` views, providing a user-friendly interface for confirming reparse actions.
- Added new localization strings for reparse confirmation and process configuration details in multiple languages.
- Modified the backend API to handle reparse requests with optional configuration, ensuring proper validation and persistence of overrides.
- Introduced new types and interfaces to manage reparse-specific data structures in the store, improving type safety and clarity in the codebase.
- Removed the `enable_multimodal` field from the `ChunkingConfigOverride` interface and related components to streamline configuration.
- Updated the logic in `UploadConfirmDialog.vue` to default `enableParentChild` to false when initializing from knowledge base info.
- Modified the `mergeChunkingConfig` function to ensure that `EnableParentChild` is authoritative, allowing explicit control over its state.
- Added a new test case in `knowledge_process_config_test.go` to verify the behavior of parent-child toggles in process configuration resolution.
- Updated the logic for `graph_enabled` in `UploadConfirmDialog.vue` to require both `nodeExtractConfig.enabled` and `graphEnabled` to be true.
- Added a new test case in `knowledge_process_config_test.go` to ensure that `GraphEnabled` is false when `ExtractConfig.Enabled` is false.
- Adjusted the `ResolveProcessConfig` function to reflect the updated dependency between graph and extract configurations, ensuring proper behavior in the process configuration resolution.
- Updated the `CreateKnowledgeFromFile` function to accept an optional `processConfig` parameter for per-upload parse configuration overrides.
- Introduced the `KnowledgeProcessOverrides` type to define various parsing settings, including parser engine rules and chunking configurations.
- Modified the API client and related components to handle the new process configuration, improving flexibility in knowledge file uploads.
- Updated documentation and API specifications to reflect the new `process_config` parameter in the upload process.
- Added a new `UploadConfirmHost` component to facilitate user confirmation for uploads, integrating with the updated upload logic.
- Enhanced user experience by providing detailed configuration options during the upload process.
- Added a new build argument `COMMIT_ID_ARG` to pass the commit ID during the Docker build process.
- Updated the Dockerfile to set an environment variable `VITE_FRONTEND_COMMIT` with the commit ID.
- Enhanced the Vite configuration to resolve the frontend commit ID from the environment or Git.
- Modified the SystemInfo component to display the frontend commit ID in the UI.
- Implemented a version info preparation step in the GitHub Actions workflow to capture the commit ID.
- Invalidate the single-KB detail cache when editing a KB from the list
page, matching the detail page so the sidebar/detail no longer show a
stale name/config for up to the cache TTL.
- Reject (instead of swallowing) listModels network failures so the
cache layer can tell a transient failure apart from a genuinely empty
model list and avoid caching the empty result for the whole TTL. All
UI callers already wrap listModels in try/catch.
- Guard the kb/agent in-flight handles with a generation counter so a
concurrent force refresh cannot null out a still-running request, and
clear all in-flight maps on invalidate() so stale requests cannot
repopulate the cache after invalidation.
- Introduced caching mechanisms for knowledge bases and agents to prevent redundant API calls during concurrent requests.
- Updated logic to handle creator-specific filtering for knowledge bases and agents, ensuring that non-'all' requests bypass caching.
- Improved session state handling in the settings store to ensure proper state restoration without overwriting user selections.
- Utilized `nextTick` to manage asynchronous state updates effectively, enhancing the reliability of the application state management.
- Updated components to utilize the new `useChatResourcesStore` for managing knowledge bases and agents, improving data fetching and caching mechanisms.
- Refactored `AgentSelector`, `IMChannelPanel`, `Input-field`, and `menu` components to replace direct API calls with store methods, enhancing maintainability and performance.
- Adjusted knowledge base loading logic to ensure consistency across components and reduce redundant API requests.
- Improved session state handling in `settings` store to prevent overwriting user selections during state restoration.
This commit removes Jaeger tracing support from the project, including the associated Docker configurations, Go modules, and middleware. The changes simplify the codebase by eliminating unused tracing functionality, which was previously integrated for observability. Documentation and scripts have also been updated to reflect the removal of Jaeger references.
Make the agent-facing contract uniform across the whole surface:
- cobra parse errors (unknown flag, arg-count) emit the JSON envelope by
default, not bare prose — via a single DefaultFormatMode shared by the early
resolver and ResolveDefault.
- a malformed --jq is input.invalid_argument (exit 5), not internal.error.
- destructive-confirmation messages name the real operation (edit/remove,
not a hardcoded "delete").
- `doc wait` emits one envelope (Silent failure, no contradictory stderr);
completed marshals as [] not null.
- WEKNORA_AGENT_HELP covers every leaf command, enforced by a coverage drift
guard; a sibling guard enforces --dry-run on every mutation.
- `search docs`/`search chunks` resolve --kb through the same
flag→env→project-link chain as `doc list`/`chat` (no longer a hard --kb
requirement); a linked dir or WEKNORA_KB_ID now works without --kb, and an
unresolved KB is local.kb_id_required (exit 1). The destructive
`doc delete --all` keeps its explicit-only rule.
- exit-code and batch/wait ok-semantics documented in the shared skill, README,
and AGENTS.md.
Ship weknora-shared and weknora-rag-search Agent Skills (SKILL.md plus
references) so an agent driving the CLI learns the auth flow, output contract,
exit codes, and the chat vs session-ask vs search distinction without scraping
help text.
Add CI drift guards that keep the skills honest: every ```weknora``` block must
reference a live command/flag (skillparity), and every MCP tool named in a
skill must exist in the registry (skill_tool_parity).
Unify the --kb resolver (accepts name or UUID) across kb/doc/chunk/session/
search/chat/link; `agent create` attaches knowledge bases via --attach-kb
(no longer --kb). Rename the MCP tool agent_invoke → session_ask and drop dead
MCP error codes. Add `session stop` (StopSession), completing the
start / continue-stream / stop triad.
Across these commands, bring the agent contract up to par: --dry-run previews
on mutations (incl. kb pin/unpin, session stop), agent-help blobs on the
read/health surface, accurate destructive-confirmation verbs, and search
has_more truncation signalling so an agent can tell its results were capped.
Auth now acts on the active profile instead of per-command --host/--name:
register a target with `profile add <name> --host <url> --use`, then
`auth login`. `auth login --with-token` reads an API key from stdin
(non-interactive, agent default); password login is interactive-only.
`auth token` prints the raw credential by default (clean $(...) capture);
--format json emits the {token,mode,profile} envelope, --jq implies json.
Login mode label corrected (api-key vs bearer). profile use and the auth/
profile read commands gain --dry-run / agent-help where they were missing.
Corrected the migration comments in both the up and down SQL files to reflect the accurate migration version (000059) for the 1024-dim HNSW index. This ensures clarity and consistency in the migration history.
Upstream's 000002 only adds HNSW partial indexes for dim=3584 (OpenAI
text-embedding-3-large) and dim=798. Any deployment binding bge-m3 (the
default local embedder · 1024 dim · what localhub-embedder ships) falls
back to a sequential scan of the entire embeddings table on every vector
query. Functionally correct, but ~100-500ms per query depending on KB
size · dominates p50 latency on chat/agent paths.
Add a partial HNSW index targeting dim=1024 with the same expression and
opclass as the other two (embedding::halfvec(1024) halfvec_cosine_ops).
Matches the SearchEmbedding query in repository.go verbatim so the
planner picks it up automatically.
Local measurement on a 63k-row embeddings table (Robustel_Support KB):
before · seq scan: ~100-500ms per vector query (varies)
after · index scan: ~28-30ms
CONCURRENTLY is skipped because plpgsql DO blocks open an implicit
transaction and CREATE INDEX CONCURRENTLY cannot run inside one. On
fresh installs the embeddings table is empty so this is instant. For
production backfill the operator should build the index manually using
CONCURRENTLY first; the IF NOT EXISTS guard then makes this migration a
no-op.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The "All" scope of the knowledge-base list renders every card with
`:key="kb.id"`. The same knowledge base can appear more than once in the
source data — owned *and* shared back to the caller, or shared into their
view through two different organizations (distinct share_id, identical
knowledge_base.id). Duplicate `v-for` keys corrupt Vue's virtual-DOM
patch and the list renders empty/partial. A single KB never collides, so
the page works with one KB and blanks once there are two or more — the
exact behavior reported in #795.
Extract the merge into a pure, unit-tested helper
(mergeAllScopeKnowledgeBases) that de-duplicates by knowledge-base id —
owned rows win over shared duplicates, and repeated shares of one KB keep
the most-privileged permission — while preserving the existing
pinned → mine → teammate → shared(editable-first) ordering.
Tests use the repo's existing node:test convention; a `test` script is
added so `npm test` discovers them (it also wires up the two previously
orphaned *.test.ts files).
Fixes#795
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- Modified the class binding of the doc-scroll-container to include a check for the loading state of the document list, ensuring the 'is-empty' class is applied correctly when there are no cards and documents are still loading.
- Updated the sanitization logic in `newStreamPacketDumper` to exclude the '.' character, enhancing security against path traversal vulnerabilities.
- Added checks to ensure the cleaned file path remains within the specified directory, preventing unauthorized access to the filesystem.
- Improved overall robustness of file handling by enforcing stricter path validation rules.
The global Auth middleware allowlist (noAuthAPI) was missing the
share-link routes, so an unauthenticated invitee opening /register?token=
hit a 401 on /auth/invitations/lookup and the frontend bounced them to
/login instead of showing the register page. Add both share-link
endpoints to the allowlist and stop the request interceptor from treating
their 401s as a session-expiry redirect.
Refs: https://github.com/Tencent/WeKnora/issues/1617