fix: validate WebUI launcher can import agent#1315
fix: validate WebUI launcher can import agent#1315ccqqlo wants to merge 3 commits intonesquena:masterfrom
Conversation
|
Thanks for catching this — the underlying problem is real and the fix is well-scoped. Confirmed against master
That's exactly the "starts healthy then chat is broken" failure mode you describe, and it has been a recurring source of confusion (people see green Fix approach is reasonableThree observations on the implementation:
A couple of small notes
RecommendationSolid bug-prevention PR. Tests are good (the AST-style probe replacement via 🤖 Automated triage via nesquena-hermes |
|
Thanks @ccqqlo! Putting this on hold pending CI review and a smaller scope split. Why it's on holdCI on this branch is failing (FAILURE on the main pytest run, two CANCELLED jobs). Before we can merge, the bootstrap-validation tests need to pass on a clean run. Scope feedbackThe PR mixes three orthogonal concerns:
What I'd like to see
Happy to review the splits when you're ready. Let me know if you want me to extract just the conftest.py change into a quick first PR while you debug the bootstrap CI failures. |
ea175e9 to
23880e1
Compare
…nto v0.50.269 The PR added an `agent_dir` parameter to ensure_python_has_webui_deps. The test_bootstrap_foreground.py tests (added in nesquena#1478) had `lambda p: p` stubs that were 1-arg only. Widened to `lambda *a, **kw: a[0]` so the stubs accept the new signature on the rebased base. Co-authored-by: ccqqlo <[email protected]>
23880e1 to
0076f3d
Compare
|
Rebased onto current master and resolved the test compatibility issue. What we kept: your full original change to What we changed: 3 lambda stubs in Why this PR is still worth shipping: it solves a different production failure mode than #1478. #1478 fixed the supervisor-respawn loop ( Test results after rebase: 3849 passed, 0 failures (was 3847 before). Your two Force-pushed back to your branch with git fetch origin
git reset --hard origin/fix/webui-agent-python-launcherRouting this into the v0.50.270 batch release. Thanks for the patient diagnosis on this one — the "fail loudly during bootstrap instead of starting healthy and later returning AIAgent not available" framing in your PR description is exactly the right shape. |
The test_ensure_python_fails_loudly_when_no_interpreter_can_import_agent test was passing locally but failing on CI runners because: 1. CI runners don't have REPO_ROOT/.venv/bin/python on the filesystem 2. The function path on missing venv calls venv.EnvBuilder(with_pip=True).create() 3. That internally calls subprocess.check_output() — a different code path than the monkey-patched bootstrap.subprocess.run, which only stubs run(). 4. CI fails with: AttributeError: NoneType has no attribute stdout The behavior under test is "what happens when no interpreter can import both WebUI deps and the agent" — NOT the venv-creation path. So we sidestep EnvBuilder by setting REPO_ROOT to tmp_path with a pre-existing .venv/bin/python file. The venv-existence check passes, EnvBuilder is skipped, the stubbed _python_can_run_webui_and_agent returns False on the final check, and the expected RuntimeError fires. Co-authored-by: ccqqlo <[email protected]>
v0.50.270 — Bootstrap launcher import validation (#1315) + Opus follow-up
|
Shipped in v0.50.270 via release PR #1487. The work landed in master via the stage-270 batch — GitHub didn't auto-mark this PR as "merged" through the no-ff merge, so closing manually. Tag Together with #1478 (v0.50.269), this completes the Bug #1 family of Bugs #2 (state.db FD leak) and #3 (HTTP-unhealthy wedge) under #1458 remain open awaiting diagnostic data. |
nesquena#1315) - CHANGELOG.md: v0.50.270 entry detailing nesquena#1315 + maintainer follow-ups - ROADMAP.md: bump to v0.50.270, 3849 tests collected - TESTING.md: bump header + total to 3849 - bootstrap.py: Opus advisor optional-followup — PYTHONPATH prepend comment nesquena#1315 by @ccqqlo (113 LOC): bootstrap.py validates launcher Python can import both yaml and run_agent.AIAgent. Companion fix to v0.50.269's nesquena#1478 — addresses the start-healthy-then-cryptic-fail mode (different from nesquena#1478's supervisor-respawn loop). 3849 tests pass. Opus advisor verdict: ship as-is. CI green on contributor branch + on local stage. QA harness all green.
Summary
run_agent.AIAgentAIAgent not availableHERMES_WEBUI_PASSWORDis set in the shellTest plan
/root/.hermes/hermes-agent/venv/bin/python -m pytest tests/test_bootstrap_python_selection.py tests/test_regressions.py::test_chat_start_returns_stream_id tests/test_regressions.py::test_chat_stream_opens_successfully tests/test_regressions.py::test_aiagent_imported_in_streaming -q