Skip to content

Commit 3312659

Browse files
committed
wm: If add_dir called again, don't recreate projects, only update their status
1 parent 7095764 commit 3312659

2 files changed

Lines changed: 12 additions & 8 deletions

File tree

src/finecode/wm_server/config/read_configs.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,16 +50,20 @@ async def read_projects_in_dir(
5050
if not finecode_in_dev_workspace:
5151
status = domain.ProjectStatus.NO_FINECODE
5252

53-
new_project = domain.Project(
54-
name=def_file.parent.name,
55-
dir_path=def_file.parent,
56-
def_path=def_file,
57-
status=status,
58-
)
5953
is_new_project = def_file.parent not in ws_context.ws_projects
60-
ws_context.ws_projects[def_file.parent] = new_project
6154
if is_new_project:
55+
new_project = domain.Project(
56+
name=def_file.parent.name,
57+
dir_path=def_file.parent,
58+
def_path=def_file,
59+
status=status,
60+
)
61+
ws_context.ws_projects[def_file.parent] = new_project
6262
new_projects.append(new_project)
63+
else:
64+
# Preserve existing collected/resolved state — only update status in case
65+
# the finecode dependency was added or removed since the last scan.
66+
ws_context.ws_projects[def_file.parent].status = status
6367
return new_projects
6468

6569

src/finecode/wm_server/wm_server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -908,7 +908,7 @@ async def _handle_run_with_partial_results(
908908
dev_env = run_service.DevEnv(options.get("dev_env", "ide"))
909909
result_formats = options.get("result_formats", ["json"])
910910

911-
logger.info(f"runWithPartialResults: action={action_name} project={project_name!r} token={token} formats={result_formats}")
911+
logger.trace(f"runWithPartialResults: action={action_name} project={project_name!r} token={token} formats={result_formats}")
912912

913913
stream = await partial_results_service.run_action_with_partial_results(
914914
action_name=action_name,

0 commit comments

Comments
 (0)