Fix reloading in many occasions

This commit is contained in:
mijauexe
2025-06-26 13:54:04 +02:00
parent 61c6754c6f
commit 3b0b297a67
6 changed files with 29 additions and 11 deletions

View File

@@ -114,6 +114,7 @@ class Architect(BaseAgent):
{
"title": "Setting up backend",
"project_state_id": "be_0",
"disallow_reload": True,
"labels": ["E2 / T2", "Backend setup", "done"],
}
]

View File

@@ -189,6 +189,7 @@ class Frontend(FileDiffMixin, GitMixin, BaseAgent):
if answer.button == "yes":
fe_states = await self.state_manager.get_fe_states()
first_fe_state_id = fe_states[0].id if fe_states else None
last_fe_state_id = fe_states[-1].id if fe_states else None
await self.ui.clear_main_logs()
await self.ui.send_front_logs_headers(
@@ -201,6 +202,8 @@ class Frontend(FileDiffMixin, GitMixin, BaseAgent):
{
"title": "Building frontend",
"project_state_id": str(first_fe_state_id) if first_fe_state_id else "fe_0",
"start_id": str(first_fe_state_id) if first_fe_state_id else "fe_0",
"end_id": str(last_fe_state_id) if last_fe_state_id else "fe_0",
"labels": ["E2 / T1", "Frontend", "done"],
}
]
@@ -209,12 +212,13 @@ class Frontend(FileDiffMixin, GitMixin, BaseAgent):
[
{
"title": "Setting up backend",
"disallow_reload": True,
"project_state_id": "be_0",
"labels": ["E2 / T2", "Backend setup", "working"],
}
]
)
await self.ui.send_front_logs_headers("be_0", ["E2 / T2", "working"], "Setting up backend")
await self.ui.send_front_logs_headers("", ["E2 / T2", "working"], "Setting up backend")
return True
else:
return False

View File

@@ -74,7 +74,7 @@ class SpecWriter(BaseAgent):
[
{
"title": "",
"project_state_id": "first_state",
"project_state_id": "spec",
"labels": [""],
"convo": [
{"role": "assistant", "content": "Please describe the app you want to build."},
@@ -113,7 +113,7 @@ class SpecWriter(BaseAgent):
[
{
"title": "Writing Specification",
"project_state_id": self.current_state.id,
"project_state_id": "spec",
"labels": ["E1 / T1", "Specs", "working"],
"disallow_reload": True,
}
@@ -133,8 +133,7 @@ class SpecWriter(BaseAgent):
initial_prompt=description,
)
# await self.ui.set_important_stream()
llm_assisted_description = await llm(convo)
llm_assisted_description = "todo app" # await llm(convo)
await self.ui.send_project_stage({"stage": ProjectStage.PROJECT_NAME})
@@ -219,8 +218,18 @@ class SpecWriter(BaseAgent):
[
{
"title": "Writing Specification",
"project_state_id": self.current_state.id,
"project_state_id": "spec", # self.current_state.id,
"labels": ["E1 / T1", "Specs", "done"],
"convo": [
{
"role": "assistant",
"content": "What do you want to build?",
},
{
"role": "user",
"content": self.current_state.specification.original_description,
},
],
"disallow_reload": True,
}
]

View File

@@ -423,6 +423,7 @@ class TechLead(RelevantFilesMixin, BaseAgent):
self.next_state.flag_tasks_as_modified()
self.next_state.flag_epics_as_modified()
await self.ui.clear_main_logs()
await self.ui.send_project_stage(
{
"stage": ProjectStage.STARTING_TASK,

View File

@@ -135,7 +135,7 @@ async def start_new_project(sm: StateManager, ui: UIBase, args: Namespace = None
[
{
"title": "",
"project_state_id": "first_state",
"project_state_id": "spec",
"labels": [""],
"convo": [{"role": "assistant", "content": "Please describe the app you want to build."}],
}
@@ -213,14 +213,17 @@ async def run_pythagora_session(sm: StateManager, ui: UIBase, args: Namespace):
if sm.current_state.specification and sm.current_state.specification.original_description:
await ui.send_front_logs_headers(
"", ["E1 / T1", "Writing Specification", "working"], "Writing Specification", ""
"",
["E1 / T1", "Writing Specification", "working" if fe_states == [] else "done"],
"Writing Specification",
"",
)
await ui.send_back_logs(
[
{
"project_state_id": "spec",
"disallow_reload": True,
"labels": ["E1 / T1", "Spec", "working" if fe_states == [] else "done"],
"labels": ["E1 / T1", "Specs", "working" if fe_states == [] else "done"],
"title": "Writing Specification",
"convo": [
{
@@ -247,7 +250,7 @@ async def run_pythagora_session(sm: StateManager, ui: UIBase, args: Namespace):
if fe_states:
status = "working" if fe_states[-1].action != FE_ITERATION_DONE else "done"
await ui.send_front_logs_headers("setup", ["E2 / T1", "Frontend", status], "Building Frontend", "")
await ui.send_front_logs_headers(fe_states[0].id, ["E2 / T1", "Frontend", status], "Building Frontend", "")
await ui.send_back_logs(
[
{

View File

@@ -235,7 +235,7 @@ class PlainConsoleUI(UIBase):
async def import_project(self, project_dir: str):
pass
async def set_important_stream(self):
async def set_important_stream(self, important_stream: bool = True):
pass
async def start_breakdown_stream(self):