Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor restore logic #1178

Merged
merged 1 commit into from
Mar 26, 2024
Merged

Refactor restore logic #1178

merged 1 commit into from
Mar 26, 2024

Conversation

mkondratek
Copy link
Contributor

@mkondratek mkondratek commented Mar 25, 2024

This is a minor refactor needed for #1096.

It extracts the chat restore logic so it is doable to send the restore request without restoring the full session (with panels, etc).

Test plan

  1. Restore works properly

@mkondratek mkondratek self-assigned this Mar 25, 2024
} else {
chatSession.restoreAgentSession(codyAgent, modelFromState)
}
val dummyConnectionId = codyAgent.server.chatNew()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why it's dummyConnectionId ant not just connectionId?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not the one we use eventually. pls take a look:

fun updateFromState(agent: CodyAgent, state: ChatState) {
    val newConnectionId = restoreChatSession(agent, state)
    connectionId.getAndSet(newConnectionId)
    fetchLlms()
  }

Copy link
Contributor

@pkukielka pkukielka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM except one question about variable name

@mkondratek mkondratek merged commit 5f0b49e into main Mar 26, 2024
5 checks passed
@mkondratek mkondratek deleted the mkondratek/chore/restore branch March 26, 2024 15:21
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.

None yet

2 participants