Repository navigation
Conversation
Apply the locally validated fixes from the 09439a5 audit rounds and PR264 review on baseline 2b51495. - Enforce explicit group-action and cross-session destination grants. - Harden TTS delivery receipts/cancellation and MCP execution/install boundaries. - Preserve prompt/search data boundaries and disable global retention by default. - Tighten asset responses, planner scope, favor CAS, and sticker import safety. - Add regression coverage without weakening the new authorization checks. Validation on Linux arm64: - Node 22.23.5 and 24.22.3: clean builds; 222 files, 2312 passed, 2 skipped. - All 13 packages pass isolated install/export/runtime smoke on both versions. - Formatting passes; lint has 0 errors and 162 warnings. - Exact source tree matches the delivered patch and source archive. Scope: 35 audit findings fixed, 8 partially hardened, 4 pending, 1 already fixed in the baseline, and 9 refactors deferred. Remaining risks include multi-tenant history ownership, asset ACLs, media resource budgets, dependency advisories, and complete SSRF controls. Runtime data and generated delivery artifacts are deliberately excluded.
Integrate the reviewed MCP, media, history, sticker and dependency follow-up patch.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0b127f1b0c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const parameters = Schema.transform(Schema.any(), (value) => { | ||
| if (!validate(value)) throw new Error("MCP parameters do not satisfy the declared JSON Schema"); | ||
| return value; | ||
| }); |
There was a problem hiding this comment.
Preserve MCP input schemas in the native tool-calling path
With nativeToolCalling enabled, HeartbeatProcessor.performNativeHeartbeat still constructs tool schemas using toolJSONSchema(definition.parameters) rather than definition.parametersJSONSchema. The new Schema.transform(Schema.any(), ...) wrapper converts to {}, so every registered MCP tool loses its object type, properties, and required arguments in the native request. Providers requiring object-shaped tool schemas can reject the entire heartbeat, while permissive providers receive no parameter contract. Use the preserved JSON Schema in both native request construction and its budget estimation.
Useful? React with 👍 / 👎.
| const data = await readMediaStream(response, limit, response.headers["content-length"]); | ||
| const type = response.headers["content-type"]?.split(";")[0].trim().toLowerCase() || getMimeType(data); |
There was a problem hiding this comment.
Decode HTTP content encodings before returning media bytes
When a server returns Content-Encoding: gzip, deflate, or br, Node's http/https response stream contains compressed bytes, but this downloader returns them unchanged under the original MIME type. SearchExtension.extractStaticPage then converts those bytes directly to UTF-8 and passes them to page.setContent, producing garbled content instead of the webpage; image downloads can similarly fail decoding. Decode the declared content encoding before returning the payload, enforcing the size limit on the decompressed stream as well.
Useful? React with 👍 / 👎.
…edia Address the two verified Codex findings on PR YesWeAreBot#265. Preserve supplied MCP JSON Schemas in native requests and budget estimates. Decode gzip, deflate and Brotli with cancellation and bounded wire, intermediate and decoded sizes. Add focused regression coverage.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 89238092b0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
||
| function assetScope(session?: AssetSession): string | undefined { | ||
| if (!session?.bot?.selfId || !session.channelId) return; | ||
| return JSON.stringify([session.platform, session.bot.selfId, session.isDirect ? "private" : "channel", session.channelId]); |
There was a problem hiding this comment.
Use the full conversation identity for asset ownership
When the same bot participates in two Telegram groups whose forum topics both have channelId: "7", this produces identical ownership scopes because it omits guildId. The repository's conversationChannelId() already handles these guild-local topic IDs. Consequently, the new read(), getInfo(), and getPublicUrl() checks accept a known asset ID from the other group, and identical media deduplicates across the two conversations. Build the asset scope from the fully qualified conversation identity.
Useful? React with 👍 / 👎.
| const parameters = Schema.transform(Schema.any(), (value) => { | ||
| if (!validate(value)) throw new Error("MCP parameters do not satisfy the declared JSON Schema"); | ||
| return value; | ||
| }); |
There was a problem hiding this comment.
Preserve typed command parameters for MCP tools
When an administrator invokes an MCP tool using a numeric, boolean, or structured key=value argument, such as tool.invoke remote limit=5, this wrapper breaks the existing conversion path. convertCommandParams() discovers property validators through the Schemastery schema, but traversing transform(any) yields no candidates, so it leaves "5" as a string and the new AJV validator rejects it. Preserve a per-property input view or make command conversion consult parametersJSONSchema, rather than requiring previously working invocations to switch to complete JSON objects.
Useful? React with 👍 / 👎.
| private cacheStorage!: StorageDriver; | ||
|
|
||
| private assetEndpoint: string; | ||
| private readonly publicSigningKey = randomBytes(32); |
There was a problem hiding this comment.
Route asset URLs to the instance that signed them
If two YesImBot instances share a Koishi HTTP server and the same configured assetEndpoint, each now generates a different signing key while registerHttpEndpoint() registers the same route for both. Even with shared asset storage and database, a valid URL issued by one instance fails the other handler's HMAC check and returns 404; the handler does not delegate on signature mismatch. Namespace signed URLs and routes by their issuing instance, or coordinate verification for a shared endpoint, so media links from both instances remain fetchable.
Useful? React with 👍 / 👎.
|
吓哭了 |
后台工具完成后,核心会把结果交回原请求,由模型继续处理,无需经过群聊意愿值结算。支持静默预取、同会话顺序排队和跨会话轮转,也允许按原请求查看各项工具的独立结果。
升级后,本地网页提取仅支持静态页面。旧媒体需要在原会话重新入库,定期历史清理需要显式启用
allowGlobalRetention。已知限制:任务保留额度耗尽时,已完成但仍在等待续接的结果可能被淘汰。