Commit Graph

2878 Commits (ff818b681f10bc29edbc48fe35f00009dc276bfa)

Author SHA1 Message Date
wizardchen ff818b681f fix: share IP classification between SSRF and sandbox URL guards
Keep one classifier for address kinds so user-fetch SSRF and sandbox
control-plane checks cannot disagree, and refuse IPv6 encodings that
embed link-local or other never-routable targets.
2026-09-01 15:35:14 +08:00
daven 9ab0602646
fix(feishu): finalize streaming card state (#2911)
* fix(feishu): finalize streaming card state

* fix(feishu): always close CardKit streaming under config

Missing stream state still sent a top-level streaming_mode field that
CardKit ignores, so long or reaped streams stayed on the thinking
preview. Always wrap settings in config, omit empty summaries, and
strip signed HTTP links from the chat-list preview.

---------

Co-authored-by: wizardchen <wizardchen@tencent.com>
2026-09-01 13:23:12 +08:00
Leon bcea5c1195
fix(im/feishu): show progress card in full output mode (#2909)
* fix(im/feishu): show progress card in full output mode

* fix(im): replace full-output thinking card after /stop

QA cancellation used to cancel Feishu CardKit updates too, leaving users
stuck on the thinking placeholder. Detach outbound sends from that
deadline, map cancel to the stop copy, and cover the failure paths.

---------

Co-authored-by: wizardchen <wizardchen@tencent.com>
2026-09-01 13:09:11 +08:00
Prodman Devokadev db05a64caa
feat: add LiteLLM as a model provider (#2923)
* feat(provider): add LiteLLM as an OpenAI-compatible provider

* docs: use revive-compliant comment for ProviderLiteLLM const

* fix(provider): stop defaulting LiteLLM to localhost under SSRF

The catalog URL localhost:4000 is blocked by default SSRF and does not
match DetectProvider, so UI/CLI could neither save nor auto-detect it.
Use a placeholder host, keep thinking aligned with generic, and sync
ModelSource across types, Swagger, and docs.

---------

Co-authored-by: wizardchen <wizardchen@tencent.com>
2026-09-01 12:21:03 +08:00
cainbit a55f4b7834
feat: support complex password (#2929)
* feat: support complex password

* fix: honor runtime complex-password policy on all password writes

Keep the service layer as the last check, share one resolver with invite
registration and admin user create, and drop the leftover startup debug print.

* fix: satisfy pre-push lint on password-policy error paths

The hook diffs against origin/main, so wrap the original error strings
and check c.Error on the new validation branches.

---------

Co-authored-by: wuwc.ew <wuwc.ew@cebwm.com>
Co-authored-by: wizardchen <wizardchen@tencent.com>
2026-09-01 11:50:10 +08:00
wizardchen 26af97df42 fix: check JWKS response body close for errcheck 2026-09-01 11:26:30 +08:00
wizardchen 5a7683cf38 fix: close OIDC id_token verification gaps for explicit endpoints
Discovery was skipped when authorization/token URLs were already set, so
jwks_uri and issuer never populated and unsigned id_token claims could
still provision accounts. Always discover missing JWKS/issuer, ignore
unverified tokens, and require kid/exp/iss/sub checks.
2026-09-01 11:26:30 +08:00
Vladimir Babin f0e14f6f00 fix: verify OIDC id_token signature via JWKS (closes #2799)
resolveOIDCUserInfo trusted id_token claims after only base64-decoding the
payload (decodeJWTClaims), with no signature or standard-claim check. A
forged id_token could therefore inject arbitrary identity claims (sub,
email, name) used to look up / auto-provision the local account.

Add verifyOIDCIDToken: fetch the provider JWKS (via the existing SSRF-safe
client), rebuild the RSA public key from the matching kid, and verify the
RS256/384/512 signature plus issuer, audience (client_id) and expiry with
golang-jwt. jwks_uri is taken from the discovery document (or explicit
config). When a jwks_uri is available, id_token verification is required
and a token that fails is rejected instead of trusted.

No new dependencies (JWK RSA key is rebuilt with crypto/rsa + math/big).
2026-09-01 11:26:30 +08:00
wizardchen bf53cacf75 fix(frontend): resolve latest value for high-risk settings
Reused setting-row controls can close over a stale item after save.
Look up the current row by key for auth.registration_mode as well so
cancel and persist use the last saved value, not the first-loaded one.
2026-09-01 11:02:18 +08:00
wuwc.ew 02ac3e794e fix(frontend): use latest system setting value 2026-09-01 11:02:18 +08:00
wizardchen 29bf7ac2c4 fix(frontend): clarify agent skill picker and open install progress in-place
Available vs uninstalled skills were easy to mix up, and installing rows
lost their action. Group the list, keep a progress control, and open the
install drawer without leaving the agent editor.
2026-09-01 10:49:46 +08:00
wizardchen e38d74a811 fix(frontend): tighten skill catalog cards and add an avatar shortcut
Summarize installs in one chip with a grouped panel, align settings
nav labels, and let admins open skill management from the user menu.
2026-08-31 20:32:12 +08:00
wizardchen af0aeb7cc2 fix(sandbox): treat in-use snapshot deletes as retryable conflicts
E2B refuses to delete a skill template while paused session sandboxes
still reference it, but reports that as HTTP 400. Classify it as
Conflict, leave the ledger row for the next sweep, and do not mark the
Langfuse span ERROR — this is expected until those sandboxes expire.
2026-08-31 19:42:32 +08:00
wizardchen 2dc8cdb334 fix(sandbox): record product-level Langfuse spans and detach idle sweeps
Docker Engine HTTP was parenting to whatever agent.round was still
recording, and the idle-sweep goroutine leaked List/Stat/Delete into
the chat tree after the tool span ended. Wrap RemoteSandboxClient with
sandbox.* spans and clone background work without the chat trace.
2026-08-31 19:42:32 +08:00
wizardchen 7fbbaffb9f fix(observability): nest follow-up completions under the chat trace
POST /suggestions often wins the race to generate follow-ups and has no
Langfuse parent, so chat.completion auto-creates an orphan root. Stamp
the originating W3C traceparent on the assistant message and resume it
before the extra LLM call.
2026-08-31 19:42:32 +08:00
LuckVd 81142dfd17
fix(docreader): keep DOCX table content in parsed text (#2898)
* fix(docreader): keep DOCX table content in parsed text

Docx.__call__ returns tables separately from the text lines, and
parse_into_text used to drop them, silently losing all table content
in documents parsed with the builtin engine. Render the tables as GFM
Markdown (header row + delimiter + data rows) and append them to the
parsed text.

Fixes #2881

* fix(docreader): render DOCX tables from grid cells in document order

Skip the HTML round-trip that treated equal or empty adjacent cells as
colspan and dropped columns from GFM. Emit one column per python-docx
grid slot and interleave tables with paragraphs in body order.

---------

Co-authored-by: root <root@localhost.localdomain>
Co-authored-by: wizardchen <wizardchen@tencent.com>
2026-08-31 17:56:17 +08:00
ResistanceTo 77245f0f4b
fix(docreader): handle Header object when stripping mhtml header (#2902)
* fix(docreader): handle Header object when stripping mhtml header

* fix(docreader): decode 8-bit MHTML headers without crashing (#2901)

compat32 wraps non-ASCII 8-bit headers as Header; str() turns them into
U+FFFD and HTML Content-Location still crashed on .lower()/urljoin.

Refs: https://github.com/Tencent/WeKnora/issues/2901

---------

Co-authored-by: wizardchen <wizardchen@tencent.com>
2026-08-31 17:14:58 +08:00
lyingbug c1b54df75d
fix(dsh-weknora): show knowledge-base figures in plugin answers (#2829) (#2895)
* fix(dsh-weknora): show knowledge-base figures in tool results (#2829)

dsh cannot load resource:// handles, and the plugin previously dropped
image_info, so Q&A returned text only. Default to public URLs and emit
Markdown images so the harness can render cited figures.

Refs: https://github.com/Tencent/WeKnora/issues/2829

* fix(dsh-weknora): rely on public URLs in content instead of image_info

Passage text already carries Markdown figures after WeKnora rewrites
resource:// handles. Drop the extra images arrays and clip restoration.
2026-08-31 15:41:34 +08:00
wizardchen a68bc532e4 docs: link dsh-weknora to its npm package page 2026-08-31 15:19:11 +08:00
wizardchen 35275d5613 fix(parser): prefer anydoc for every type it converts when linked
ppt/pptx still fall back to markitdown when anydoc is not in the binary.
pdf/docx/xlsx and other anydoc formats now default to the in-process
converter as well; csv/md stay on the Go simple reader.
2026-08-31 14:58:15 +08:00
wizardchen 6020799792 fix(parser): prefer anydoc for ppt/pptx when the binding is linked
Type-level defaults still fall back to markitdown, but a linked anydoc
build should use the in-process converter first instead of always
shipping Office decks through docreader.
2026-08-31 14:58:15 +08:00
wizardchen 52182385ec fix(parser): default ppt/pptx to markitdown when no engine rules (#2882)
Empty parser_engine_rules used to resolve to builtin, which historically
did not register ppt/pptx and failed with an unusable ValueError. Route
those types to markitdown by default on both the Go resolver and the
docreader registry, and list engines that actually support the type.

Refs: https://github.com/Tencent/WeKnora/issues/2882
2026-08-31 14:58:15 +08:00
wizardchen 8db2e4f381 ci(docreader): install Playwright WebKit for TestReadURL
The Go client URL test was a false positive: missing WebKit used to
surface as markdown content. #2883 raises instead, so CI must install
the same browser the DocReader image uses.
2026-08-31 14:12:11 +08:00
wizardchen 91186b81b7 fix(docreader): fail URL scrape instead of indexing error text (#2883)
Empty scrape/parse results were returned as "Error parsing web page: …"
and then chunked into the knowledge index, hiding the failure. Raise
WebParseError so DocReader returns error and the knowledge is marked failed.

Refs: https://github.com/Tencent/WeKnora/issues/2883
2026-08-31 14:12:11 +08:00
wizardchen 92da9c55c3 fix(frontend): keep streamed Mermaid diagrams from reverting to code (#2885)
Streaming only cached the first fence, and the loading-shell regex could
eat a painted diagram once a later mermaid block appeared. Cache every
diagram in the HTML so v-html cannot flash it back to source.

Refs: https://github.com/Tencent/WeKnora/issues/2885
2026-08-31 13:25:50 +08:00
Binks Riverton 1cb140da9d fix: reconcile direct invites after share-link join 2026-08-31 12:31:00 +08:00
十三分之五六七 4eb64da5ad fix(wiki): fall back to a knowledge QA model 2026-08-31 12:28:37 +08:00
十三分之五六七 1528fa6461 fix(s3): disable optional checksums for compatible endpoints 2026-08-31 12:25:33 +08:00
十三分之五六七 786d67609d fix(markdown): sanitize invalid UTF-8 and NUL bytes 2026-08-31 12:24:35 +08:00
wizardchen 26d9552642 fix(skills): accept evaluated PEP 508 markers in the python verifier tests
CI's system Python has packaging, so a false environment marker is skipped
silently instead of reported as a note. The install must still succeed; only
the note is conditional on whether markers can be evaluated.
2026-08-31 12:02:38 +08:00
wizardchen faefceec15 fix(skills): verify installs by loadability and repair missing deps
The gate was answering the wrong question (every .py as isolated __main__),
and the installer derived dependencies from SKILL.md prose independently.
Align import prefixes with Python's path rules, keep the gate as the only
authority, and feed its findings back for one repair round.
2026-08-31 12:02:38 +08:00
wizardchen 4d78f9dc12 feat(agent): keep max completion tokens as default or a custom cap
Unset (0) now resolves at call time (2048 / 4096 / 24576 with sandbox) so the editor can offer Default vs Custom without silently rewriting a saved value.
2026-08-30 10:52:17 +08:00
wizardchen b419058abf fix(skills): map ClawHub @owner/slug to slug plus ownerHandle
ClawHub's download API keys by the skill slug alone. Sending
owner/slug as the slug query 404'd valid listings such as
@jixinyi546-maker/emar-ppt-skill.
2026-08-30 08:46:49 +08:00
wizardchen 21244d451a feat(agent): write workspace scripts and run them with installed skills
Generated PPT/report scripts overflowed the shell_exec command cap, and
session agents kept mutating the frozen skill tree or failing SkillHub
installs on display titles. Add write/edit sandbox tools, attach the
skill venv to /workspace scripts, and accept slug-based install names.
2026-08-29 22:45:18 +08:00
wizardchen 84a35993d2 fix(agent): let file tools read staged inputs without hanging empty skill tools
list/read sandbox tools were advertised for skills-off agents so they could inspect /workspace/input, but they still refused anything outside /workspace/output. Register shell_exec independently of the skills manager so a skills-enabled sandbox with no ready skill gets a shell without empty read_skill / execute_skill_script tools.
2026-08-29 00:26:27 +08:00
hailongzhao 252e97e7d6 fix(agent): decouple sandbox shell and file tools from installed skills
shell_exec was gated on "skills enabled AND a ready skill exists", so an
agent whose skills were still installing (or had none) never received a
shell. Since shell_exec can execute skill scripts, it now follows the
SkillsEnabled switch alone.

list_sandbox_files / read_sandbox_file are pure filesystem capabilities
and no longer follow SkillsEnabled at all: they are registered whenever
the sandbox advertises a SessionFileStore, including for the installer.
2026-08-29 00:26:27 +08:00
hailongzhao 3660d5f9a8 fix(sandbox): stage chat attachments by resolving their storage ref from the temporary document
MessageAttachment.URL is json:"-" so it never survives DB serialization,
but stageSessionAttachments depended on it to read the source file, which
silently dropped every attachment before it could be written into
/workspace/input.

Resolve the storage handle from the temporary_documents row keyed by
attachment.ID (GetScoped) when the URL is missing, and pass the session
tenant through staging so shared-agent sessions look up the right row.
2026-08-29 00:26:27 +08:00
JYao-Chen 2523dc7276
fix(wiki): prevent concurrent duplicate page identities (#2850)
* fix(wiki): prevent concurrent duplicate page identities

* fix(wiki): keep identity claims stable across LLM merges and Redis

Only exact same-title pages may overwrite a Redis identity claim. Successful
Redis reads now refresh the batch-local map so concurrent batches stay
aligned, citation slugs are reclaimed, and Reduce remaps onto the claimed
slug before locking.

* fix(wiki): batch identity lookups and harden claim convergence

Exact title resolution was one seq-scan per extracted item, and a dirty Redis claim could split concurrent workers. Batch the lookup, memoize it per batch, overwrite invalid claims, and keep remapped Item.Slug in sync.

---------

Co-authored-by: wizardchen <wizardchen@tencent.com>
2026-08-28 18:10:41 +08:00
wizardchen 8f3b4fe60c ui(chat): show skill names on tool cards and render sandbox file lists
Skill steps were hard to tell apart in the stream, and list_sandbox_files fell through to raw output. Quote the skill or path in the title and add dedicated cards for read_skill and sandbox listings.
2026-08-28 15:41:03 +08:00
Roovelrz 80e2f1806d
fix(im): handle WeCom 32-byte PKCS7 padding (#2848)
* fix(im): handle WeCom 32-byte PKCS7 padding

* fix(im): validate WeCom ciphertext length
2026-08-28 15:40:42 +08:00
wizardchen 5e1752b69a fix(skills): keep catalog bundles consistent and surface partial installs
Stop treating a failed sandbox as a full success, avoid writing a SHA
when the catalog archive is missing, and pick the newest stored fork
on migrate so files and chips match the catalog users actually see.
2026-08-28 15:17:37 +08:00
wizardchen cd3f8b4a9a feat(skills): store skills in a tenant catalog and install per sandbox
A skill is a workspace definition, not a sandbox setting. Keep one catalog
row and run a full image install for each backend, so agents only enable
skills that are already ready on the sandbox they use.
2026-08-28 15:17:37 +08:00
wizardchen f79052fe67 fix(agent): keep skill-script stdout on failure for the model and UI
Failed execute_skill_script results were reduced to "exited with code 1" plus a retry hint, so the chat card hid the real stderr/stdout and the next model round could not correct arguments like a missing chart axis.
2026-08-28 15:05:42 +08:00
wizardchen 721952cea3 ui(skills): split the skill catalog out of the sandbox editor
Installing skills was buried as a wizard step. Give it a first-class settings page so admins can browse and install without opening the sandbox drawer, and keep rollout on the runtime step.
2026-08-28 10:41:24 +08:00
wizardchen 29b8fa3d9a ui(chat): refine the question outline to a tighter Codex-like rail
Pack ticks closer, hide a single-question thread, and keep the hover
preview from inheriting the 20px chat type so the query stays readable.
2026-08-27 20:10:11 +08:00
wizardchen 83d661af55 ui(sandbox): redesign personal sandbox secrets settings
Lead with skill credentials, hide empty inputs until edit, and rename the page to 沙箱密钥 so it is not mistaken for system env vars.
2026-08-27 16:55:09 +08:00
wizardchen 4ce08b16ee ui(sandbox): edit skill env vars in a popup
Only show the key when the skill declared env vars, and open the editor
as a popup like the install transcript. Hide the hover tooltip while the
popup is open and keep password managers from filling the fields.
2026-08-27 16:55:09 +08:00
wizardchen d9b3ac3ab4 fix(sandbox): allow skills to declare WEKNORA_* credential env vars
The installer reserved the entire WEKNORA_ prefix, so names like
WEKNORA_API_KEY were dropped while install still succeeded. Reserve only
the sandbox-injected names (and WEKNORA_SKILL_*), and keep that list in
one place.
2026-08-27 16:55:09 +08:00
wizardchen 46faca4619 fix(sandbox): wait until Docker containers are running before exec
ContainerStart returning success does not mean State.Running, so the first
skill-install ExecCreate can 409. Wait for running after start, and retry
once if exec still races.
2026-08-27 16:55:09 +08:00
nullptr-error 1f86e3e369
feat(chat): add a question outline for long overflowing sessions (#2839)
* feat(chat): add a question outline for long overflowing sessions

When the thread overflows, show a centered tick rail of loaded user questions on the right. Hover opens the list; click jumps to that message. Pure frontend, no API change.

* feat(chat): move question outline left with mountain hover and Q&A preview

Put the tick rail on the left inner edge. Hover grows nearby ticks like a mountain and shows a following card with that turn's question plus an answer preview.

* fix(chat): allow offsetTop on minimap tick mapping input

The type-check CI failed because tests pass measured items with offsetTop into mapQuestionTicks, which only accepted { id }.

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

---------

Co-authored-by: hailongzhao <hailongzhao@tencent.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-27 16:18:05 +08:00