Skip to content

Commit ad4c724

Browse files
aseembits93Codeflash Bot
authored andcommitted
should work
1 parent f32a11d commit ad4c724

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

codeflash/lsp/features/perform_optimization.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,4 +136,5 @@ def sync_perform_optimization(server: CodeflashLanguageServer, cancel_event: thr
136136
"patch_file": str(patch_path),
137137
"task_id": params.task_id,
138138
"explanation": best_optimization.explanation_v2,
139+
"optimization_review": best_optimization.optimization_review,
139140
}

codeflash/optimization/function_optimizer.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,7 @@ def __init__(
246246
self.executor = concurrent.futures.ThreadPoolExecutor(
247247
max_workers=n_tests + 3 if self.experiment_id is None else n_tests + 4
248248
)
249+
self.optimization_review = ""
249250

250251
def can_be_optimized(self) -> Result[tuple[bool, CodeOptimizationContext, dict[Path, str]], str]:
251252
should_run_experiment = self.experiment_id is not None
@@ -1498,15 +1499,17 @@ def process_review(
14981499
raise_pr = not self.args.no_pr
14991500
staging_review = self.args.staging_review
15001501
opt_review_response = ""
1502+
# this will now run regardless of pr, staging review flags
1503+
try:
1504+
opt_review_response = self.aiservice_client.get_optimization_review(
1505+
**data, calling_fn_details=function_references
1506+
)
1507+
except Exception as e:
1508+
logger.debug(f"optimization review response failed, investigate {e}")
1509+
data["optimization_review"] = opt_review_response
1510+
self.optimization_review = opt_review_response
15011511
if raise_pr or staging_review:
15021512
data["root_dir"] = git_root_dir()
1503-
try:
1504-
opt_review_response = self.aiservice_client.get_optimization_review(
1505-
**data, calling_fn_details=function_references
1506-
)
1507-
except Exception as e:
1508-
logger.debug(f"optimization review response failed, investigate {e}")
1509-
data["optimization_review"] = opt_review_response
15101513
if raise_pr and not staging_review and opt_review_response != "low":
15111514
data["git_remote"] = self.args.git_remote
15121515
check_create_pr(**data)

0 commit comments

Comments
 (0)