Repository navigation
feat(v3-dev): 完善对话执行、诊断上报与联网搜索 - #264
Conversation
|
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: 8a0f4fb816
ℹ️ 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 floor = Math.floor(Date.now() / 1000) * 1000; | ||
| this.targets.set(key, { session, channelId, floor, generation: this.world.l2_manager.getHistoryGeneration({ platform: "onebot", channelId }) }); |
There was a problem hiding this comment.
Honor the reset cutoff when registering a new backfill target
If an all-history reset completes before this chat is first observed, and both occur in the same second as pre-reset messages, this initializes the target to the current generation while rounding its cutoff down. syncPage() consequently skips its generation-change safeguard and accepts those pre-reset rows through row.time * 1000 >= target.floor; recordMessage() then writes deleted messages back into history under the new generation. Preserve the reset cutoff for newly observed targets, or conservatively exclude the ambiguous second.
Useful? React with 👍 / 👎.
| signal?.throwIfAborted(); | ||
| let url: string; | ||
| try { | ||
| url = normalizeUrl(value); |
There was a problem hiding this comment.
Preserve significant URL paths when fetching pages
For a managed fetch_webpage call whose URL has a significant trailing slash, such as a site serving different resources at /docs/ and /docs, normalizeUrl() removes that slash and fetchPage() dispatches the altered URL to every extraction engine. The tool can therefore return a different page or fail for an otherwise valid URL. Keep the validated request URL intact for retrieval rather than reusing the lossy canonicalization intended for deduplication.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5b9ac06bad
ℹ️ 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 renderModel = await this.promptService.prepareModelSystem?.(view); | ||
| const baseSystem = renderModel ? renderModel() : await this.promptService.render("agent.system", view); |
There was a problem hiding this comment.
Include model-dependent System content in packing estimates
When a custom System template contains a sizeable {{#model}} block or expands model.group.models, calling renderModel() without a model omits that content from every packWorldState estimate. RequestExecutor.execute() later inserts the fully rendered System prompt without repacking the world state, so the request can exceed contextInputBudgetTokens and fail with ContextBudgetError even when evicting old history would make it fit. Include the model-dependent content, or a conservative bound for it, in the packing estimate.
Useful? React with 👍 / 👎.
| await this.service.observeChannel(session); | ||
| this.logger.debug(`记录机器人消息 | 频道: ${conversationCid(session)} | 消息ID: ${session.messageId}`); | ||
|
|
||
| const origin = operator ? "operator" : session.scope?.startsWith("commands.") ? "framework" : getModelMessageOrigin(); |
There was a problem hiding this comment.
Let confirmed send provenance override self-message echoes
With ignoreSelfMessage false, a OneBot self-message echo arriving before after-send takes the operator path and stores origin: "operator". The later confirmed send has the same message ID and is discarded by InteractionManager.recordMessage() as a duplicate, so even a send wrapped in withModelMessageOrigin() remains permanently attributed to an operator and is presented to subsequent model calls as 〔人工操作〕. Allow confirmed send receipts to enrich an existing row's provenance, or defer operator attribution until this distinction is known.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 49ae347b57
ℹ️ 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".
| if (shouldCaptureReportConversation(this.config)) { | ||
| try { | ||
| const snapshot = context.conversation ?? this.captureConversation?.(); | ||
| secrets = conversationReportSecrets([snapshot, context.error, context.additionalInfo], secrets); |
There was a problem hiding this comment.
Collect credentials independently of conversation capture
With level: "low", a credential carried in error.context or additionalInfo and repeated verbatim in an error message or stack can be uploaded in full. For example, a context.cookie value repeated in a cause message is redacted by the legacy detailed reporter but leaks through the new low-level reporter. This gate skips conversationReportSecrets() for low, and formatLeveledDump() does not perform the legacy sanitizer's structured-credential discovery, so only the structured field is redacted, not its bare copies. Collect diagnostic credentials before applying the conversation-capture gate.
Useful? React with 👍 / 👎.
| if (target.generation !== generation) { | ||
| target.generation = generation; | ||
| target.floor = (Math.floor(Date.now() / 1000) + 1) * 1000; |
There was a problem hiding this comment.
Anchor the backfill cutoff to the clear time
For an already observed chat, the first refresh after a history clear moves the cutoff to the refresh time rather than the clear time. Consequently, every missed message between those events is permanently excluded from backfill. A clear at 110 seconds followed by a refresh at 160 seconds sets the floor to 161 seconds, so a legitimate post-clear message from 120 seconds is skipped by this and all subsequent reads. Capture the cutoff when history is invalidated and reuse it here, rounding only the ambiguous reset second.
Useful? React with 👍 / 👎.
| merged.set(url, { | ||
| title: hit.title.trim() || url, | ||
| url, |
There was a problem hiding this comment.
Keep search-result URLs separate from deduplication keys
When an engine returns a slash-sensitive URL such as https://host/docs/, this stores the slash-stripped deduplication key in the result instead of retaining the original link. The still-affected path is SearchService.search(), which calls mergeHits() for each engine and again for the final result; a subsequent fetch_webpage therefore requests /docs, even though direct-fetch validation now preserves slashes. This can retrieve a different resource or fail for a valid search result. Keep the validated retrieval URL in the hit and use the normalized value only for indexing.
Useful? React with 👍 / 👎.
修复了一些已知问题,完善对话执行、上下文维护、日志诊断和联网搜索。
lite到full-all的五档内容和身份脱敏。