fix(verification): 验证码提取保留原文大小写 - #103
Merged
Merged
Conversation
规则分支与 AI 回退不再强制 .upper(),verification_code 与 formatted 保持邮件原文大小写;补充回归测试。 Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
This was referenced Jul 7, 2026
Owner
This was referenced Jul 12, 2026
Closed
Merged
This was referenced Jul 26, 2026
Closed
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull request type / PR 类型
What is the current behavior? / 当前行为是什么?
验证码提取收口时对提取结果强制
.upper(),导致含字母的验证码大小写被篡改。例如邮件正文验证码为ab12cd,接口返回AB12CD(verification_code与formatted都被改)。链路:
get_verification_result→_run_generic_verification_extract→extract_verification_info_with_options→enhance_verification_with_ai_fallback。Issue Number / Issue 编号: N/A
What is the new behavior? / 新行为是什么?
outlook_web/services/verification_extractor.py移除验证码取值处的强制大写,保留邮件原文大小写:_smart_extract_code_by_keywords:return value.upper()→return value_fallback_extract_code:candidates.append(value.upper())→append(value)smart_extract_verification_code:return match.upper()→return matchfallback_extract_verification_code:filtered.append(match.upper())→append(match)(过滤判断仍基于原值,逻辑不变)enhance_verification_with_ai_fallback:result["verification_code"] = ai_code.upper()→= ai_codeformatted由verification_code重算,因此同步保持原大小写。仅改大小写取值,不改动匹配范围/置信度/互斥等其它逻辑(其余
.upper()如 HTTP method、错误码分类均保持不变)。补充回归测试:
tests/test_verification_extractor.py:规则分支小写 / 大小写混合(ab12cd、Ab12Cd)保持原样,且formatted一致tests/test_ai_fallback_trigger_condition.py:AI 回退返回cbdfdb时保持小写本地验证:新增及相关用例全部通过;
black/isort/flake8(E9,F63,F7,F82)均通过。Release notes / 发布日志
已在
CHANGELOG.md的[Unreleased] / 修复中记录:验证码提取保留原文大小写。Other information / 其他信息
无。
Link to Devin session: https://app.devin.ai/sessions/f4c5628e21d4407e9b9133c97851be53
Requested by: @ZeroPointSix