Commit Graph

31490 Commits

Author SHA1 Message Date
Frank Yang
b9df5e39d1 fix: resolve changelog merge conflict for #67047 2026-04-15 20:26:15 +08:00
Chen Chia Yang
2c236a9f4c fix(media): remove UTF-16 decoding from host-read text validation
TextDecoder("utf-16le/be") never throws on arbitrary byte pairs —
every pair of bytes is a valid Unicode scalar, so an attacker can
prepend a UTF-16 BOM (0xFF 0xFE) to binary garbage, give the file a
.csv/.md extension, and pass getTextStats with printableRatio≈1.0,
bypassing the host-read security boundary.

Remove resolveUtf16Charset and the UTF-16 branches from decodeHostReadText.
The Latin-1 fallback (gated by hasSingleByteTextShape) already covers
the most common non-UTF-8 real-world case: Excel CSV exports with
accented characters like é, ñ. UTF-16 CSVs are extremely rare and
users can trivially re-save as UTF-8.

Adds two regression tests:
- NUL-padded (0x00/0xFF) must be rejected
- BOM-prefixed (0xFF 0xFE + 0xFF garbage) must be rejected

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-15 20:25:50 +08:00
Chen Chia Yang
3ab1088fc2 fix(media): require BOM for UTF-16 detection to close NUL-padded bypass
The NUL-heavy heuristic in resolveUtf16Charset was unsafe as a security
gate: TextDecoder("utf-16le") never throws, so every byte pair in an
opaque binary (e.g. repeating 0x00/0xFF) decodes to a printable code
point and passes the text-stats check, allowing the upload.

Remove the heuristic; only a leading BOM (0xFF 0xFE / 0xFE 0xFF) now
triggers UTF-16 decoding. Without a BOM the strict UTF-8 path runs
first, and NUL-padded binaries are then rejected by hasSingleByteTextShape
(0x00 bytes are control bytes).

Adds a regression test: 9000-byte alternating-NUL/0xFF buffer must be
rejected as path-not-allowed.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-15 20:25:50 +08:00
Chen Chia Yang
a55d38ed6c fix(media): tighten hasSingleByteTextShape to reject mixed ASCII/high-byte blobs
Raise the ASCII floor to 70% and add an explicit 30% high-byte cap.
The previous 50% threshold accepted alternating 0x41/0xFF buffers
(50% ASCII, 0 control bytes), which decoded through Latin-1 and passed
the printable-ratio gate — allowing opaque binary data to slip through
as a CSV or Markdown document.

Real single-byte text exports (e.g. Excel Latin-1 CSVs with accented
chars like é, ñ) rarely exceed 20-25% high bytes, so the tighter
thresholds do not regress legitimate input.

Adds a regression test: 9000 bytes alternating 'A'/0xFF must be
rejected as path-not-allowed.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-15 20:25:50 +08:00
Frank Yang
ac89e9d964 fix: allow single-byte host-read text 2026-04-15 20:25:50 +08:00
Frank Yang
cff3445a6f fix: allow punctuation-heavy host-read text 2026-04-15 20:25:50 +08:00
Frank Yang
856c88f25f fix: validate full host-read text payload 2026-04-15 20:25:50 +08:00
Frank Yang
604a024067 fix: harden host-read text fallback 2026-04-15 20:25:50 +08:00
Chen Chia Yang
cb572783fb fix(media): remove unnecessary non-null assertion flagged by oxlint 2026-04-15 20:25:50 +08:00
Chen Chia Yang
9aaf63ef4c fix(media): replace null-byte heuristic with full C0 control-char check
The previous null-byte check was too narrow — binary payloads with no 0x00
bytes (e.g. short/unsupported formats) could still pass. Replace it with
looksLikeText(), which rejects any byte in the C0 control range (0x00–0x08,
0x0E–0x1F, 0x7F), matching the same heuristic used by git and the file
command to distinguish text from binary. Bytes ≥ 0x80 are kept so UTF-8,
Latin-1, and Windows-1252 encoded files continue to pass.
2026-04-15 20:25:50 +08:00
Chen Chia Yang
f66e08a23f fix(media): scan full buffer for null bytes in CSV/Markdown host-read check
The previous check only scanned the first 8 KiB, leaving a window where a
file with a null-free prefix followed by binary content could pass the guard.
Scan the entire buffer to close that gap.
2026-04-15 20:25:50 +08:00
Chen Chia Yang
f653bcc54e fix(media): address Greptile review — fix dead-code exception and broken test
Two issues flagged by Greptile:

1. CSV/Markdown exception was dead code.
   file-type v22 returns undefined (not "text/plain") for plain-text buffers
   that have no binary magic bytes. The guard `sniffedMime === "text/plain"`
   was therefore always false, so the early-return never fired and CSV uploads
   continued to be rejected.

   Fix: check `!sniffedMime` (no binary signature) and add a null-byte scan
   of the first 8 KiB to rule out binary data that happens to have no known
   magic bytes. Pass buffer into assertHostReadMediaAllowed to enable this.

2. "rejects binary disguised as CSV" test used PNG bytes.
   assertHostReadMediaAllowed allows all image kinds unconditionally
   (sniffedKind === "image" → early return), so the promise resolved instead
   of rejecting. The test would have failed with "Received promise resolved".

   Fix: use ZIP magic bytes (PK\x03\x04). file-type detects application/zip,
   which is not image/audio/video, so it falls through to the final throw.
2026-04-15 20:25:50 +08:00
Chen Chia Yang
cbc040c3ab fix(media): also allow host-local Markdown uploads
Extend the text/plain sniff exception to cover text/markdown in addition
to text/csv. Both formats are structurally indistinguishable from plain
text at the byte level, so the same pattern applies.
2026-04-15 20:25:50 +08:00
Chen Chia Yang
5735772de6 fix(media): allow host-local CSV uploads via Slack (#63604)
CSV files (text/csv) were rejected by assertHostReadMediaAllowed because
content sniffers report text/plain for CSV — CSV is structurally
indistinguishable from plain text at the byte level.

Fix:
- Add text/csv to HOST_READ_ALLOWED_DOCUMENT_MIMES
- Add a targeted exception: when sniffed MIME is text/plain AND the
  extension-derived MIME is text/csv, allow the upload. The text/plain
  sniff already confirms the content is valid UTF-8 text (not binary),
  so the .csv extension is sufficient to confirm operator intent.

Binary data disguised as .csv is still rejected because its sniffed MIME
will not be text/plain (e.g. a PNG file sniffs as image/png).

Fixes #63604
2026-04-15 20:25:49 +08:00
Vincent Koc
f49d9bcae9 test(gateway): harden non-isolated channel mocks 2026-04-15 10:02:05 +01:00
scotthuang
7734a40a56 fix(ui): skip chat history reload during active sends to prevent mess… (#66997)
Merged via squash.

Prepared head SHA: cec28cfa90
Co-authored-by: scotthuang <1670837+scotthuang@users.noreply.github.com>
Co-authored-by: vincentkoc <25068+vincentkoc@users.noreply.github.com>
Reviewed-by: @vincentkoc
2026-04-15 09:56:24 +01:00
Srinivas Pavan
fb4395c1fe fix(cron): preserve all fields in announce delivery by removing summarization instruction (#65638)
* fix(cron): preserve all fields in announce delivery by removing summarization instruction

The delivery instruction appended to the cron agent prompt contained the word
'summary', causing LLMs to condense structured output non-deterministically and
drop fields on delivery. Replace with 'response' and add explicit instruction
to reproduce all fields exactly.

Fixes #58535

* chore(changelog): add cron announce entry

---------

Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
2026-04-15 09:40:26 +01:00
Vincent Koc
ea4889ecdc fix(update): keep dist verify compat-safe 2026-04-15 09:39:18 +01:00
Vincent Koc
9e665e4328 fix(ts): use typed runtime semver helpers 2026-04-15 09:20:26 +01:00
Vincent Koc
7f35f76914 fix(update): harden dist inventory handling 2026-04-15 09:16:46 +01:00
Xin Sun
df918c4de5 feat(memory-lancedb): add cloud storage support to memory-lancedb (#63502)
* feat(memory-lancedb): add cloud storage support to memory-lancedb

- Pass storageOptions to LanceDB connection

# Conflicts:
#	extensions/memory-lancedb/index.ts

# Conflicts:
#	extensions/memory-lancedb/config.ts

* support env var

* make storageOptions sensitive
2026-04-15 16:07:49 +08:00
Ayaan Zaidi
94d5c3dd6b fix: prune stale dist chunks after npm upgrades (#66959) 2026-04-15 13:22:04 +05:30
Ayaan Zaidi
2e61d2ce3f fix(lint): drop dead compat sidecar imports 2026-04-15 13:22:04 +05:30
Ayaan Zaidi
a1d4eb255a fix(inventory): omit qa-matrix dist artifacts 2026-04-15 13:22:04 +05:30
Ayaan Zaidi
2791b00e72 fix(build): move compat sidecars into src 2026-04-15 13:22:04 +05:30
Ayaan Zaidi
8b79141997 fix(update): infer legacy bundled sidecars 2026-04-15 13:22:04 +05:30
Ayaan Zaidi
2a8226f8e2 fix(postinstall): reject dist symlink escapes 2026-04-15 13:22:04 +05:30
Ayaan Zaidi
64f258fc49 fix(update): keep downgrade follow-ups in-process 2026-04-15 13:22:04 +05:30
Ayaan Zaidi
60e2ccbd5b fix(update): preserve legacy downgrade verify 2026-04-15 13:22:04 +05:30
Ayaan Zaidi
aaa6b05f3b fix(update): preserve legacy global verify 2026-04-15 13:22:04 +05:30
Ayaan Zaidi
9e1df98475 fix(postinstall): reject unsafe dist symlinks 2026-04-15 13:22:04 +05:30
Ayaan Zaidi
5e7306bcfc fix(update): filter dist inventory to packed files 2026-04-15 13:22:04 +05:30
Ayaan Zaidi
1077cb74f9 test(postinstall): use real dist inventory fixtures 2026-04-15 13:22:04 +05:30
Ayaan Zaidi
5754667c87 fix(postinstall): prune stale packaged dist files 2026-04-15 13:22:04 +05:30
Ayaan Zaidi
18d0af3a13 fix(update): verify packaged dist inventory 2026-04-15 13:22:04 +05:30
Peter Steinberger
277885f0a4 build: refresh plugin sdk api baseline 2026-04-15 08:09:48 +01:00
Sliverp
dd90297dfc doc:add qq support to README (#67039)
* doc:add qq support to README

* Update README.md

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>

---------

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
2026-04-15 15:08:48 +08:00
Mason Huang
059d4b6d47 docs-i18n: add behavior baseline fixtures (#64073)
Merged via squash.

Prepared head SHA: 4ccd4c5fc0
Co-authored-by: hxy91819 <8814856+hxy91819@users.noreply.github.com>
Co-authored-by: hxy91819 <8814856+hxy91819@users.noreply.github.com>
Reviewed-by: @hxy91819
2026-04-15 15:03:49 +08:00
Chunyue Wang
6aa4515798 fix(context-engine): gracefully degrade to legacy engine on third-party plugin resolution failure (#66930)
Merged via squash.

Prepared head SHA: 969c67716c
Co-authored-by: openperf <80630709+openperf@users.noreply.github.com>
Co-authored-by: openperf <80630709+openperf@users.noreply.github.com>
Reviewed-by: @openperf
2026-04-15 14:59:29 +08:00
Ivan Fofanov
732db75279 fix: classify "No conversation found" as session_expired (#65028)
Merged via squash.

Prepared head SHA: f429ba2de0
Co-authored-by: Ivan-Fn <1247214+Ivan-Fn@users.noreply.github.com>
Co-authored-by: altaywtf <9790196+altaywtf@users.noreply.github.com>
Reviewed-by: @altaywtf
2026-04-15 09:31:55 +03:00
github-actions[bot]
9b1b56aad1 chore(ui): refresh uk control ui locale 2026-04-15 05:45:22 +00:00
github-actions[bot]
8602c81068 chore(ui): refresh id control ui locale 2026-04-15 05:45:18 +00:00
github-actions[bot]
2e230021b6 chore(ui): refresh pl control ui locale 2026-04-15 05:45:14 +00:00
github-actions[bot]
b778253cca chore(ui): refresh tr control ui locale 2026-04-15 05:45:08 +00:00
github-actions[bot]
1c3c9c9d29 chore(ui): refresh ko control ui locale 2026-04-15 05:44:02 +00:00
github-actions[bot]
0c3354c320 chore(ui): refresh es control ui locale 2026-04-15 05:44:00 +00:00
github-actions[bot]
bf136ab1d9 chore(ui): refresh fr control ui locale 2026-04-15 05:43:58 +00:00
github-actions[bot]
1d8713bae3 chore(ui): refresh ja-JP control ui locale 2026-04-15 05:43:54 +00:00
github-actions[bot]
0ac265f418 chore(ui): refresh pt-BR control ui locale 2026-04-15 05:42:42 +00:00
github-actions[bot]
d204471879 chore(ui): refresh zh-CN control ui locale 2026-04-15 05:42:39 +00:00