Skip to content

feat(install): one-command install.sh, magnolia doctor, OpenCode memory backend, and portable tools daemon - #36

Merged
taojiang9914 merged 10 commits into
masterfrom
feat/simple-install
Dec 1, 2026
Merged

taojiang9914 merged 10 commits into
masterfrom
feat/simple-install

Conversation

@taojiang9914

Copy link
Copy Markdown
Collaborator

Summary

Brings together the fresh-install portability fixes (#35) and a guided onboarding flow so new users can clone, install, authenticate, and run Magnolia cleanly on both Linux and macOS.

Portability & MCP daemon fixes (Fixes #35)

  • Portable compchem-tools-daemon.sh:
    • Falls back cleanly from setsid(1) to Python os.setsid() + os.execvp() on macOS, uses portable UTC timestamps (date -u +%Y-%m-%dT%H:%M:%SZ), and falls back across .venv / $VIRTUAL_ENV / PATH for Python.
    • Fixes port_up() returning "000000" != "000" on ECONNREFUSED, requires both live supervisor and open MCP port, and cleans up stale $PIDFILE + returns non-zero on failure.
  • compchem-tools dependencies: Explicitly declares starlette>=0.27 and uvicorn>=0.27 in pyproject.toml.
  • magnolia fresh-install compatibility: Auto-detects OpenCode v2 on PATH when ~/.local/share/magnolia-v2/bin/opencode is absent, ensures .magnolia/ directories exist before marker writes, and adds a Python timeout fallback when GNU timeout is missing.

Guided install & setup

  • ./install.sh: Checks prerequisites (Python 3.11+, Git, curl, OpenCode), creates .venv, installs compchem-tools and compchem-memory (using uv pip when available or pip with live output), verifies server imports, initializes opencode_cc_mem/.magnolia/, and optionally links ~/.local/bin/magnolia.
  • magnolia doctor [project] & ~/.config/magnolia/env: Health-checks Python/imports, OpenCode v2, saved credentials (chmod 600 loader respecting caller env precedence), model config (fixing boolean parsing in setup_get), and compchem-tools daemon status.
  • OpenCode CLI memory backend (compchem_memory/llm.py): Adds PROVIDER_OPENCODE for opencode-go/* and opencode/* models (default opencode-go/deepseek-v4.1-flash), running opencode run --format json --standalone inside an isolated temp dir with MCP/tools disabled and stdin=subprocess.DEVNULL so the child CLI never steals stdio MCP traffic.
  • Provider-first magnolia setup picker: Lists OpenCode providers first (opencode-go, opencode, anthropic with on-demand opencode auth login, then others) with keyword filtering, 0/b back-to-providers navigation, cheap-model guidance for background memory calls, and optional direct-API key saving.
  • Docs: Simplified Quick Start and model/provider guidance in README.md and docs/getting-started.md.

Verification

  • compchem-memory full suite (pytest tests/ -q): 1148 passed, 14 skipped
  • compchem-memory provider tests (pytest tests/test_llm_providers.py -q): 80 passed
  • compchem-tools auth & resilience (pytest tests/test_server_auth.py tests/test_server_resilience.py -q): 22 passed
  • install_and_doctor_test.sh: 18 passed, 0 failed
  • compchem_tools_daemon_test.sh: 17 passed, 0 failed
  • hpc_tunnel_test.sh: 6 passed, 0 failed

…ixes #35)

- compchem-tools-daemon.sh: fall back to Python os.setsid() when setsid(1) is absent (macOS), fix port_up() false-positive on ECONNREFUSED ('000000' != '000'), require live supervisor (is_up) alongside port_up and fail fast non-zero without leaving a stale pidfile, use portable UTC date timestamps, resolve PY with MAGNOLIA_PYTHON/VIRTUAL_ENV/PATH fallback, run from opencode_cc_mem, and set +x.
- magnolia: detect OpenCode v2 on PATH when ~/.local/share/magnolia-v2/bin/opencode is absent, create opencode_cc_mem/.magnolia before writing .active-project, and use a portable timeout helper in setup.
- compchem-tools/pyproject.toml: declare starlette and uvicorn explicitly.
- tests: add softwares/bin/tests/compchem_tools_daemon_test.sh (17 assertions).
…nfig/magnolia/env

- install.sh: checks Python 3.11+, git, curl, OpenCode (with macOS/Linux hints), creates .venv, installs compchem-tools + compchem-memory, verifies imports against a temp dir, creates opencode_cc_mem/.magnolia, and optionally symlinks ~/.local/bin/magnolia.
- magnolia: add 'magnolia doctor [project]' health check, auto-load ~/.config/magnolia/env (caller env takes precedence), and offer to save a missing memory API key (chmod 600) during 'magnolia setup'.
- docs: simplify README.md Installation & First session to a 3-step quick start and lead docs/getting-started.md with ./install.sh + magnolia doctor.
- tests: add softwares/bin/tests/install_and_doctor_test.sh (12 assertions).
…background cost guidance

- compchem_memory/llm.py: add 'opencode' provider (auto-inferred for opencode-go/* models, default opencode-go/deepseek-v4.1-flash) invoking opencode run --format json --standalone inside an isolated temp dir with MCP servers and tools disabled (no separate Python API key needed).
- magnolia: add numbered OpenCode model picker in setup Step 1, background-frequency cost warning recommending opencode-go/deepseek-v4.1-flash in Step 2, 3-option memory menu (OpenCode login / numbered direct API provider / skip), and pass MAGNOLIA_OPENCODE_BIN to compchem-memory.
- docs & tests: update README.md and add 4 unit tests in test_llm_providers.py (79 passed).
@taojiang9914
taojiang9914 merged commit 6a6507d into master Dec 1, 2026
2 checks passed
@taojiang9914
taojiang9914 deleted the feat/simple-install branch December 1, 2026 20:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

tools: compchem-tools-daemon start silently does nothing on macOS

1 participant