fix: respect LLM wake prefix for empty mentions - #9890
Conversation
|
@codex review |
Codex Review SummaryThis 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: 03f0a53310
ℹ️ 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".
| messages, | ||
| should_request_llm, | ||
| ): | ||
| """Only request an immediate LLM reply when no extra prefix is required.""" |
There was a problem hiding this comment.
Document the parameterized test in Google format
Expand this one-line docstring with a Google-style Args: section describing monkeypatch, provider_wake_prefix, messages, and should_request_llm; the repository requires all newly introduced docstrings to strictly follow that format.
AGENTS.md reference: AGENTS.md:L75-L77
Useful? React with 👍 / 👎.
|
@codex review |
|
@sourcery-ai review |
|
Codex Review: Didn't find any major issues. Swish! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
Fixes #9884
An empty mention currently causes the built-in handler to yield an explicit
ProviderRequestfor its immediate courtesy reply. Explicit provider requests bypass the normalprovider_settings.wake_prefixcheck, so the LLM is invoked even when the user did not supply the configured additional LLM wake prefix.Modifications / 改动点
Normalize
provider_settings.wake_prefixagainst the configured bot wake prefixes using the same behavior as the normal agent request path.Skip only the immediate LLM-generated empty-mention reply when an additional LLM wake prefix remains required.
Preserve the existing 60-second empty-mention waiter behavior; this PR does not change session waiter scoping or address [Bug] 群聊中空提及等待器会截获其他成员的消息(session_waiter 未绑定发送者) #9377.
Add parameterized regression coverage for empty mentions, wake-prefix-only messages, normalized prefixes, and the existing no-extra-prefix behavior.
This is NOT a breaking change. / 这不是一个破坏性变更。
Screenshots or Test Results / 运行截图或测试结果
Verification steps:
Results:
The new regression test failed in the three prefix-bypass cases before the production change and passes after the fix.
Checklist / 检查清单
😊 If there are new features added in the PR, I have discussed it with the authors through issues/emails, etc.
/ 如果 PR 中有新加入的功能,已经通过 Issue / 邮件等方式和作者讨论过。
👀 My changes have been well-tested, and "Verification Steps" and "Screenshots" have been provided above.
/ 我的更改经过了良好的测试,并已在上方提供了“验证步骤”和“运行截图”。
🤓 I have ensured that no new dependencies are introduced, OR if new dependencies are introduced, they have been added to the appropriate locations in
requirements.txtandpyproject.toml./ 我确保没有引入新依赖库,或者引入了新依赖库的同时将其添加到
requirements.txt和pyproject.toml文件相应位置。😮 My changes do not introduce malicious code.
/ 我的更改没有引入恶意代码。
Summary by Sourcery
Ensure empty-mention handling honors the provider’s configured LLM wake prefix before issuing an immediate reply.
Bug Fixes:
Enhancements:
Tests: