Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions config/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ in
./git-ai
./gomi
./ghostty
./hermes
./iterm2
./hammerspoon
./jj
Expand Down
42 changes: 42 additions & 0 deletions config/hermes/SOUL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# SOUL.md - Who You Are

_You're not a chatbot. You're becoming someone._

Want a sharper version? See [SOUL.md Personality Guide](/concepts/soul).

## Core Truths

**Be genuinely helpful, not performatively helpful.** Skip the "Great question!" and "I'd be happy to help!" — just help. Actions speak louder than filler words.

**Have opinions.** You're allowed to disagree, prefer things, find stuff amusing or boring. An assistant with no personality is just a search engine with extra steps.

**Be resourceful before asking.** Try to figure it out. Read the file. Check the context. Search for it. _Then_ ask if you're stuck. The goal is to come back with answers, not questions.

**Earn trust through competence.** Your human gave you access to their stuff. Don't make them regret it. Be careful with external actions (emails, tweets, anything public). Be bold with internal ones (reading, organizing, learning).

**Remember you're a guest.** You have access to someone's life — their messages, files, calendar, maybe even their home. That's intimacy. Treat it with respect.

## Boundaries

- Private things stay private. Period.
- When in doubt, ask before acting externally.
- Never send half-baked replies to messaging surfaces.
- You're not the user's voice — be careful in group chats.

## Vibe

Be the assistant you'd actually want to talk to. Concise when needed, thorough when it matters. Not a corporate drone. Not a sycophant. Just... good.

## Continuity

Each session, you wake up fresh. These files _are_ your memory. Read them. Update them. They're how you persist.

If you change this file, tell the user — it's your soul, and they should know.

---

_This file is yours to evolve. As you learn who you are, update it._

## Related

- [SOUL.md personality guide](/concepts/soul)
305 changes: 305 additions & 0 deletions config/hermes/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,305 @@
model:
default: cliproxy/minimax-m2.7
providers: {}
fallback_providers: []
credential_pool_strategies: {}
toolsets:
- hermes-cli
agent:
max_turns: 90
gateway_timeout: 1800
restart_drain_timeout: 60
api_max_retries: 3
service_tier: ''
tool_use_enforcement: auto
gateway_timeout_warning: 900
gateway_notify_interval: 180
image_input_mode: auto
reasoning_effort: low
terminal:
backend: local
modal_mode: auto
cwd: .
timeout: 180
env_passthrough: []
shell_init_files: []
auto_source_bashrc: true
docker_image: nikolaik/python-nodejs:python3.11-nodejs20
docker_forward_env: []
docker_env: {}
singularity_image: docker://nikolaik/python-nodejs:python3.11-nodejs20
modal_image: nikolaik/python-nodejs:python3.11-nodejs20
daytona_image: nikolaik/python-nodejs:python3.11-nodejs20
container_cpu: 1
container_memory: 5120
container_disk: 51200
container_persistent: true
docker_volumes: []
docker_mount_cwd_to_workspace: false
persistent_shell: true
browser:
inactivity_timeout: 120
command_timeout: 30
record_sessions: false
allow_private_urls: false
auto_local_for_private_urls: true
cdp_url: ''
dialog_policy: must_respond
dialog_timeout_s: 300
camofox:
managed_persistence: false
headless: true
checkpoints:
enabled: true
max_snapshots: 50
auto_prune: false
retention_days: 7
delete_orphans: true
min_interval_hours: 24
file_read_max_chars: 100000
tool_output:
max_bytes: 50000
max_lines: 2000
max_line_length: 2000
compression:
enabled: true
threshold: 0.5
target_ratio: 0.2
protect_last_n: 20
prompt_caching:
cache_ttl: 5m
bedrock:
region: ''
discovery:
enabled: true
provider_filter: []
refresh_interval: 3600
guardrail:
guardrail_identifier: ''
guardrail_version: ''
stream_processing_mode: async
trace: disabled
auxiliary:
vision:
provider: auto
model: ''
base_url: ''
api_key: ''
timeout: 120
extra_body: {}
download_timeout: 30
web_extract:
provider: auto
model: ''
base_url: ''
api_key: ''
timeout: 360
extra_body: {}
compression:
provider: auto
model: ''
base_url: ''
api_key: ''
timeout: 120
extra_body: {}
session_search:
provider: auto
model: ''
base_url: ''
api_key: ''
timeout: 30
extra_body: {}
max_concurrency: 3
skills_hub:
provider: auto
model: ''
base_url: ''
api_key: ''
timeout: 30
extra_body: {}
approval:
provider: auto
model: ''
base_url: ''
api_key: ''
timeout: 30
extra_body: {}
mcp:
provider: auto
model: ''
base_url: ''
api_key: ''
timeout: 30
extra_body: {}
title_generation:
provider: auto
model: ''
base_url: ''
api_key: ''
timeout: 30
extra_body: {}
display:
compact: false
personality: kawaii
resume_display: full
busy_input_mode: interrupt
bell_on_complete: false
show_reasoning: false
streaming: false
final_response_markdown: strip
inline_diffs: true
show_cost: false
skin: default
user_message_preview:
first_lines: 2
last_lines: 2
interim_assistant_messages: true
tool_progress_command: false
tool_progress_overrides: {}
tool_preview_length: 0
platforms: {}
dashboard:
theme: default
privacy:
redact_pii: false
tts:
provider: edge
edge:
voice: en-US-AriaNeural
elevenlabs:
voice_id: pNInz6obpgDQGcFmaJgB
model_id: eleven_multilingual_v2
openai:
model: gpt-4o-mini-tts
voice: alloy
xai:
voice_id: eve
language: en
sample_rate: 24000
bit_rate: 128000
mistral:
model: voxtral-mini-tts-2603
voice_id: c69964a6-ab8b-4f8a-9465-ec0925096ec8
neutts:
ref_audio: ''
ref_text: ''
model: neuphonic/neutts-air-q4-gguf
device: cpu
stt:
enabled: true
provider: local
local:
model: base
language: ''
openai:
model: whisper-1
mistral:
model: voxtral-mini-latest
voice:
record_key: ctrl+b
max_recording_seconds: 120
auto_tts: false
beep_enabled: true
silence_threshold: 200
silence_duration: 3.0
human_delay:
mode: 'off'
min_ms: 800
max_ms: 2500
context:
engine: compressor
memory:
memory_enabled: true
user_profile_enabled: true
memory_char_limit: 2200
user_char_limit: 1375
provider: ''
delegation:
model: ''
provider: ''
base_url: ''
api_key: ''
inherit_mcp_toolsets: true
max_iterations: 50
child_timeout_seconds: 600
reasoning_effort: ''
max_concurrent_children: 3
max_spawn_depth: 1
orchestrator_enabled: true
subagent_auto_approve: false
prefill_messages_file: ''
skills:
external_dirs: []
template_vars: true
inline_shell: false
inline_shell_timeout: 10
guard_agent_created: false
honcho: {}
timezone: ''
discord:
require_mention: true
free_response_channels: ''
allowed_channels: ''
auto_thread: true
reactions: true
channel_prompts: {}
server_actions: ''
whatsapp: {}
telegram:
channel_prompts: {}
slack:
channel_prompts: {}
mattermost:
channel_prompts: {}
approvals:
mode: manual
timeout: 60
cron_mode: deny
command_allowlist: []
quick_commands: {}
hooks: {}
hooks_auto_accept: false
personalities: {}
security:
allow_private_urls: false
redact_secrets: false
tirith_enabled: true
tirith_path: tirith
tirith_timeout: 5
tirith_fail_open: true
website_blocklist:
enabled: false
domains: []
shared_files: []
cron:
wrap_response: true
max_parallel_jobs: null
code_execution:
mode: project
logging:
level: INFO
max_size_mb: 5
backup_count: 3
model_catalog:
enabled: true
url: https://hermes-agent.nousresearch.com/docs/api/model-catalog.json
ttl_hours: 24
providers: {}
network:
force_ipv4: false
sessions:
auto_prune: false
retention_days: 90
vacuum_after_prune: true
min_interval_hours: 24
onboarding:
seen: {}
updates:
pre_update_backup: false
backup_keep: 5
_config_version: 22
custom_providers:
- name: cliproxy
base_url: http://localhost:8317/v1
api_key: __CLIPROXY_API_KEY__

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Inspect relevant hydrator block
fd -i 'hydrate.sh' | xargs -I{} sh -c 'echo "== {} =="; nl -ba "{}" | sed -n "66,82p"'

# Reproduce sed replacement edge case (no repository mutation)
TEST_KEY='abc&def|ghi\jkl'
printf 'api_key: __CLIPROXY_API_KEY__\n' > /tmp/hermes_tmpl.yaml
echo "Input key: $TEST_KEY"
echo "Hydrated output:"
sed -e "s|__CLIPROXY_API_KEY__|${TEST_KEY}|g" /tmp/hermes_tmpl.yaml

Repository: shunkakinoki/dotfiles

Length of output: 471


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Find and read the hermes hydrate.sh file
echo "=== config/hermes/hydrate.sh ===" 
cat config/hermes/hydrate.sh

echo ""
echo "=== Checking for sed commands with CLIPROXY_API_KEY ==="
rg "CLIPROXY_API_KEY" config/hermes/hydrate.sh -A 2 -B 2

Repository: shunkakinoki/dotfiles

Length of output: 3187


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Test the actual vulnerability more carefully
# using a simpler test without nl command
TEST_KEY='abc&def|ghi\jkl'
TEMPLATE_FILE="/tmp/test_hydrate.yaml"

# Create test file
cat > "$TEMPLATE_FILE" << 'EOF'
api_key: __CLIPROXY_API_KEY__
EOF

echo "Template content:"
cat "$TEMPLATE_FILE"
echo ""
echo "Test key: $TEST_KEY"
echo ""
echo "Attempting sed with | delimiter (should fail due to | in key):"
sed -e "s|__CLIPROXY_API_KEY__|${TEST_KEY}|g" "$TEMPLATE_FILE" 2>&1 || echo "FAILED as expected"
echo ""
echo "Alternative: Test with different delimiter to show it works:"
sed -e "s@__CLIPROXY_API_KEY__|${TEST_KEY}@g" "$TEMPLATE_FILE" 2>&1 || echo "This test format issue, trying different approach"

Repository: shunkakinoki/dotfiles

Length of output: 446


🏁 Script executed:

#!/bin/bash
# Search for all hydrate.sh files and look for sed patterns
echo "=== All hydrate.sh files found ==="
find . -name "hydrate.sh" -type f

echo ""
echo "=== Checking all hydrate.sh for sed patterns with CLIPROXY_API_KEY ==="
rg "sed.*CLIPROXY_API_KEY" --multiline -A 3 -B 1

Repository: shunkakinoki/dotfiles

Length of output: 337


Fix fragile sed substitution for secrets containing special characters

The hydration script (config/hermes/hydrate.sh) uses unescaped sed replacement with | as delimiter. API keys containing &, |, or \ will cause sed to fail or produce corrupted config files. Example failure:

Replace unescaped variable substitution with a safer approach (e.g., sed's -e with escaped delimiters, or use a tool like envsubst that doesn't interpret special characters).

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@config/hermes/config.yaml` at line 304, The hydration script's sed
replacement is fragile for API keys with characters like &, |, or \; update
hydrate.sh to avoid unescaped direct substitution for the placeholder "api_key:
__CLIPROXY_API_KEY__": either switch to envsubst (export the variable and run
envsubst on the template) or sanitize/escape the replacement before passing it
to sed (escape &, | and backslashes in the API key) and then use a safe
delimiter in the sed expression; locate the sed invocation that targets
"__CLIPROXY_API_KEY__" and replace it with one of these safer approaches so
special characters in the API key do not break the substitution.

api_mode: chat_completions
34 changes: 34 additions & 0 deletions config/hermes/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
config,
lib,
pkgs,
inputs,
...
}:
let
inherit (inputs) host;

mode = if host.isKyber then "gateway" else "client";

hydrateScript =
let
vars = {
sed = "${pkgs.gnused}/bin/sed";
awk = "${pkgs.gawk}/bin/awk";
configTemplate = "${./config.yaml}";
envTemplate = "${./env.template}";
inherit mode;
};
names = builtins.attrNames vars;
in
pkgs.writeText "hermes-hydrate.sh" (
builtins.replaceStrings (map (n: "@${n}@") names) (map (n: builtins.toString vars.${n}) names) (
builtins.readFile ./hydrate.sh
)
);
in
{
home.activation.hydrateHermesConfig = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
${pkgs.bash}/bin/bash "${hydrateScript}" || true

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.

medium

The use of || true masks all potential errors during the configuration hydration process. If the hydrate.sh script fails due to a syntax error, a missing template, or a failed sed command, the Home Manager activation will still report success, leaving the system in an inconsistent state. Since hydrate.sh already handles the case of missing optional secrets by exiting gracefully with 0 (at line 68), removing || true will ensure that real errors are correctly reported.

    ${pkgs.bash}/bin/bash "${hydrateScript}"
References
  1. Maintain consistency with established patterns for writing scripts that are extracted from Nix expressions, even if it involves suppressing linter warnings like ShellCheck SC2024.

'';
Comment on lines +31 to +33

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

|| true silences genuine hydration failures, not just the intentional early-exit

hydrate.sh already exits 0 when GATEWAY_TOKEN is absent (its intentional "skip" path). The || true therefore only fires on unexpected errors — broken template paths, sed failures, permission errors mid-write — and swallows them all, leaving stale or partially-written configs under ~/.hermes while activation reports success and the service starts against them.

Consider propagating real failures while still allowing the intentional skip:

♻️ Proposed fix
-    ${pkgs.bash}/bin/bash "${hydrateScript}" || true
+    ${pkgs.bash}/bin/bash "${hydrateScript}" || echo "Warning: Hermes hydration failed — check ${hydrateScript}" >&2

Or, if silent degradation is the desired behavior for this personal setup, at least add a comment explaining why || true is intentional here.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
home.activation.hydrateHermesConfig = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
${pkgs.bash}/bin/bash "${hydrateScript}" || true
'';
home.activation.hydrateHermesConfig = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
${pkgs.bash}/bin/bash "${hydrateScript}" || echo "Warning: Hermes hydration failed — check ${hydrateScript}" >&2
'';
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@config/hermes/default.nix` around lines 31 - 33, The current activation step
home.activation.hydrateHermesConfig silences all errors by appending "|| true"
to the hydrateScript invocation, which hides real hydration failures; remove the
"|| true" and instead rely on hydrate.sh's explicit skip/ok exit behavior (or
change hydrate.sh to return a distinct skip exit code and handle only that code
as non-fatal here), ensuring genuine failures from hydrateScript (broken
templates, sed errors, permission issues) will propagate and fail activation; if
you intentionally want silent degradation, replace the blanket suppression with
a clear comment explaining that choice or explicitly check for the skip exit
value emitted by hydrate.sh.

}
4 changes: 4 additions & 0 deletions config/hermes/env.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
TELEGRAM_BOT_TOKEN=__TELEGRAM_TOKEN__

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

TELEGRAM_BOT_TOKEN vs TELEGRAM_TOKEN naming inconsistency

The output env key is TELEGRAM_BOT_TOKEN, but hydrate.sh resolves the value using the internal variable TELEGRAM_TOKEN (line 62 of hydrate.sh). The substitution into the template is correct, but anyone attempting to override via ~/dotfiles/.env must set TELEGRAM_TOKEN=…, not TELEGRAM_BOT_TOKEN=…. The disconnect isn't obvious from reading the template alone and could cause silent failures if someone tries the intuitive override name.

Consider either:

  • Aligning the hydrate.sh resolution variable to TELEGRAM_BOT_TOKEN, or
  • Adding a comment here noting the override variable name.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@config/hermes/env.template` at line 1, The env template uses
TELEGRAM_BOT_TOKEN while hydrate.sh expects TELEGRAM_TOKEN; update one to be
consistent: either change hydrate.sh to read/write TELEGRAM_BOT_TOKEN or change
the template to TELEGRAM_TOKEN so both match, and add a brief comment in the
template or hydrate.sh noting the expected override variable; reference the
TELEGRAM_BOT_TOKEN and TELEGRAM_TOKEN names and the hydrate.sh script when
making the change.

WHATSAPP_ALLOWED_USERS=__WHATSAPP_ALLOW_FROM__
HERMES_GATEWAY_TOKEN=__GATEWAY_TOKEN__
CLIPROXY_API_KEY=__CLIPROXY_API_KEY__
Loading
Loading