Skip to content

Commit fc4fe27

Browse files
committed
Fixed bug in shell reset
1 parent df30135 commit fc4fe27

File tree

4 files changed

+8
-15
lines changed

4 files changed

+8
-15
lines changed

Diff for: pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[project]
22
authors = [{ name = "Aman Rusia", email = "[email protected]" }]
33
name = "wcgw"
4-
version = "3.0.3"
4+
version = "3.0.4"
55
description = "Shell and coding agent on claude and chatgpt"
66
readme = "README.md"
77
requires-python = ">=3.11"

Diff for: src/wcgw/client/bash_state/bash_state.py

-10
Original file line numberDiff line numberDiff line change
@@ -468,16 +468,6 @@ def load_state(
468468
cwd: str,
469469
) -> None:
470470
"""Create a new BashState instance from a serialized state dictionary"""
471-
if (
472-
self._bash_command_mode == bash_command_mode
473-
and ((self._cwd == cwd) or not cwd)
474-
and (self._file_edit_mode == file_edit_mode)
475-
and (self._write_if_empty_mode == write_if_empty_mode)
476-
and (self._mode == mode)
477-
and (self._whitelist_for_overwrite == set(whitelist_for_overwrite))
478-
):
479-
# No need to reset shell if the state is the same
480-
return
481471
self._bash_command_mode = bash_command_mode
482472
self._cwd = cwd or self._cwd
483473
self._file_edit_mode = file_edit_mode

Diff for: src/wcgw/client/tools.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ def try_open_file(file_path: str) -> None:
324324
break
325325
except:
326326
continue
327-
327+
328328
# Try to open the file if a command is available
329329
if open_cmd:
330330
try:
@@ -698,7 +698,7 @@ def get_tool_output(
698698
context.console.print("Calling task memory tool")
699699
relevant_files = []
700700
warnings = ""
701-
arg.project_root_path = os.path.expanduser(arg.project_root_path)
701+
arg.project_root_path = os.path.expanduser(arg.project_root_path)
702702
for fglob in arg.relevant_file_globs:
703703
fglob = expand_user(fglob)
704704
if not os.path.isabs(fglob) and arg.project_root_path:
@@ -708,7 +708,9 @@ def get_tool_output(
708708
if not globs:
709709
warnings += f"Warning: No files found for the glob: {fglob}\n"
710710
relevant_files_data = read_files(relevant_files[:10_000], None, context)
711-
save_path = save_memory(arg, relevant_files_data, context.bash_state.serialize())
711+
save_path = save_memory(
712+
arg, relevant_files_data, context.bash_state.serialize()
713+
)
712714
if not relevant_files and arg.relevant_file_globs:
713715
output_ = f'Error: No files found for the given globs. Context file successfully saved at "{save_path}", but please fix the error.'
714716
elif warnings:

Diff for: uv.lock

+2-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)