Skip to content

Refactor post-create scripts for improved setup and diagnostics - #11

Merged
gitricko merged 13 commits into
mainfrom
new-version
Jul 17, 2026
Merged

gitricko merged 13 commits into
mainfrom
new-version

Conversation

@gitricko

Copy link
Copy Markdown
Owner

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:

  • The post-create-cmd.sh script 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)
  • The postStartCommand in devcontainer.json is 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:

  • The Hermes agent is now configured on first run with sensible defaults for providers (OmniRoute, ModelRelay, Mnemon), fallback logic, memory settings, and kanban optimization. It also disables approval alerts and enables memory features by default. (.devcontainer/post-create-cmd.sh)
  • A default memory-automation skill and associated .hermes.md instructions 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:

  • A new skill-memory-automation.md document 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:

  • The installation and configuration of Cline (Claude Dev extension) is streamlined, and the script now uses updated config file names. (.devcontainer/post-create-cmd.sh)
  • The script output is now more consistent and informative, using the script name in log messages for easier troubleshooting. (.devcontainer/post-create-cmd.sh)

Copilot AI review requested due to automatic review settings July 17, 2026 17:26
@gitricko
gitricko merged commit b065c73 into main Jul 17, 2026
1 check passed
@gitricko
gitricko deleted the new-version branch July 17, 2026 17:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.sh entrypoint for post-start service startup + Hermes defaults + self-check execution.
  • Add self-check.sh health diagnostics (stdout + JSON + optional Telegram notification).
  • Expand post-create-cmd.sh to install additional dependencies (Ollama, OmniRoute, Mnemon, Tailscale) and seed Hermes/Cline defaults; update devcontainer.json to 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

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.

2 participants