Bug fixes
This commit is contained in:
@@ -106,9 +106,10 @@ def run(args: argparse.Namespace):
|
||||
llm = LLM(backend=args.backend, model=args.model)
|
||||
|
||||
# Start web dashboard if requested
|
||||
_web_server = None
|
||||
if args.web:
|
||||
from .web import start_web_server
|
||||
start_web_server(args.web, workdir)
|
||||
_web_server = start_web_server(args.web, workdir)
|
||||
print(f" \033[36m🌐 Web dashboard: http://localhost:{args.web}\033[0m")
|
||||
|
||||
logger.log("startup", f"AutoDev started in {workdir}")
|
||||
@@ -352,6 +353,15 @@ def run(args: argparse.Namespace):
|
||||
print(f" Plan: see {config.PLAN_FILE}")
|
||||
logger.log("complete", "All steps executed successfully")
|
||||
|
||||
# Shut down web server
|
||||
if _web_server:
|
||||
try:
|
||||
from .web import stop_web_server
|
||||
stop_web_server()
|
||||
_web_server.server_close()
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
|
||||
def main():
|
||||
args = parse_args()
|
||||
@@ -359,18 +369,14 @@ def main():
|
||||
run(args)
|
||||
except KeyboardInterrupt:
|
||||
print("\n\n Interrupted by user. State saved — restart to resume.")
|
||||
sys.exit(130)
|
||||
except SandboxViolation as e:
|
||||
print(f"\n \033[31m✗ SANDBOX VIOLATION: {e}\033[0m")
|
||||
sys.exit(1)
|
||||
except LLMError as e:
|
||||
print(f"\n \033[31m✗ LLM ERROR: {e}\033[0m")
|
||||
sys.exit(1)
|
||||
except Exception as e:
|
||||
print(f"\n \033[31m✗ UNEXPECTED ERROR: {e}\033[0m")
|
||||
import traceback
|
||||
traceback.print_exc()
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Reference in New Issue
Block a user