fix(errors): strip only the notice separator from client messages

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
ryan 2026-09-20 01:44:57 +00:00
parent fd0398d837
commit 2fb4391232
2 changed files with 5 additions and 2 deletions

View file

@ -153,7 +153,10 @@ def bug_report_issue_url(report: BugReport) -> str:
def strip_bug_report_notice(message: str) -> str:
index: Final = message.find(NOTICE_PREFIX)
return message if index == -1 else message[:index].rstrip()
if index == -1:
return message
head: Final = message[:index]
return head.removesuffix("\n")
def bug_report_notice(report: BugReport) -> str:

View file

@ -100,5 +100,5 @@ def test_strip_bug_report_notice():
report = build_bug_report(RuntimeError("boom"), surface="sdk")
notice = bug_report_notice(report)
assert strip_bug_report_notice(f"boom\n{notice}") == "boom"
assert strip_bug_report_notice(f"boom\n\n{notice}") == "boom\n"
assert strip_bug_report_notice("boom") == "boom"