Skip to content

fix: replace bash array syntax with POSIX sh compatible code in stage… - #56870

Closed
fisker086 wants to merge 3 commits into
NousResearch:mainfrom
fisker086:main
Closed

fix: replace bash array syntax with POSIX sh compatible code in stage…#56870
fisker086 wants to merge 3 commits into
NousResearch:mainfrom
fisker086:main

Conversation

@fisker086

Copy link
Copy Markdown

…2-hook.sh The script uses #!/bin/sh but used bash-specific array syntax (()) for _merge_args, causing 'Syntax error: (" unexpected' on systems where /bin/sh is not bash (e.g. dash). Replace with POSIX-compatible set -- "$@" pattern.

Removed redundant directory creation and ownership checks for HERMES_HOME in rootless environments. Updated comments to clarify behavior in rootless scenarios.

What does this PR do?

Related Issue

Fixes #

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 🔒 Security fix
  • 📝 Documentation update
  • ✅ Tests (adding or improving test coverage)
  • ♻️ Refactor (no behavior change)
  • 🎯 New skill (bundled or hub)

Changes Made

How to Test

Checklist

Code

  • I've read the Contributing Guide
  • My commit messages follow Conventional Commits (fix(scope):, feat(scope):, etc.)
  • I searched for existing PRs to make sure this isn't a duplicate
  • My PR contains only changes related to this fix/feature (no unrelated commits)
  • I've run pytest tests/ -q and all tests pass
  • I've added tests for my changes (required for bug fixes, strongly encouraged for features)
  • I've tested on my platform:

Documentation & Housekeeping

  • I've updated relevant documentation (README, docs/, docstrings) — or N/A
  • I've updated cli-config.yaml.example if I added/changed config keys — or N/A
  • I've updated CONTRIBUTING.md or AGENTS.md if I changed architecture or workflows — or N/A
  • I've considered cross-platform impact (Windows, macOS) per the compatibility guide — or N/A
  • I've updated tool descriptions/schemas if I changed tool behavior — or N/A

For New Skills

  • This skill is broadly useful to most users (if bundled) — see Contributing Guide
  • SKILL.md follows the standard format (frontmatter, trigger conditions, steps, pitfalls)
  • No external dependencies that aren't already available (prefer stdlib, curl, existing Hermes tools)
  • I've tested the skill end-to-end: hermes --toolsets skills -q "Use the X skill to do Y"

Screenshots / Logs

…2-hook.sh The script uses #!/bin/sh but used bash-specific array syntax (()) for _merge_args, causing 'Syntax error: (\" unexpected' on systems where /bin/sh is not bash (e.g. dash). Replace with POSIX-compatible set -- \"\$@\" pattern.

Removed redundant directory creation and ownership checks for HERMES_HOME in rootless environments. Updated comments to clarify behavior in rootless scenarios.
@alt-glitch alt-glitch added invalid This doesn't seem right area/docker Docker image, Compose, packaging P3 Low — cosmetic, nice to have labels Jul 2, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

This was generated by AI during triage.

Scope mismatch — flagging for a maintainer. The title/description say this only "replaces bash array syntax with POSIX sh compatible code," but the diff to docker/stage2-hook.sh does far more:

The rootless-compat intent is reasonable, but as written it would regress ownership handling for the majority of (non-rootless) Docker users and adds private-distro code. Please resubmit isolated to just the POSIX-sh array-syntax fix, guarding the rootless changes behind detection rather than removing the checks outright.

fisker086 added 2 commits July 4, 2026 14:08
…set -- "$@"` instead of `_merge_args=(...)` when calling sync_nexus_hermes_config.py, since the hook runs under /bin/sh.

fix(docker): use POSIX sh arg passing in stage2-hook.sh

Replace bash-only `_merge_args` array syntax with `set -- "$@"` in
sync_nexus_hermes_config invocation. The script uses `#!/bin/sh` but
bash arrays cause `Syntax error: (" unexpected` on dash-based systems.

Restore upstream Docker bootstrap behavior (HERMES_HOME mkdir, targeted
chown, profiles/cron ownership reset) that was incorrectly removed in a
prior overly broad change.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/docker Docker image, Compose, packaging invalid This doesn't seem right P3 Low — cosmetic, nice to have

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants