Refactor post-create scripts for improved setup and diagnostics - #11
Merged
Merged
Conversation
…pgrep installation
…ate start-hermes.sh for improved configuration handling
…ma version and refine self-check diagnostics
…rganization; streamline installation and configuration steps
…t script execution
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors the Hermes devcontainer bootstrap to install/start additional local services (ModelRelay, OmniRoute, Ollama, Mnemon, Tailscale), apply first-run Hermes defaults, and run a new boot-time health self-check; it also adds a Mnemon-focused “memory automation” skill and updates the devcontainer post-start hook to a new startup script.
Changes:
- Add a new
start-hermes.shentrypoint for post-start service startup + Hermes defaults + self-check execution. - Add
self-check.shhealth diagnostics (stdout + JSON + optional Telegram notification). - Expand
post-create-cmd.shto install additional dependencies (Ollama, OmniRoute, Mnemon, Tailscale) and seed Hermes/Cline defaults; updatedevcontainer.jsonto call the new startup script.
Reviewed changes
Copilot reviewed 5 out of 7 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| .devcontainer/start-hermes.sh | New post-start orchestrator to start background services, initialize Hermes config, and run health checks |
| .devcontainer/skill-memory-automation.md | Added documentation/skill guide for Mnemon-backed memory persistence workflow |
| .devcontainer/self-check.sh | New boot-time health diagnostics with JSON output and optional Telegram notification |
| .devcontainer/post-create-cmd.sh | Expanded dependency install + Hermes defaults seeding + Cline config installation |
| .devcontainer/devcontainer.json | Switch postStartCommand to the new Hermes startup script |
| .devcontainer/cline-secrets.json | New template secrets file for Cline |
| .devcontainer/cline-globalState.json | New default Cline globalState template pointing at local ModelRelay base URL |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # Poll all service ports until all respond or timeout | ||
| PORT_POLL_TIMEOUT=60 | ||
| POLL_STARTED_AT=$(date +%s) | ||
| declare -A RESPONDED=([3000]="" [8888]="" [7352]="" [20128]="", [9119]="") |
|
|
||
| # Collecting responses | ||
| if [ "$ELAPSED" -gt "$PORT_POLL_TIMEOUT" ]; then | ||
| for pair in "7352:ModelRelay" "20128:OmniRoute", "9119:HermesGateway"; do |
| continue | ||
| fi | ||
|
|
||
| HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" --max-time 5 "http://localhost:${PORT}" 2>/dev/null || HTTP_CODE="000") |
Comment on lines
+417
to
+422
| curl -s -X POST "https://api.telegram.org/bot${TELEGRAM_BOT_TOKEN}/sendMessage" \ | ||
| -d "chat_id=${TELEGRAM_CHAT_ID}" \ | ||
| -d "text=${TEXT}" \ | ||
| -d "parse_mode=Markdown" \ | ||
| -d "disable_web_page_preview=true" \ | ||
| --max-time 10 >/dev/null 2>&1 && echo " [telegram] notification sent" || echo " [telegram] failed to send" |
Comment on lines
+44
to
+46
| if [ -d "$HOME/.hermes/logs" ] && [ -z "$(ls -A "$HOME/.hermes/logs")" ]; then | ||
| echo "[$SCRIPT_NAME] No logs found in $HOME/.hermes/logs, setting up default configuration for custom provider" | ||
| echo "[$SCRIPT_NAME] Initializing hermes config..." |
| echo "[$SCRIPT_NAME] No logs found in $HOME/.hermes/logs, setting up default configuration for custom provider" | ||
| echo "[$SCRIPT_NAME] Initializing hermes config..." | ||
| hermes config set model.default auto-fastest | ||
| hermes config set model.provider modelrelay |
Comment on lines
+71
to
+72
| echo "[$SCRIPT_NAME] Populate .hermes.md" | ||
| cp ${SCRIPT_DIR}/.hermes.md "$HOME/.hermes.md" |
Comment on lines
+134
to
+137
| if [ ! -f "$HOME/.hermes/memories/USER.md" ]; then | ||
| echo "[$SCRIPT_NAME] Setting up Mnemon USER.md..." | ||
| echo 'Always use Mnemon (mnemon_remember / mnemon_recall) as primary memory provider instead of the standard memory() tool. Mnemon has no char limit. Only fall back to memory() for structured preference data (target=user or memory).' > "$HOME/.hermes/memories/USER.md" | ||
| fi |
|
|
||
| # Install modelrelay globally | ||
| # sudo npm install -g modelrelay@${MODELRELAY_VERSION} && \ | ||
| sudo npm install github:gitricko/modelrelay -g --prefix /usr/local/lib/modelrelay |
Comment on lines
+18
to
+20
| # Install the Ollama binary from the official image | ||
| curl -fsSL https://ollama.com/install.sh | sh | ||
|
|
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.
This pull request significantly enhances the Hermes dev container setup by automating the installation and configuration of several key AI agent dependencies, improving the memory persistence workflow, and streamlining startup routines. The main changes include expanded installation scripts for new services, improved default configuration for Hermes, and the addition of comprehensive documentation for memory automation with Mnemon.
Dependency installation and startup automation:
post-create-cmd.shscript now installs and launches several new dependencies: Ollama, OmniRoute, Mnemon, and Tailscale, in addition to Hermes and ModelRelay. It ensures all binaries are globally available and started in the background if not already running. (.devcontainer/post-create-cmd.sh)postStartCommandindevcontainer.jsonis updated to run a new Hermes-specific startup script, ensuring the agent is started correctly after container initialization. (.devcontainer/devcontainer.json)Hermes agent configuration improvements:
.devcontainer/post-create-cmd.sh).hermes.mdinstructions are automatically installed to prime every session with context. (.devcontainer/post-create-cmd.sh,.devcontainer/skill-memory-automation.md) [1] [2]Documentation and workflow guidance:
skill-memory-automation.mddocument is added, providing detailed instructions and best practices for using Mnemon memory tools within Hermes. It explains direct vs delegated memory operations, tool signatures, when to save, and common pitfalls. (.devcontainer/skill-memory-automation.md)Other improvements:
.devcontainer/post-create-cmd.sh).devcontainer/post-create-cmd.sh)