Skip to content

Commit 4900d19

Browse files
committed
fix: don't include paths for slash-command arguments, dont inlude workspace prompt on resume
1 parent cd5add7 commit 4900d19

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

gptme/cli.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -242,9 +242,13 @@ def chat(
242242
), f"Workspace path {workspace_path} does not exist"
243243
os.chdir(workspace_path)
244244

245-
# check if workspace already exists
246245
workspace_prompt = get_workspace_prompt(str(workspace_path))
247-
if workspace_prompt:
246+
# check if message is already in log, such as upon resume
247+
if (
248+
workspace_prompt
249+
and workspace_prompt not in [m.content for m in log]
250+
and "user" not in [m.role for m in log]
251+
):
248252
log.append(Message("system", workspace_prompt, hide=True))
249253

250254
# print log
@@ -256,7 +260,8 @@ def chat(
256260
# if prompt_msgs given, insert next prompt into log
257261
if prompt_msgs:
258262
msg = prompt_msgs.pop(0)
259-
msg = _include_paths(msg)
263+
if not msg.content.startswith("/"):
264+
msg = _include_paths(msg)
260265
log.append(msg)
261266
# if prompt is a user-command, execute it
262267
if execute_cmd(msg, log):

0 commit comments

Comments
 (0)