Skip to content

Preserve multiline answers and CRLF scores in MapRerankDocuments - #1591

Open
Twiink wants to merge 1 commit into
tmc:mainfrom
Twiink:codex/20261128-rerank-multiline
Open

Twiink wants to merge 1 commit into
tmc:mainfrom
Twiink:codex/20261128-rerank-multiline

Conversation

@Twiink

@Twiink Twiink commented Nov 28, 2026

Copy link
Copy Markdown

MapRerankDocuments currently keeps only the last line of a multiline answer because its answer capture does not span newlines. CRLF score lines also retain a carriage return, making a valid high score fail numeric parsing and potentially selecting a lower-ranked document. Allow multiline answers while keeping the score capture on a single line, accepting both LF and CRLF separators.

Four regressions exercise the public Run/Call paths with the existing deterministic test model, including paragraphs, lists, mixed line endings, and score-based selection. They fail on the unchanged baseline and pass with the parser fix. No external model is called.

Validation: go test -race -count=1 ./chains ./agents ./outputparser and repository-wide golangci-lint v2.3.0 pass. Unrelated full-suite integration limitations (credentials, recorded HTTP fixtures, and service containers) are unchanged. Prepared and validated with Codex.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant