Skip to content

fix: --continue uses last logged conversation id#1377

Open
BillionClaw wants to merge 1 commit intosimonw:mainfrom
BillionClaw:clawoss/fix/continue-last-conversation
Open

fix: --continue uses last logged conversation id#1377
BillionClaw wants to merge 1 commit intosimonw:mainfrom
BillionClaw:clawoss/fix/continue-last-conversation

Conversation

@BillionClaw
Copy link

Fixes #1140.

When using --continue without specifying a conversation ID, the code was ordering conversations by id desc which doesn't reflect the chronological order of activity. Conversation IDs are user-defined strings (like "foo", "bar") and not timestamps.

This fix queries the responses table ordered by datetime_utc to find the conversation with the most recent activity, which is the expected behavior for continuing the last conversation.

The change:

  • Queries responses instead of conversations
  • Orders by datetime_utc desc instead of id desc
  • Gets conversation_id from the most recent response

When using --continue without specifying a conversation ID, the code
was ordering conversations by 'id desc' which doesn't reflect the
chronological order of activity. This caused --continue to potentially
select the wrong conversation.

Now it queries responses ordered by datetime_utc to find the conversation
with the most recent activity.

Fixes simonw#1140
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.

llm --continue does not use the last logged conversation id

1 participant