fix(svos nh3-svos): Matrix request_timeout_seconds 60 — stopgap for card audio dying at exactly 15 s (svos-dev)

This commit is contained in:
vh
2026-10-17 09:17:21 -07:00
parent 77b75aa172
commit e85ea97101
2 changed files with 45 additions and 2 deletions
@@ -0,0 +1,38 @@
# nh3-svos: [notifications.matrix] request_timeout_seconds 15 (default) -> 60. Stopgap for card audio (svos-dev's word
# 2026-10-17 0916, thread 01M5558E19Q3ZK4RRZXQG6A2Y9; allowed range 15..60): every summons synthesis died at exactly
# 15.0 s (12/12 since 10-10). Short cards speak with this; long ones still hit the voice app's 30 s audio cap until the
# spoken-summons code change (Prime's wording call) ships, then restore the default. Revert = instance.toml.pre-matrix-timeout.
steps:
- name: back up instance.toml
sudo: true
shell: runuser -u svc-svos -- cp -p /var/lib/svos/config/instance.toml /var/lib/svos/config/instance.toml.pre-matrix-timeout
creates: /var/lib/svos/config/instance.toml.pre-matrix-timeout
- name: add request_timeout_seconds = 60 under [notifications.matrix]
sudo: true
shell: |
runuser -u svc-svos -- python3 - <<'PY'
import os, re
p = "/var/lib/svos/config/instance.toml"; s = open(p).read()
block = s[s.index("[notifications.matrix]"):]
block = block[:block.index("\n[", 1)] if "\n[" in block[1:] else block
assert "request_timeout_seconds" not in block, "already set"
anchor = 'voice_id = "miranda-is"'
line = s[s.index(anchor):s.index("\n", s.index(anchor)) + 1]
assert s.count(line) == 1
s = s.replace(line, line + 'request_timeout_seconds = 60 # 2026-10-17 stopgap (svos-dev): summons synthesis needs > 15 s; range 15..60\n')
t = p + ".tmp"; fd = os.open(t, os.O_WRONLY | os.O_CREAT | os.O_TRUNC, 0o600)
with os.fdopen(fd, "w") as f: f.write(s)
os.replace(t, p); print("edited")
PY
- name: the kernel accepts it (else restore)
sudo: true
shell: |
if runuser -u svc-svos -- /opt/svos/current/kernel-env/bin/svos-kernel check-config --data-root /var/lib/svos; then exit 0; fi
runuser -u svc-svos -- cp -p /var/lib/svos/config/instance.toml.pre-matrix-timeout /var/lib/svos/config/instance.toml; echo RESTORED; exit 1
- name: reload
sudo: true
shell: systemctl reload svos-kernel; sleep 3; curl -s http://127.0.0.1:8400/health
verify:
- name: health ok, nothing down
shell: h=$(curl -s http://127.0.0.1:8400/health); echo "$h"; echo "$h" | grep -q '"status":"ok"' && echo "$h" | grep -q '"down":0'
changed_when: "false"