Allow execute_code in Hermes smoke config

This commit is contained in:
Dotta committed 2026-06-26 15:38:17 +00:00
1 parent a32829f90d
commit 11b0b84e08
3 files changed
+31 -13

No files matched your search

+7 -3
View File
@@ -37,9 +37,13 @@ and the non-loopback HTTP guard.
pnpm smoke:hermes-gateway-e2e
```
This writes only `model` and `providers: {}` into the temporary Hermes home;
provider keys still come from environment variables and are redacted from
diagnostics.
This writes only `model`, `providers: {}`, and
`command_allowlist: [execute_code]` into the temporary Hermes home. Provider
keys still come from environment variables and are redacted from diagnostics.
- The E2E helper always seeds `command_allowlist: [execute_code]` in the fresh
Hermes config so non-interactive gateway/API runs do not wait for a manual
execute-code approval prompt. Do not copy a host `~/.hermes` directory into
the container to solve approval or provider setup.
- Board/operator auth is required through `PAPERCLIP_AUTH_HEADER`,
`PAPERCLIP_COOKIE`, or a board-capable `PAPERCLIP_API_KEY`.
- Diagnostic files are redacted before they are written, except the join output
+22 -10
View File
@@ -104,6 +104,9 @@ Mode notes:
network and reverse-proxy smoke runs.
Raw Hermes and Paperclip API keys are redacted from logs and diagnostic files.
The E2E helper seeds a minimal non-secret Hermes config in the fresh container
state, including command_allowlist: execute_code so gateway/API runs do not
pause on an interactive approval prompt.
The generated/claimed key material is kept only in the per-run state directory,
which is deleted on success unless HERMES_SMOKE_KEEP=1.
@@ -501,10 +504,11 @@ yaml_single_quote() {
}
write_hermes_model_config() {
if [[ -z "$HERMES_SMOKE_MODEL_PROVIDER" && -z "$HERMES_SMOKE_MODEL_DEFAULT" && -z "$HERMES_SMOKE_MODEL_BASE_URL" ]]; then
return
local has_model_config=0
if [[ -n "$HERMES_SMOKE_MODEL_PROVIDER" || -n "$HERMES_SMOKE_MODEL_DEFAULT" || -n "$HERMES_SMOKE_MODEL_BASE_URL" ]]; then
has_model_config=1
fi
if [[ -z "$HERMES_SMOKE_MODEL_PROVIDER" || -z "$HERMES_SMOKE_MODEL_DEFAULT" ]]; then
if [[ "$has_model_config" == "1" && ( -z "$HERMES_SMOKE_MODEL_PROVIDER" || -z "$HERMES_SMOKE_MODEL_DEFAULT" ) ]]; then
fail "HERMES_SMOKE_MODEL_PROVIDER and HERMES_SMOKE_MODEL_DEFAULT must be set together"
fi
@@ -514,16 +518,24 @@ write_hermes_model_config() {
fi
{
echo "model:"
printf " default: %s\n" "$(yaml_single_quote "$HERMES_SMOKE_MODEL_DEFAULT")"
printf " provider: %s\n" "$(yaml_single_quote "$HERMES_SMOKE_MODEL_PROVIDER")"
if [[ -n "$HERMES_SMOKE_MODEL_BASE_URL" ]]; then
printf " base_url: %s\n" "$(yaml_single_quote "$HERMES_SMOKE_MODEL_BASE_URL")"
if [[ "$has_model_config" == "1" ]]; then
echo "model:"
printf " default: %s\n" "$(yaml_single_quote "$HERMES_SMOKE_MODEL_DEFAULT")"
printf " provider: %s\n" "$(yaml_single_quote "$HERMES_SMOKE_MODEL_PROVIDER")"
if [[ -n "$HERMES_SMOKE_MODEL_BASE_URL" ]]; then
printf " base_url: %s\n" "$(yaml_single_quote "$HERMES_SMOKE_MODEL_BASE_URL")"
fi
echo "providers: {}"
fi
echo "providers: {}"
echo "command_allowlist:"
echo "- execute_code"
} > "$config_file"
chmod 644 "$config_file"
log "seeded Hermes model config provider=${HERMES_SMOKE_MODEL_PROVIDER} model=${HERMES_SMOKE_MODEL_DEFAULT}"
if [[ "$has_model_config" == "1" ]]; then
log "seeded Hermes model config provider=${HERMES_SMOKE_MODEL_PROVIDER} model=${HERMES_SMOKE_MODEL_DEFAULT}"
else
log "seeded Hermes smoke config"
fi
}
start_container() {
@@ -86,6 +86,8 @@ config="$HERMES_SMOKE_STATE_DIR/hermes-home/config.yaml"
grep -Fq "default: 'z-ai/glm-5.2'" "$config"
grep -Fq "provider: 'openrouter'" "$config"
grep -Fq "base_url: 'https://openrouter.ai/api/v1'" "$config"
grep -Fq "command_allowlist:" "$config"
grep -Fq -- "- execute_code" "$config"
! grep -Eiq "api[_-]?key|token|secret" "$config"
`,
);