Harden launcher preflight and port handling#357
Open
namabeeru wants to merge 1 commit into
Open
Conversation
Contributor
Author
|
Retargeted this PR to |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
--frontend-port/--backend-portinstead of hardcoding the backend port.craftbot.py,run.py, andinstaller/api.pyshare the same value.Response to review feedback
@korivi-CraftOS this addresses the two follow-up items from #347:
runtime_preflight.py: probe infrastructure failures now warn and continue.TimeoutExpired, subprocess exceptions, nonzero probe exits, missing sentinel output, malformed JSON, and non-list JSON are all treated as inconclusive. Startup only exits when the probe succeeds and returns a concrete list of missing imports.craftbot.py: frontend/backend URLs now derive from the passed port flags, including both--backend-port 8123and--backend-port=8123forms. The macOS shortcut uses the derived backend URL for its health check.CRAFTBOT IS READYnow lives in top-levelstartup_constants.py, which both the installer and agent-side code can import.Validation
/usr/local/bin/python3.10 -m pytest tests/test_run_dependency_check.py tests/test_craftbot_service.py tests/test_startup_constants_usage.py tests/test_model_factory.py -q->15 passed10/10successfully before opening this PR./usr/local/bin/python3.10 -m py_compile craftbot.py run.py app/main.py app/runtime_preflight.py installer/api.py startup_constants.py tests/test_craftbot_service.py tests/test_run_dependency_check.py tests/test_startup_constants_usage.py-> passedgit diff --check origin/main...HEAD-> passedrun.py,python -m app.main, andcraftbot.py start --cliall exited nonzero with clear missing-dependency messaging; no traceback, falseCRAFTBOT STARTED, or stale PID./usr/local/bin/python3.10:10/10successful./usr/local/bin/python3.10:3/3start/status/stop cycles successful.Repo-wide checks still have unrelated existing failures outside this PR's changed files:
/usr/local/bin/python3.10 -m pytest tests -q->101 passed, 4 failed, 16 deselected; the failures are intests/test_trigger_router_and_parking.pybecauseFakeLLM.generate_response_async()does not acceptprompt_name./usr/local/bin/python3.10 -m pytest -q-> collection errors in generated/template Living UI test directories (modelsimport andtests.conftestimport-path mismatch).