fix(skills): resolve headless layout overflow, reconcile SKILLS_DIR scope, and prompt-injection fast-path gating (B-19)
This commit is contained in:
+12
-8
@@ -446,7 +446,10 @@ try:
|
||||
if anchor:
|
||||
w = anchor.get('width', 0)
|
||||
h = anchor.get('height', 0)
|
||||
if w // 2 >= min_cols:
|
||||
if w <= 0 or h <= 0:
|
||||
# Headless or detached session with unmeasured/zero dimensions
|
||||
print('right')
|
||||
elif w // 2 >= min_cols:
|
||||
print('right')
|
||||
elif h // 2 >= min_rows:
|
||||
print('down')
|
||||
@@ -1632,13 +1635,6 @@ _pane_dialog_open() {
|
||||
send_keys_safe() {
|
||||
local sess="$1" text="$2" job_id="${3:-adhoc}"
|
||||
|
||||
local agent_target
|
||||
agent_target=$(_sanitize_herdr_agent_name "$sess")
|
||||
# Native herdr 0.8+ fast path: agent prompt handles atomic text + enter submission
|
||||
if _sks_herdr agent prompt "$agent_target" "$text" >/dev/null 2>&1 || _sks_herdr agent prompt "$sess" "$text" >/dev/null 2>&1; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
local marker pre_submit deadline try
|
||||
# Verification token: last 24 *characters* (not bytes — `tail -c` can split a
|
||||
# multi-byte UTF-8 char, e.g. Korean, producing a marker that can never match
|
||||
@@ -1668,6 +1664,14 @@ send_keys_safe() {
|
||||
sleep 2
|
||||
done
|
||||
|
||||
local agent_target
|
||||
agent_target=$(_sanitize_herdr_agent_name "$sess")
|
||||
# Native herdr 0.8+ fast path: agent prompt handles atomic text + enter submission
|
||||
# Gated behind quiescence and dialog checks; returns 0 on RPC success to prevent duplicate input
|
||||
if _sks_herdr agent prompt "$agent_target" "$text" >/dev/null 2>&1 || _sks_herdr agent prompt "$sess" "$text" >/dev/null 2>&1; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
local sks_buf="sks_${sess}_${job_id}_$$_${RANDOM}_$(date +%s%N 2>/dev/null || date +%s)"
|
||||
_sks_herdr set-buffer -b "$sks_buf" "$text"
|
||||
_sks_herdr paste-buffer -b "$sks_buf" -t "$sess"
|
||||
|
||||
Reference in New Issue
Block a user