Repository navigation
Description
What
_transcript_is_pluginless_sdk() in scripts/session-start-hook.sh (added by #745 to keep a
pluginless Agent SDK transcript from being treated as "the previous session") leaves three edges
open, all ranked non-blocking by two independently-spawned self-reviewers (Explore + oss:auditor)
during the #745 follow-up lane, and all confirmed still present at HEAD as of this curation pass
(2026-09-26).
Location
scripts/session-start-hook.sh:910-926 (_transcript_is_pluginless_sdk):
_transcript_is_pluginless_sdk() {
local f=$1 n=0 line ep
while IFS= read -r line; do
n=$((n + 1))
case "$line" in
*'"message"'*) ;; # real dialogue, never a bookkeeping record
*'"entrypoint"'*)
ep=$(_stdin_json_string entrypoint "$line" 2>/dev/null) || return 1
case "$ep" in
sdk-*) return 0 ;;
*) return 1 ;;
esac
;;
esac
[ "$n" -ge "$_ENTRYPOINT_SNIFF_CAP" ] && return 1
done < "$f" 2>/dev/null
Mechanism -- three separate edges
-
No evidence check. The exclusion fires on the
entrypointfield'ssdk-prefix alone,
with no way to distinguish a pluginless SDK session (the reported bug:setting_sources=[],
no plugin loaded, no marker ever possible) from a hypothetical SDK integration that DOES pass
setting_sourcesand loads this plugin, which would write its owncapture-alive.d/<id>
marker like any other host. A marker-/save-record-aware refinement is possible (check
capture_was_seen/session_was_savedon the candidate's own filename id before excluding it),
butCAPTURE_SEEN_DIRis assigned later in_remember_deferred_phasethan
previous_transcript()is called, so wiring it in needs a deliberate ordering audit. No
real-world instance has been observed (capture-gap notice fires for sessions whose transcript opens with queue-operation, while doctor reports the same session as saved #745's own dataset -- 16 transcripts -- had none of the
25 SDK-entrypoint transcripts carrying a plugin marker). -
Substring scan, not a JSON parse (mitigated, not eliminated). The sniff is a raw substring
match (case "$line" in *'"entrypoint"'*)) over up to 50 lines. Skipping any line carrying a
"message"key closes the concrete scenario self-review raised (a transcript discussing this
issue's own test fixtures, which literally contain the string"entrypoint":"sdk-py", matching
on ordinary dialogue) -- but a false match confined to a bookkeeping-shaped, non-dialogue line
that embeds the substring in some nested value is not eliminated. -
The message-field skip can mask the exact bug it exists to prevent. Not checked in either
direction: whether an Agent SDK bookkeeping record can ever carry a top-level"message"key
that is not the dialogue-content field (an error/status string on aqueue-operationrecord,
say). If it can, and that record is the only line inside the 50-line cap carryingentrypoint,
the guard silently never fires and the exact false notice / force-save capture-gap notice fires for sessions whose transcript opens with queue-operation, while doctor reports the same session as saved #745 exists to fix
reappears for that transcript. Unverified against upstream's own Agent SDK bookkeeping schema.
Why not fixed in #745 itself
Logged as trap.d/745.entrypoint-sniff-has-two-unfixed-edges.md (despite the name, three edges),
ranked deciding-worthy by a curation pass rather than mid-lane with only one issue's own context.
What would settle it
For (1): thread a marker-/save-record-aware check into previous_transcript(), after resolving
the CAPTURE_SEEN_DIR assignment-ordering question. For (2)/(3): a real per-line JSON parse (or a
narrower field-position check) instead of the raw substring match, with a test exercising a
bookkeeping record that itself carries a top-level "message" key.
[AI-generated]
Activity
curate: 8 trap.d fragments -- 1 promote, 1 merge, 6 decline (#807)
fix(#803): stop the message-field skip masking a bookkeeping entrypoi…
refactor(#898): session start reads stdin fields through the printf -…