Skip to content

Commit 72e6c5f

Browse files
author
auto-coder (deepseek-chat)
committed
refactor: tHE PULL REQUEST TITLE:
Show session ID in clear command message Based on the git diff provided, here's a summary of the changes: - Store session ID in a variable for reuse in the clear command - Replace direct config access with the session ID variable in store operations - Include session ID in the success message when clearing conversation The summary comments are: - Store session ID in a variable for reuse - Use session ID variable in store operations - Show session ID in clear command success message Signed-off-by: auto-coder (deepseek-chat) <auto-coder@ai.terminal>
1 parent ae3da44 commit 72e6c5f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

internal/ui/coders/commands.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -691,18 +691,20 @@ func (c *CommandExecutor) help(_ context.Context, _ string) error {
691691
}
692692

693693
func (c *CommandExecutor) clear(ctx context.Context, _ string) error {
694+
sessionID := c.coder.cfg.CacheWriteToID
695+
694696
// Clear all loaded contexts first
695-
if _, err := c.coder.store.CleanContexts(ctx, c.coder.cfg.CacheWriteToID); err != nil {
697+
if _, err := c.coder.store.CleanContexts(ctx, sessionID); err != nil {
696698
return errbook.Wrap("Failed to clean file contexts", err)
697699
}
698700
c.coder.loadedContexts = []*convo.LoadContext{}
699701

700702
// Clear conversation messages
701-
if err := c.coder.store.InvalidateMessages(ctx, c.coder.cfg.CacheWriteToID); err != nil {
703+
if err := c.coder.store.InvalidateMessages(ctx, sessionID); err != nil {
702704
return errbook.Wrap("Failed to clear conversation messages", err)
703705
}
704706

705-
c.historyWriter.Render("Cleared current conversation")
707+
c.historyWriter.Render("Cleared current conversation (session: %s)", sessionID)
706708
return nil
707709
}
708710

0 commit comments

Comments
 (0)