Skip to content

Commit a0f0e45

Browse files
committed
attempting recovery step
Signed-off-by: vsoch <[email protected]>
1 parent c169888 commit a0f0e45

File tree

4 files changed

+19
-3
lines changed

4 files changed

+19
-3
lines changed

examples/agent/plans/run-lammps.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ plan:
55
context:
66
environment: "google cloud CPU instance in Kubernetes"
77
application: lammps
8+
# Testing max attempts for help from LLM manager
9+
max_attempts: 1
810
details: |
911
Please build the with reaxff HNS example located in examples/reaxff/HNS.
1012
Make sure to keep the full content of that directory as is, and

fractale/agent/base.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ def return_on_failure(self):
3636
"""
3737
On failure, have we reached max attempts and should return?
3838
"""
39+
print('CHECK')
40+
import IPython
41+
IPython.embed()
3942
if not self.max_attempts:
4043
return False
4144
return self.attempts > self.max_attempts

fractale/agent/build/prompts.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,11 @@
2626
"""
2727

2828
rebuild_prompt = (
29-
f"""Your previous attempt to build or run the Dockerfile failed.
29+
f"""Act as a Dockerfile builder service expert. I am trying to build a Docker image named for the application '%s' in an environment for '%s'. The previous attempt to build or run the Dockerfile failed. Here is the problematic Dockerfile:
30+
31+
```dockerfile
32+
%s
33+
```
3034
3135
Here is the error message I received:
3236
```
@@ -44,11 +48,15 @@
4448
def get_rebuild_prompt(context):
4549
environment = context.get("environment", defaults.environment)
4650
application = context.get("application", required=True)
47-
return prompt_wrapper(rebuild_prompt % context.error_message, context=context)
51+
return prompt_wrapper(
52+
rebuild_prompt % (application, environment, context.dockerfile, context.error_message),
53+
context=context,
54+
)
4855

4956

5057
build_prompt = (
51-
f"""Act as a Dockerfile builder service expert. I need to create a Dockerfile for an application '%s'.
58+
f"""Act as a Dockerfile builder service expert.
59+
I need to create a Dockerfile for an application '%s'.
5260
The target environment is '%s'.
5361
5462
Please generate a robust, production-ready Dockerfile.

fractale/agent/manager/agent.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,9 @@ def run_tasks(self, context, plan):
181181

182182
# If we reach max attempts and no success, we need to intervene
183183
else:
184+
print('FAILRE - try to respond!')
185+
import IPython
186+
IPython.embed()
184187
message = context.get("result", "")
185188
print(
186189
Panel(

0 commit comments

Comments
 (0)