Skip to content

Fix --xl -r extracting code from oldest response instead of most recent#1524

Open
ikatyal2110 wants to merge 1 commit into
simonw:mainfrom
ikatyal2110:fix-extract-last-with-response-flag
Open

Fix --xl -r extracting code from oldest response instead of most recent#1524
ikatyal2110 wants to merge 1 commit into
simonw:mainfrom
ikatyal2110:fix-extract-last-with-response-flag

Conversation

@ikatyal2110

Copy link
Copy Markdown

When a conversation has multiple responses and you run llm logs --xl -r, the extracted code block comes from the oldest response in the conversation rather than the most recent one. This happens because the extract loop iterates rows from the start (oldest after the DESC-then-reverse ordering), while -r correctly reads from rows[-1] (newest). The fix restricts the search to rows[-1] when -r is active, so both flags operate on the same response. Fixes #821.

@ikatyal2110 ikatyal2110 force-pushed the fix-extract-last-with-response-flag branch from 4eee400 to 1b9038d Compare July 13, 2026 22:31
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