mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-04-27 17:56:23 +02:00
update CodePlanAndChangeContext
This commit is contained in:
parent
1959743d0b
commit
81b59bfe0d
2 changed files with 4 additions and 4 deletions
|
|
@ -125,6 +125,7 @@ class Engineer(Role):
|
|||
coding_context = await action.run()
|
||||
|
||||
dependencies = {coding_context.design_doc.root_relative_path, coding_context.task_doc.root_relative_path}
|
||||
# TODO: Add code plan and change file to context when _think
|
||||
if mode == "guide":
|
||||
dependencies.add(os.path.join(CODE_PLAN_AND_CHANGE_FILE_REPO, CODE_PLAN_AND_CHANGE_FILENAME))
|
||||
await src_file_repo.save(
|
||||
|
|
@ -161,8 +162,6 @@ class Engineer(Role):
|
|||
return None
|
||||
|
||||
async def _act_write_code(self):
|
||||
if CONFIG.inc:
|
||||
await self._write_code_plan_and_change()
|
||||
changed_files = await self._act_sp_with_cr(review=self.use_code_review)
|
||||
return Message(
|
||||
content="\n".join(changed_files),
|
||||
|
|
@ -376,10 +375,12 @@ class Engineer(Role):
|
|||
|
||||
async def _new_code_plan_and_change_action(self):
|
||||
"""Create a WriteCodePlanAndChange action for subsequent to-do actions."""
|
||||
# FIXME: The following code is not robust enough
|
||||
requirement_doc = await FileRepository.get_file(filename=REQUIREMENT_FILENAME, relative_path=DOCS_FILE_REPO)
|
||||
prd_docs = await FileRepository.get_all_files(relative_path=PRDS_FILE_REPO)
|
||||
design_docs = await FileRepository.get_all_files(relative_path=SYSTEM_DESIGN_FILE_REPO)
|
||||
tasks_docs = await FileRepository.get_all_files(relative_path=TASK_FILE_REPO)
|
||||
tasks_file_repo = CONFIG.git_repo.new_file_repository(TASK_FILE_REPO)
|
||||
tasks_docs = await tasks_file_repo.get_all()
|
||||
code_plan_and_change_context = CodePlanAndChangeContext(
|
||||
requirement_doc=requirement_doc,
|
||||
prd_docs=prd_docs,
|
||||
|
|
|
|||
|
|
@ -454,7 +454,6 @@ class BugFixContext(BaseContext):
|
|||
|
||||
|
||||
class CodePlanAndChangeContext(BaseContext):
|
||||
filename: str = ""
|
||||
requirement_doc: Document
|
||||
prd_docs: List[Document]
|
||||
design_docs: List[Document]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue