Skip to content

Commit 50619fe

Browse files
author
Your Name
committed
Fix /copy-context command
1 parent 06a200d commit 50619fe

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

cecli/commands/copy_context.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
from cecli.commands.utils.base_command import BaseCommand
66
from cecli.commands.utils.helpers import format_command_result
7+
from cecli.helpers.conversation import ConversationService, MessageTag
78

89

910
class CopyContextCommand(BaseCommand):
@@ -13,13 +14,13 @@ class CopyContextCommand(BaseCommand):
1314
@classmethod
1415
async def execute(cls, io, coder, args, **kwargs):
1516
"""Execute the copy-context command with given parameters."""
16-
chunks = coder.format_chat_chunks()
17+
manager = ConversationService.get_manager(coder)
1718

1819
markdown = ""
1920

20-
# Only include specified chunks in order
21-
for messages in [chunks.repo, chunks.readonly_files, chunks.chat_files]:
22-
for msg in messages:
21+
# Only include specified chunks in order using conversation tags
22+
for tag in [MessageTag.REPO, MessageTag.READONLY_FILES, MessageTag.CHAT_FILES]:
23+
for msg in manager.get_messages_dict(tag=tag):
2324
# Only include user messages
2425
if msg["role"] != "user":
2526
continue

0 commit comments

Comments
 (0)