Repository navigation
Fix issue 115 email parsing - #128
Closed
SaiDheeraj-19 wants to merge 1 commit into
Closed
SaiDheeraj-19 wants to merge 1 commit into
SaiDheeraj-19 wants to merge 1 commit into
Conversation
SaiDheeraj-19
force-pushed
the
fix-issue-115-email-parsing
branch
from
September 22, 2026 04:28
0954b37 to
08c7003
Compare
Contributor
There was a problem hiding this comment.
Copilot review overview
🔵 Needs a closer look
Unresolved critical backward-compatibility issue plus moderate validation, calibration, parsing, CI, and evaluation setup findings.
Review effort: Lite
Findings: None
What changed in this PR
Fixes email disclaimer parsing and adds language-specific calibration, CLI/FastAPI tooling, and Chinese evaluation assets.
Changes:
- Preserve unpunctuated requests before disclaimer footers.
- Add CLI, server packaging, calibration overrides, and tests.
- Add Chinese evaluation scripts, documentation, and results.
| File | Summary and review notes |
|---|---|
tests/test_shortlist.py |
Updates test stub compatibility. |
tests/test_server_example.py |
Adds server smoke coverage; real checkpoint use creates CI dependency and resource risk (moderate, 1 vote). |
tests/test_router.py |
Tests language propagation. |
tests/test_email.py |
Updates disclaimer regression coverage. |
tests/test_cli.py |
Adds CLI tests. |
research/eval_zh/win_patch.py |
Adds Windows compatibility support. |
research/eval_zh/smoke_test.py |
Adds Chinese smoke test; should consistently disable Xet for the documented mirror (moderate, 1 vote). |
research/eval_zh/run.ps1 |
Adds PowerShell runner; virtualenv path and working-directory instructions are inconsistent (moderate, 1 vote). |
research/eval_zh/results/summary.json |
Stores aggregate evaluation results. |
research/eval_zh/results/per_case.jsonl |
Stores per-case evaluation results. |
research/eval_zh/requirements.txt |
Pins evaluation dependencies. |
research/eval_zh/README.md |
Documents evaluation setup; virtualenv location conflicts with the runner (nit, 1 vote). |
research/eval_zh/LICENSE |
Licenses evaluation tooling. |
research/eval_zh/eval_zh.py |
Implements Chinese evaluation. |
research/eval_zh/.gitignore |
Ignores local evaluation artifacts. |
README.md |
Documents CLI, server, and CJK guidance. |
pyproject.toml |
Adds packaging metadata; CI/test installation may silently skip server coverage without httpx (moderate, 2 votes). |
laya/router.py |
Adds language calibration; detected languages are not forwarded for automatic routing (moderate, 1 vote), and attach() breaks legacy two-argument agents when lang is unset (critical, 1 vote). |
laya/email.py |
Splits disclaimer paragraphs at fresh lines; indented disclaimer lines remain incorrectly glued to requests (moderate, 1 vote). |
laya/cli.py |
Implements the CLI. |
laya/agent.py |
Applies language-specific temperatures; overrides lack shape validation and partial overrides discard checkpoint defaults (moderate, 1 vote each). |
laya/__main__.py |
Enables python -m laya. |
examples/server.py |
Adds the FastAPI demo; criteria shapes should be validated according to question type (moderate, 1 vote). |
.github/workflows/ci.yml |
Expands CI coverage and dependencies. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Closes NandhaKishorM#115 - Uses a _FRESH_NEWLINE regex (newline followed by uppercase) to intelligently split unpunctuated user requests from boilerplate disclaimers. - Updates regression tests in test_email to enforce full request recovery.
SaiDheeraj-19
force-pushed
the
fix-issue-115-email-parsing
branch
from
September 22, 2026 04:37
08c7003 to
28159ef
Compare
Owner
Contributor
Author
|
Looks like the more conservative fix for this landed in `main` today!
Closing this since it's superseded. Thanks for resolving it so quickly!
…On Wed, Sep 23, 2026 at 12:45 PM Nandakishor ***@***.***> wrote:
*NandhaKishorM* left a comment (NandhaKishorM/laya#128)
<#128 (comment)>
Thank you for working on #115
<#115>'s report. #115
<#115> itself landed today with
a slightly more conservative split (it leaves uncased scripts alone and
keeps wrapped disclaimer lines together), so this is superseded. Thanks for
the effort.
—
Reply to this email directly, view it on GitHub
<#128?email_source=notifications&email_token=BKUALIP6MOR47VVO3HCCEED5QN2BNA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTKNZZGA3DMOBVGA3KM4TFMFZW63VGMF2XI2DPOKSWK5TFNZ2KYZTPN52GK4S7MNWGSY3L#issuecomment-5790668506>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BKUALINKLHDHQNHSHB4T6335QN2BNAVCNFSNUABGKJSXA33TNF2G64TZHMYTGNZVGM4DEMRVGM5US43TOVSTWNJVGM2TEOBYGIZTNILWAI>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Contributor
Author
|
"Looks like the more conservative fix for this landed in main today! Closing this since it's superseded. Thanks for resolving it so quickly!" |
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.
Closes #115
Overview
This PR resolves the critical issue where
clean_email_bodysilently drops the sender's actual request if an unpunctuated request line is immediately followed by a disclaimer footer in the same paragraph.Cause
laya/email.py::_strip_disclaimerwas previously splitting paragraphs into sentences only at punctuation[.!?]. This meant that unpunctuated strings (likeMy account is locked\nThis email is confidential...) were treated as a single sentence. Because the regex flagged the disclaimer segment, the entire chunk (including the user's request) was dropped, stripping the model of critical context.Change
A new regex trap (
_FRESH_NEWLINE = re.compile(r"\n(?=[A-Z])")) was introduced.If a boilerplate-positive sentence contains a
\n, it is now further split at newlines that start a fresh sentence (first letter uppercase).locked\nThis ...splits, keeping the request line and only dropping the disclaimer line.are\nconfidential(lowercase continuation) stays glued, ensuring wrapped boilerplate footers still drop whole.Verification
tests/test_email.pythat verifies a missing terminal punctuation mark still results in full request recovery.