-
Notifications
You must be signed in to change notification settings - Fork 46.1k
Master #11426
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Master #11426
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| {"image":"mcr.microsoft.com/devcontainers/universal:2"} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,37 +1,39 @@ | ||
| import logging | ||
| from typing import TYPE_CHECKING | ||
|
|
||
| from autogpt_platform.backend.backend.util.process import AppProcess | ||
|
|
||
| from dotenv import load_dotenv | ||
|
|
||
| load_dotenv() | ||
|
|
||
| if TYPE_CHECKING: | ||
| from backend.util.process import AppProcess | ||
|
|
||
| logger = logging.getLogger(__name__) | ||
| logger: logging.Logger = logging.getLogger(__name__) | ||
|
|
||
|
|
||
| def run_processes(*processes: "AppProcess", **kwargs): | ||
| def run_processes(*processes: "AppProcess", **kwargs) -> None: | ||
| """ | ||
| Execute all processes in the app. The last process is run in the foreground. | ||
| Includes enhanced error handling and process lifecycle management. | ||
| """ | ||
| try: | ||
| # Run all processes except the last one in the background. | ||
| for process in processes[:-1]: | ||
| for process: AppProcess in processes[:-1]: | ||
| process.start(background=True, **kwargs) | ||
|
|
||
| # Run the last process in the foreground. | ||
| processes[-1].start(background=False, **kwargs) | ||
| finally: | ||
| for process in processes: | ||
| for process: AppProcess in processes: | ||
| try: | ||
| process.stop() | ||
| except Exception as e: | ||
| except Exception as e: Exception: | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bug: Invalid Python syntax π Detailed AnalysisThe line π‘ Suggested FixCorrect the syntax from π€ Prompt for AI AgentDid we get this right? π / π to inform future reviews. |
||
| logger.exception(f"[{process.service_name}] unable to stop: {e}") | ||
|
|
||
|
|
||
| def main(**kwargs): | ||
| def main(**kwargs) -> None: | ||
| """ | ||
| Run all the processes required for the AutoGPT-server (REST and WebSocket APIs). | ||
| """ | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Incorrect import path
autogpt_platform.backend.backend.util.processwill causeImportError.Severity: CRITICAL | Confidence: High
π Detailed Analysis
The import statement
from autogpt_platform.backend.backend.util.process import AppProcessuses an incorrect absolute path. The package is configured to be installed asbackend, notautogpt_platform.backend.backend, which will result in aModuleNotFoundErrorwhenapp.pyis imported, preventing the backend application from starting.π‘ Suggested Fix
Change the import statement from
from autogpt_platform.backend.backend.util.process import AppProcesstofrom backend.util.process import AppProcess.π€ Prompt for AI Agent
Did we get this right? π / π to inform future reviews.
Reference ID:
2884614