setup.sh: fix MCP-caching install hang and wire skills/MCP into the engine#31
Open
strandline wants to merge 6 commits into
Open
setup.sh: fix MCP-caching install hang and wire skills/MCP into the engine#31strandline wants to merge 6 commits into
strandline wants to merge 6 commits into
Conversation
The MCP cache-warming loop ran `uvx <server> --help`, but stdio MCP servers ignore --help and start their JSON-RPC loop, blocking on the terminal's stdin forever (no EOF, no timeout). This hung the installer at arxiv-mcp-server. - Redirect each invocation's stdin from /dev/null so servers get an immediate EOF and exit cleanly - Add a portable run_with_timeout wrapper (default macOS lacks GNU timeout) as a backstop - Run `openclaw doctor` from $HOME instead of the repo dir, where npx otherwise resolves to this local package's unbuilt bin and silently no-ops the config validation Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
setup.sh staged the skills and MCP servers under ~/clawd but never registered them with OpenClaw, so a fresh install produced a vanilla OpenClaw with the science content orphaned on disk. Add a wire_research_stack step (Phase 5) that: - registers ~/clawd/skills via skills.load.extraDirs - adds the arxiv, semantic-scholar, biomcp, deep-research, chembl, and arxiv-latex MCP servers (probe-validated, each non-fatal so one failure never aborts the install) - prints the zotero command, which needs the user's API credentials All openclaw calls run from $HOME (not the repo) to avoid resolving the repo's own unbuilt `openclaw` bin, and are bounded by run_with_timeout. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Codex Review: Didn't find any major issues. 🚀 ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
wire_research_stack now installs SCIENCE.md (the ScienceClaw operating protocol and persona) as the workspace AGENTS.md, so the agent boots as ScienceClaw instead of OpenClaw's generic default. Previously the installer staged skills + MCP servers but left the agent with the stock OpenClaw identity, so it described itself generically. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Author
|
Added a commit that deploys |
The deployed SCIENCE.md (as AGENTS.md) conflicted with OpenClaw's generic
SOUL.md ("be a friendly general assistant"), so the agent treated the
research protocol as optional. wire_research_stack now writes a SOUL.md that
defers to AGENTS.md/SCIENCE.md as authoritative, so the agent fully adopts
the research persona.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Last change deployed the full 30KB SCIENCE.md as the workspace AGENTS.md.
OpenClaw bootstraps AGENTS.md into every session under a per-file budget
(agents.defaults.bootstrapMaxChars, default 20000), so ~1/3 of the protocol
was silently truncated each session — and sub-agents, which see only
AGENTS.md, got a cut-off persona.
Split the two roles the engine expects:
- SCIENCE.bootstrap.md (new, ~13KB) -> workspace AGENTS.md: the lean,
every-session persona + protocol (critical sections verbatim; the
database/visualization/LaTeX catalog condensed to a pointer). Fits the
budget, no truncation.
- SCIENCE.md -> workspace SCIENCE.md: the full operating manual, which
AGENTS.md instructs the agent to read on demand (kept out of the
bootstrap budget).
Fallback keeps the old behavior (SCIENCE.md as AGENTS.md) but raises
bootstrapMaxChars to 32000 so it is not truncated. Clears the
core/doctor/bootstrap-size lint warning.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
SCIENCE.md's project-directory example still pointed outputs at ~/clawd/projects/ — the same orphaned dir this PR removes elsewhere, and not the engine workspace. It also disagreed with the corrected workspace-relative path in the lean AGENTS.md. Make it workspace-relative so the every-session bootstrap and the on-demand manual agree. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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
Two fixes to
setup.sh, both found while installing ScienceClaw on macOS.1. Install hangs on MCP server caching
The Phase 4 cache-warming loop runs
uvx <server> --help, but the stdio MCP servers ignore--helpand start their JSON-RPC loop, which blocks reading stdin forever (no EOF, no timeout). In an interactive terminal the installer hangs at the first such server (arxiv-mcp-server).Fix:
/dev/nullso the server gets an immediate EOF and exits cleanly.run_with_timeoutbackstop (a default macOS has no GNUtimeout).openclaw doctorfrom$HOMEinstead of the repo dir, wherenpx openclawotherwise resolves the repo's own (unbuilt)openclawpackage and the config-validation step silently no-ops with "command not found".2. Skills + MCP servers are never wired into the engine
setup.shcopies the skills and MCP servers into~/clawdand caches the MCP packages viauvx, but nothing registers them with OpenClaw: onboarding sets the agent workspace to~/.openclaw/workspace, and the MCP servers never appear in~/.openclaw/openclaw.json. The result is a fresh install that runs as vanilla OpenClaw with the science content orphaned on disk.Fix: a
wire_research_stackstep (Phase 5) that~/clawd/skillsviaskills.load.extraDirs,arxiv,semantic-scholar,biomcp,deep-research,chembl, andarxiv-latexMCP servers withopenclaw mcp add(probe-validated; each non-fatal so one failure never aborts the install),zoterocommand, which needs the user's API credentials.All
openclawcalls run from$HOME(to avoid the local-bin trap above) and are bounded byrun_with_timeout.Validation
./setup.shon macOS — Phase 4 no longer hangs, all MCP servers cache, install completes (exit 0).openclaw config set+openclaw mcp addcommands the step emits against the published engine (2026.6.1).openclaw mcp probereports all 6 servers connecting (132 tools);openclaw skills checkshows the science skills loading via the extra dir.bash -n setup.shpasses; a dry-trace confirmswire_research_stackemits exactly the intended commands.No behavior change for users who already have a working setup — the new step is additive and re-runnable (
config setis idempotent; a duplicatemcp addjust warns).🤖 Generated with Claude Code