Commit Graph

2444 Commits

Author SHA1 Message Date
wizardchen c64a48647c chore(release): prepare v0.7.1
Bump version to 0.7.1 across VERSION, frontend package manifests, and the
Helm chart appVersion. Add the 0.7.1 CHANGELOG entry and refresh all README
locales (badge, latest-updates, IM channel list with Yunzhijia).

Regenerate Swagger/OpenAPI docs, refresh the architecture diagram (IM Bots
9 channels), and extend docs/QA.md with entries for the Yunzhijia IM
integration, Volcengine rerank / Zhipu web search providers, and the Neo4j
conversation-memory removal.
2026-07-24 16:53:25 +08:00
wizardchen 84f65a809f fix(agent): ensure wiki summary slugs are preserved during citation compaction
This update addresses the issue where wiki summary-page slugs (summary/<knowledgeID>) were being mangled during the citation compaction process, leading to dead links. The changes include:

- Reordering the message encoding process to ensure resource references are aliased before source references, preventing the UUID from being replaced in the summary slug.
- Implementing a new function to selectively replace document IDs while preserving the integrity of summary slugs.
- Adding unit tests to verify that summary slugs remain intact and are not altered during compaction.

This fix enhances the reliability of cross-links in the wiki system and prevents potential dead links from being generated.
2026-07-24 15:57:08 +08:00
wizardchen 5d0326f987 fix(wiki): harden slug integrity across ingest and agent write paths
Weak LLMs routinely mangle high-entropy wiki slugs (especially UUID-based
summary/<id> slugs), producing dead cross-links and cross-item dedup
hallucinations. This tightens integrity end to end:

- Ingest dedup now groups each new item with only its own trigram
  candidates and validates merges against that per-item scope, rejecting
  cross-item mispairings; candidate top-K narrowed 20 -> 5.
- Editor path aliases out-link slugs behind low-entropy ref-N tokens and
  translates them back after generation, removing the chance to mangle.
- Agent write tool normalizes/validates slugs, blocks manual creation of
  system-owned summary pages, and auto-repairs dead [[slug]] links
  (rewrite-only, never strips) via bigram/display-text resolution.
- llmresource registry aliases summary/<uuid> slugs the same way as
  storage handles so they round-trip safely through chat.

Adds unit tests for slug validation, aliasing round-trip, dead-link
repair, and dedup rejection rules.
2026-07-24 15:57:08 +08:00
wizardchen d283fabc99 fix(doris): harden Stream Load HTTP with SSRF-safe client
Doris Stream Load previously used a plain http.Client, leaving FE→BE
redirects and stored FE URLs without outbound SSRF checks. Use the shared
SSRFSafeHTTPClient, validate URLs at send time, and only forward Basic
credentials to whitelisted BE hosts after FE 307 redirects.
2026-07-24 15:10:44 +08:00
wizardchen 50eb48c344 fix(org): disambiguate shared-space terms and tighten invite search
Search tenants for invite by workspace name only (a user may belong to
multiple workspaces, so username/email matching was ambiguous). Align
organization i18n to distinguish shared spaces from workspaces, fix the
duplicate zh-CN members key, and wrap invite-code generation response in
data so the frontend and Go SDK can read it.
2026-07-24 11:42:27 +08:00
wizardchen 075b16d6ca fix: prevent TDesign textarea autosize crash in org settings popup
Avoid resetting upgrade form after destroy-on-close unmounts the textarea,
blur focus before closing the modal, and skip async form updates when closed.
2026-07-24 11:06:23 +08:00
Jack Wang 43839f7830 fix(agent): honor suggested-questions limit parameter
Treat limit as the authoritative upper bound instead of clamping it down
to the agent's Starters.Count, so ?limit=N no longer always returns 6.

Fixes #2238
2026-07-24 10:46:53 +08:00
wizardchen e0b6a71503 fix(frontend): correct optimistic organization state after review and detail loads
Follow-up fixes for the organization state sync work:

- reviewOrganizationJoinRequest no longer increments member_count when
  approving a role-upgrade request (only genuine "join" approvals add a
  member); callers pass the request_type so upgrades are excluded.
- setCurrentOrganization now merges the detail payload onto the existing
  card instead of replacing it, so list-only aggregate badges
  (share_count / agent_share_count / pending_join_request_count) are not
  transiently blanked when a detail response omits them.
- OrganizationSettingsModal clears the previous organization context when
  reopening in edit mode for a different org, avoiding a stale frame
  before the detail request resolves.

Adds pure-helper unit tests for mergeById and reviewMemberCountDelta.
2026-07-24 10:45:12 +08:00
ttommybot 014cf4e545 fix: synchronize organization state after writes 2026-07-24 10:40:33 +08:00
wizardchen 8cb43473e6 fix(knowledge): restrict source file download to Editor and above
Downloading exposes the original source file, which is more sensitive than viewing parsed content or previews. Align backend route guards, handler checks, and frontend UI so tenant Viewers and org-shared read-only access cannot download.
2026-07-23 22:19:39 +08:00
wizardchen 697e0ae04e feat(frontend): polish organization space UI and share-to-space panels
Redesign share-to-space settings for knowledge bases and agents with member-style
search, add popup, and table list; simplify the org picker dropdown. Also refresh
organization settings join-request review with table layout and approval popup.
2026-07-23 21:03:20 +08:00
wizardchen 265556950b feat(frontend): polish shared space settings and join preview UI
Redesign organization settings with grouped navigation, table-based member
and shared resource views, and anchored popups for invites and permission
upgrades. Refresh the join-space confirmation flow and soften global input
focus styling to a thin brand border without the heavy outer glow.
2026-07-23 20:32:29 +08:00
wizardchen c28cd05c0c fix(models): align model debug upload limit with global MAX_FILE_SIZE
Use the deploy-time file size configuration for model debugger uploads
instead of a hardcoded 20 MB cap, and validate file size on the frontend
before sending the request.
2026-07-23 19:43:06 +08:00
wizardchen b2ae22c4eb feat(chat): show wiki tool results in the references drawer
Parse wiki search/read/edit/issue tool outputs into structured reference
cards so agent citations and the right-side drawer work consistently with
other retrieval tools.
2026-07-23 19:41:34 +08:00
wizardchen 6fb858105a feat(llm): add prompt-cache observability and wiki cache-friendly prompts
Normalize provider-specific cache counters into TokenUsage, propagate call
purpose and prefix fingerprints through context for logging and Langfuse,
and restructure wiki page-modify prompts with warmup/singleflight to improve
prefix cache hit rates during reduce batches.
2026-07-23 19:17:30 +08:00
wizardchen 6c794f64cf feat(runtime): add bulk purge for archived queue tasks and chat_attachment i18n
Operators can clear all finally-failed tasks in one queue from the runtime
drawer, with audit logging and scoped API access. Also localize the
chat_attachment queue label in the runtime queue details table.
2026-07-23 16:52:35 +08:00
ttommybot de7507cc96 docs: clarify workspace owner cardinality 2026-07-23 16:13:35 +08:00
ttommybot a287808597 fix: prevent API keys from assigning owner role 2026-07-23 16:04:42 +08:00
wizardchen 8ae82573ab fix(mcp): coordinate OAuth token refresh and authorization polling
Prevent concurrent refresh-token rotation across instances, distinguish
expired-but-refreshable tokens from active authorization, and bind OAuth
popup polling to a per-attempt ID so stale tokens cannot satisfy new consent.
2026-07-23 15:35:24 +08:00
lhy c74b0caa35 fix(task-inspector): handle lazy queue not found errors 2026-07-23 14:24:21 +08:00
wizardchen 0869f3e829 fix(im): harden Yunzhijia image download and prune dead validation
- Follow a single download redirect while re-validating the target stays
  within the allowed host suffix; never forward the bearer token across it.
  The shared http client disables auto-redirects for SSRF safety, so a 302
  from downloadfileOpen previously failed the download outright.
- Cap in-memory download size at 32 MiB via a limited read-closer that
  errors instead of silently truncating, avoiding OOM on large responses.
- Remove dead frontend host-suffix validation branch (normalize always
  fills the default) and drop the now-unused i18n keys
  yunzhijiaAllowedHostSuffixRequired / yunzhijiaRequiredCredentials.
- Add tests for redirect follow/reject and the size limit.
2026-07-23 12:41:19 +08:00
jacentsao 85c9b61ad0 feat(im): support Yunzhijia image messages 2026-07-23 12:25:51 +08:00
wizardchen 986a6f3699 fix(tasks): detach KB deletion queue cleanup from request ctx
Run the synchronous best-effort queue scrub in DeleteKnowledgeBase with
context.WithoutCancel and kbTaskCleanupTimeout so client disconnects
cannot truncate cancellation mid-scan, matching ProcessKBDelete cleanup
semantics.
2026-07-23 12:20:03 +08:00
zhangzherui 37de0afad0 fix(tasks): dequeue work for deleted knowledge bases 2026-07-23 12:17:14 +08:00
zhangzherui 7fde37eeeb fix(search): validate hybrid search query text 2026-07-23 12:05:57 +08:00
ttommybot 97bcca21c6 fix: refresh pending join request counts after review 2026-07-23 12:03:07 +08:00
wizardchen 146e341748 refactor(http): share SSRF-safe transport across model clients
Extract NewSSRFSafeTransport and NewSSRFSafeHTTPClientWithTransport so
embedding and rerank can reuse one connection pool without allocating a
throwaway transport per client. SSRF dial and redirect policies are
unchanged; each client still keeps its own timeout.
2026-07-23 12:00:05 +08:00
zhangzherui ccf02e1a2a fix(embedding): reuse SSRF-safe HTTP transport 2026-07-23 11:51:54 +08:00
wizardchen 8ca9c117bb feat(knowledge): enhance FAQ entry filtering and tagging
- Updated the listFAQEntries function to support multiple tag IDs for filtering.
- Modified the frontend components to accommodate the new tag_ids parameter.
- Enhanced the KbTagManageDrawer and FAQEntryManager components to reflect changes in tag handling.
- Improved API documentation to clarify the new tag filtering capabilities.

This commit enhances the flexibility of FAQ entry retrieval, allowing users to filter by multiple tags for more precise results.
2026-07-23 10:50:32 +08:00
wizardchen b6a3b347da feat(knowledge): enhance FAQ export functionality
- Updated the exportFAQEntries function to support exporting FAQ entries in both CSV and JSON formats.
- Modified the frontend to include options for selecting the export format.
- Enhanced localization files to reflect the new export options in English, Russian, and Chinese.
- Implemented new tests to validate the export functionality for both formats.

This commit improves the flexibility of FAQ exports, allowing users to choose their preferred format for better integration with other tools.
2026-07-23 10:50:32 +08:00
wizardchen 135033e6df feat(knowledge): enhance FAQ import result tracking and UI
- Added new fields for tracking added, merged, and partially failed entries during FAQ imports.
- Updated the import result statistics to include detailed counts for added and merged entries.
- Enhanced the UI to display progress hints and improved import result summaries.
- Implemented a new method for saving chunks in a single transaction to improve performance.

This commit improves the visibility and accuracy of FAQ import results, providing better user feedback and tracking capabilities.
2026-07-23 10:50:32 +08:00
wizardchen 5af8eae81d feat(knowledge): enhance activity logging for FAQ imports
- Added new actions for FAQ import lifecycle: `faq.import_started`, `faq.import_completed`, and `faq.import_failed`.
- Updated activity details to include success, failure, and skipped counts for FAQ imports.
- Enhanced UI to display additional activity information, including filtering options and clearer summaries.
- Implemented tests to validate the new FAQ import outcomes and activity details.

This commit improves the tracking and visibility of FAQ import activities within the knowledge base, ensuring better audit trails and user feedback.
2026-07-23 10:50:32 +08:00
wizardchen a3a0308b62 feat(knowledge): add scoped activity audit trail 2026-07-23 10:50:32 +08:00
wolfkill f195e0494c fix(wiki): support orphan count on sqlite 2026-07-23 10:44:08 +08:00
Changjin Li 8248752e62 修复共享知识库文档预览路径 2026-07-23 10:43:31 +08:00
huangbinghe 76f9640a4f fix(dev): nc 兼容BSD netcat (#2205)
* fix(dev): nc 兼容BSD netcat
2026-07-23 10:42:08 +08:00
wizardchen 4c3ae69b49 feat(wiki): prune empty folders after document retract
Automatically remove wiki folders that become empty when knowledge is
retracted, using the durable finalize lane so pruning waits until ingest
drains. Repository DeleteFolder now atomically checks emptiness to avoid
races with concurrent page or child-folder writes.
2026-07-22 19:27:22 +08:00
unknown ab0b1d65b5 fix: correct graph and multimodal processing traces 2026-07-22 17:38:28 +08:00
wizardchen b9b81a6c3c fix(knowledge): stop async delete from leaving visible/zombie rows (#2192)
Two backend fixes for the v0.7.0 regression where a deleted document keeps
showing in the list ('delete success' toast) and a follow-up reparse then
reports the file is missing:

1. List filtering: applyKnowledgeListFilter now hides rows in the transient
   'deleting' state from the default document list. The async delete pipeline
   marks a row 'deleting' before tearing down its resources, so without this
   the entry lingers as a normal doc until it is physically gone. Rows whose
   delete task exhausts retries are flipped to 'failed' by the dead-letter
   callback and stay visible so the failure remains actionable; an explicit
   parse_status=deleting filter can still surface in-flight rows.

2. Delete ordering: DeleteKnowledge / DeleteKnowledgeList now delete the DB
   row FIRST and defer physical file (+ extracted image) cleanup until after
   the row is gone. Previously file removal ran concurrently with the
   index/chunk/graph cleanup; when one of those failed the row was kept but
   the file could already be deleted, producing a 'file missing but row
   present' zombie that could neither be reparsed nor cleanly re-deleted.
   Orphaning a file after the row is gone is the tolerable failure mode.

Adds a repository regression test covering the default/explicit deleting
visibility rules.
2026-07-22 17:30:14 +08:00
wizardchen 0f2c6cee11 fix: normalize API key expiry timestamps to UTC (#2137)
Store authorization timestamps as timestamptz and normalize Unix expiry
inputs to UTC so tenant/platform API keys expire at the intended instant
even when the app process timezone differs from the PostgreSQL session.
2026-07-22 17:09:55 +08:00
wizardchen 59fed12643 fix(chat): show model reasoning inline in agent timeline
Keep thinking events in the compact tool timeline and render expanded
reasoning inline instead of hiding it or using a separate title block.
2026-07-22 16:43:58 +08:00
wizardchen 554d273cf5 fix(knowledge): copy embedded chunk images into exports namespace
Cloned images were unreachable via GET /knowledge-bases/:id/files:
copyOwnedObject used CopyFile, which writes to the knowledge-scoped upload
layout ({tenant}/{knowledgeID}/...), but the KB proxy only serves objects
under {tenant}/exports/ (ValidateKBScopedStoragePath). Read the source
bytes and re-save via SaveBytes instead, mirroring how images are
persisted during ingestion, so copies land in the servable exports
namespace and remain independent of the source object.
2026-07-22 15:27:11 +08:00
yuefanxiao 0f422f172d fix(cli): repair acceptance e2e test for current CLI wire contract 2026-07-22 14:34:50 +08:00
wangke.2002 2e540654f1 feat: 修复IM问答无法读取session的问题 2026-07-22 14:25:55 +08:00
wizardchen 1d37b90a17 fix(knowledge): rewrite parent text chunk image URLs via global pass
For document knowledge, extracted images live in independent image_ocr/
image_caption child chunks that carry image_info, while the parent text
chunk embeds the ![](url) reference with an empty image_info. Rewriting
content per-chunk therefore missed the parent text chunk, leaving it
pointing at soon-to-be-deleted source storage.

Move content URL rewriting to a final pass over all cloned chunks, run
once urlCache holds the complete old->new mapping. FAQ chunks are
self-contained, so they are rewritten inline from the same cache.
2026-07-22 14:22:58 +08:00
wizardchen ac321a3e81 fix(knowledge): rewrite chunk content image URLs on clone
When cloning knowledge chunks, image_info was deep-copied to new storage
objects but Content still embedded the source markdown image URLs. After
the source knowledge is deleted, those in-content references break while
image_info points at the new copies. Rewrite Content alongside image_info
so both stay consistent.
2026-07-22 12:06:31 +08:00
jacentsao 7e7083ce17 feat(im): default markdown format for yunzhijia replies
SendReply now sets param.formatType=markdown by default since WeKnora
replies are authored in Markdown. Callers can override via
reply.Extra["yunzhijia_format_type"] (empty string disables the param).
2026-07-22 11:01:49 +08:00
wizardchen be48324c84 fix(frontend): keep custom theme tokens in production builds
Raise theme.css selector specificity so TDesign bundled styles cannot
override WeKnora tokens after minification, and add vite preview proxy
so production-like local testing can reach the API backend.
2026-07-21 20:29:02 +08:00
wizardchen 0d545c8c6a feat(knowledge): implement AminusB function for multiset comparison of knowledge bases
- Added AminusB method to the knowledgeRepository, which returns IDs of knowledge in A that have no counterpart in B, comparing by file_hash as a multiset.
- This implementation addresses issues with handling duplicate entries and NULL file_hash values, ensuring accurate synchronization between knowledge bases.
- Updated the KnowledgeRepository interface to reflect the new functionality and improved documentation for clarity.
2026-07-21 17:44:51 +08:00
wizardchen 516ef01cf2 refactor(api-keys): update tenant_api_keys table structure and remove legacy migration files
- Modified tenant_api_keys table to allow nullable tenant_id and added scope_type with constraints.
- Removed legacy platform API keys migration files to streamline database management.
- Added new index for scope_type to improve query performance.
2026-07-21 17:21:35 +08:00