- Updated .env.example to clarify skill zip upload limits and their implications for Nginx configuration.
- Refactored frontend logic to differentiate between skill zip uploads and other uploads, ensuring accurate error messages for oversized requests.
- Improved utility functions for managing upload limits and added tests to validate behavior for oversized JSON bodies.
- Enhanced error handling in various handlers to provide clearer feedback on upload size constraints, particularly for sandbox and catalog installations.
- Updated .env.example and docker-compose.yml to clarify skill bundle size limits and their implications for GitHub source downloads.
- Enhanced frontend logic to differentiate between skill bundle uploads and knowledge uploads, ensuring proper error messages for oversized requests.
- Introduced new utility functions for managing upload limits and added tests to validate behavior for oversized JSON bodies.
- Refactored error handling in various handlers to provide clearer feedback on upload size constraints.
- Updated .env.example to clarify the skill bundle size limits and their impact on Nginx configuration.
- Refactored frontend/docker-entrypoint.sh to separate max file size settings for skills and general uploads.
- Enhanced nginx.conf to apply specific body size limits for skill uploads without affecting other endpoints.
- Added tests to ensure proper handling of skill bundle file indexing and size constraints.
- Improved error handling in tenant_source.go and tenant_sandbox_config.go to manage skill file limits effectively.
- Introduced loadInstalledSkillBundle to streamline the retrieval of installed skill archives.
- Updated pinInstallsToReplacedBundle to ensure proper handling of installations when catalog definitions are updated.
- Enhanced error handling and logging for skill file retrieval and catalog archive management.
- Added tests to verify the behavior of skill installations and catalog updates, ensuring that previous archives are retained when necessary.
After a catalog install the sandbox list stays put: busy rows show a circle plus percent from the install-events stream, and “view progress” stacks the manage drawer on top. Drawer width is clamped to the viewport so the action is not pushed off-screen.
Each catalog keeps a single object: same SHA skips SaveBytes, a new zip replaces the old ref, and install rows only store CatalogID. Agent and admin caches keep the zip compressed under a 64MiB budget so read_skill does not unpack the whole tree.
Uninstalling the last install deleted the shared zip, so the catalog row stayed but files and reinstalls failed. Store the bundle on the definition and delete it only when the skill is removed from the catalog.
GitHub skill packages such as ppt-master exceed the 50MB knowledge-upload limit. Give skills their own 256MB download/upload cap, keep uninstalling visible if the list lags, and distinguish zip-entry vs skill-file errors.
Large GitHub skill folders were rejected because the installer counted the whole repo zip. Count only the SKILL.md subtree, raise the file cap, and hide uninstall while install is running.
* perf(skills): batch install verification and keep caches under budget
The tail of an install (agent_done -> verified) issued one remote exec per
check: two for permission normalisation, one per bundled script for the tree
check, three for the scratch wipe. A skill with twenty scripts paid thirty-
odd round trips, each carrying a hidden bootstrap exec and a distributed-
lock resolve, while the console sat on a finished agent with no feedback.
- normalizeSkillPermissions sends chmod and chown as one command.
- verifySkillTree folds the SKILL.md probe and one test per script into a
single command that reports every missing file instead of stopping at the
first. Exit codes 0/1/3 carry the verdict, stderr lines are the final
messages, and the two existing error texts survive verbatim.
- cleanImageScratch merges the workspace reset, the directory restore and
the cache pass into one command whose exit code is still owned by the
strict workspace half. Package caches are no longer wiped wholesale: uv,
npm and pnpm trim their own entries, and the pip/uv/npm/pnpm totals of
both accounts are kept while under 256MB and wiped whole over it, so the
next install resolves a previous download instead of the network.
- The install prompt hands the agent absolute paths for uv, npm, pnpm, pip,
python3 and node from the same one-command probe that used to ask only
whether uv exists, so it neither burns a turn on `which` nor gambles on
the shell PATH.
Tests pin the new command shapes exactly, cover quoting of archive-chosen
file names, assert the tree check stays one command regardless of script
count, exercise the budget guard against a real shell, and keep the
workspace-restore failure semantics intact.
* fix(skills): credit a script's own sys.path bootstrap for shipped modules
The python check resolved every import against the script's directory, its
ancestors up to the skill root and the venv - and nothing else. A module the
skill ships in a sibling subtree (lib/image_video.py, imported by
scripts/generate.py) was invisible to that set, so a skill whose scripts
bootstrap their own library directory was refused for a dependency no
package provides, and the repair round that followed could not fix it
either: it installs packages and is forbidden from editing the tree. One
real install spent seven minutes discovering that, three LLM stream
timeouts included.
The verifier now scans what the tree ships and statically evaluates the
sys.path.insert/append calls each script raises before its imports - the
os.path and pathlib idioms, with variables tracked in source order. A
bootstrap proven to raise the directory that provides the module turns the
finding into a note; anything unprovable stays a refusal, now naming the
shipped file instead of pretending a dependency is missing. The refusal is
unrepairable on purpose: no installer round can fix a shipped module the
import cannot reach.
Tests pin the incident's exact shape, the pathlib idiom, and the guarantee
that makes the evaluator safe: a vendored module still cannot satisfy an
import unless the script's own bootstrap provably reaches it, and modules
pip placed under .venv never count as shipped.
* feat(skills): move the install progress bar while the installer works
The progress card sat at the seeded 35% for the whole agent phase and
only jumped at agent_done. Every tool call the transcript already sees
now advances an asymptotic curve 35 + 44·(1 − e^(−k/12)): monotonic for
any round count, converging below the agent_done anchor at 80, topping
out around 75 even when max_iterations is exhausted.
Each step publishes a one-line command summary (engine hint preferred,
80-rune cap) so the admin can see what the installer is doing. After
the first round ends the activity progress is muted — verification and
repair rounds own the stage anchors (80/82) from there, and a repair
round's tool calls must not drag the bar back under them.
* fix(skills): pin the installer agent's thinking mode off
installerAgentConfig left AgentConfig.Thinking nil, which most providers
read as "defer to the model's own default" — a thinking-capable model
would reason on every ReAct round of an install, burning latency and
completion tokens on what are short shell-command turns. Set an explicit
false so every provider path (Qwen enable_thinking, Ollama think, LKEAP
thinking type) receives a deterministic off instead of a default.
* style(skills): gofmt tenant_skill_verify_python_test.go
CI rejects aligned map keys in this table-driven test; gofmt drops the extra spaces.
* docs(skills): drop the duplicated exit 1 line in the python verifier
The shipped-module case was appended by repeating the whole exit 1 block
instead of extending the existing one.
---------
Co-authored-by: hailongzhao <hailongzhao@tencent.com>
Some upstream inference gateways append an extra `""` arguments delta
right after a zero-argument tool call, so the accumulated payload becomes
`{}""` and fails to parse. RepairJSON now drops anything following the
first balanced top-level value, which also covers a duplicated payload.
Truncated JSON is left untouched so balanceBrackets can still recover it.
The app drops to appuser via gosu, so compose group_add never reaches the
process. Matching the socket GID before the drop lets a mounted Engine API
socket work without chmod 666 on the host.
* fix(auth): record last-active-tenant preference on SwitchTenant
* docs(auth): note SwitchTenant updating last-active-tenant preference
* fix(auth): persist last-active tenant before SwitchTenant tokens
RefreshToken re-resolves from this preference because refresh JWTs omit
tenant_id. Fail the switch if the write fails so a 200 never returns a
token pair whose later refresh would land in a different workspace.
* fix(cli): align HybridSearch interfaces with SDK variadic options
Client.HybridSearch gained ResourceURLOptions; CLI ChunksService and
MCP knowledgeService still used the old signature, so *Client no longer
satisfied those interfaces.
* style(cli): wrap HybridSearch signatures under the 120-column lint
---------
Co-authored-by: wizardchen <wizardchen@tencent.com>
* feat: require opt-in for the Docker sandbox backend
Docker engine access is host-root equivalent, so keep the backend off
until System Settings or WEKNORA_SANDBOX_DOCKER_ENABLED says otherwise.
Also move system-settings help into the title icon and add i18n for
tenant.auto_accept_invitation.
* fix(i18n): drop tenant wording from Docker host-risk copy
The workspace terminology check rejects 租户 / tenant in user-facing strings.
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.
* 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>
* 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>
* 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>
* 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>
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.
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).
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.
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.
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.
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.
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.
* 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>
* 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>
* 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.
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.
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.
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
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.
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
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
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.
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.
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.
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.