mateclaw/mateclaw-server/src/test/java/vip/mate/channel
倪程伟 9d4041714f
fix(chat): store chat-upload path as root-relative, not absolute server path (#455)
After the workspace-aware chat-uploads change, the upload root became
absolute (the resolver normalizes via toAbsolutePath/normalize, and the
autoconfiguration rewrites baseDir to an absolute path). ChatController.upload
then set ChatUploadResponse.path to that absolute path — despite the inline
comment promising a relative path "to avoid exposing the server's absolute
path". The field is rendered into the LLM prompt ("附件: foo (path)") and
returned to the client, so this leaked the server filesystem layout into both
the prompt and the response, and broke portability if the deploy dir moves.

Extract toRelativeUploadPath(uploadRoot, convId, storedName) which makes the
path relative to the upload root's parent (preserving the trailing sub-dir
name, e.g. chat-uploads/{convId}/{storedName}) and normalizes separators to
'/'. Retrieval is unaffected: it goes through the basename-based
ChatUploadResolver and the /api/v1/chat/files/... URL, not this field.

Adds ChatControllerUploadPathTest (default root, absolute workspace-scoped
root, custom base-dir name) asserting the result is relative and leak-free.

Addresses the blocker item in #452.
2026-07-02 17:40:59 +08:00
..
feishu feat(im): resolve workflow approvals via feishu/wecom card clicks (ISSUE #413 P2-B3) (#416) 2026-06-25 09:56:36 +08:00
leader chore(test): backfill mateclaw-server/src/test/ that earlier PRIVATE_ITEMS pattern accidentally excluded 2026-05-12 17:38:08 +08:00
media feat(channel): shared inbound media pipeline with magic-byte typing and retry 2026-05-30 07:30:38 +08:00
telegram feat: 5 defensive hardenings 2026-04-15 22:14:55 +08:00
tool sync: ChannelToolProvider SPI + node-local reconcile framework for channel-native tools 2026-05-20 12:18:51 +08:00
verifier chore(test): backfill mateclaw-server/src/test/ that earlier PRIVATE_ITEMS pattern accidentally excluded 2026-05-12 17:38:08 +08:00
web fix(chat): store chat-upload path as root-relative, not absolute server path (#455) 2026-07-02 17:40:59 +08:00
webchat feat(workspace): chat-uploads 上传目录工作空间/Agent 感知化 (#422) 2026-06-26 14:20:54 +08:00
wecom feat(im): resolve workflow approvals via feishu/wecom card clicks (ISSUE #413 P2-B3) (#416) 2026-06-25 09:56:36 +08:00
weixin/error chore(channel): remove stale external-reference comments; fix(wiki): canonical slug lookup on merge path 2026-04-15 16:44:02 +08:00
ChannelAdapterStalenessTest.java chore(channel): remove stale external-reference comments; fix(wiki): canonical slug lookup on merge path 2026-04-15 16:44:02 +08:00
ChannelErrorClassifierTest.java chore(test): backfill mateclaw-server/src/test/ that earlier PRIVATE_ITEMS pattern accidentally excluded 2026-05-12 17:38:08 +08:00
ChannelManagerReconcileTest.java feat(workspace): chat-uploads 上传目录工作空间/Agent 感知化 (#422) 2026-06-26 14:20:54 +08:00
ChannelMessageRouterApprovalDenyTest.java Harden goal approval and workspace flows 2026-05-23 22:55:16 +08:00
ChannelMessageRouterDebounceTest.java chore(test): backfill mateclaw-server/src/test/ that earlier PRIVATE_ITEMS pattern accidentally excluded 2026-05-12 17:38:08 +08:00
ChannelMessageRouterGroupAttributionTest.java chore(test): backfill mateclaw-server/src/test/ that earlier PRIVATE_ITEMS pattern accidentally excluded 2026-05-12 17:38:08 +08:00
ExponentialBackoffTest.java chore(channel): remove stale external-reference comments; fix(wiki): canonical slug lookup on merge path 2026-04-15 16:44:02 +08:00
MediaPathGuardTest.java chore(test): backfill mateclaw-server/src/test/ that earlier PRIVATE_ITEMS pattern accidentally excluded 2026-05-12 17:38:08 +08:00