You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
aggregator(record-claude-launch): empty flag values are recorded verbatim — '--id ""' appends a session with no id, '--parent ""' a parent that is not null, exit 0 #6895
pm-stack/aggregator/scripts/record-claude-launch.ts: the #3415 guard in valueAfter (:35-41) refuses a missing value and a value that is itself a flag, but it does not refuse an empty (or whitespace-only) value. Its settled siblings do: post-alert.ts:131 and collect-fleet-feed.ts:231 both check value === "", and append-usage-snapshots.ts (resolveObservedBy) checks value.trim() === "". This script is the one value-taking CLI in the set whose guard omits the empty case, so empty strings flow into the appended launch record verbatim, with exit 0.
Evidence (verified this run, laptop @ 4cd2927, real script, --file pointed at a probe file)
Probe: ~/git/fleet/probe-launch-empty/ (real record-claude-launch.ts run via bun run, control first):
Control --label "Control" → record with a generated claude-… id, parentId: null, status: "launched", rc 0.
--label "EmptyId" --id "" → rc 0, appended record is {"id":"", …} — an identity record with no identity.
--label "EmptyParentStatus" --parent "" --status "" → rc 0, appended record carries "parentId":"" (instead of the null the default produces) and "status":"".
--id " " → rc 0, "id":" ". --label " " → rc 0, a session whose display name is a single space (the !label check at :54 catches only the empty string).
--file "" → not a usage error at all: raw ENOENT stack from appendFile(""), rc 1, no message naming the flag.
Why it matters
The collector's reader accepts these records: parseLaunchRecords (pm-stack/aggregator/src/registry.ts:105) admits any record whose id is a string — "" qualifies — and the registry merge keys records by (source, id) (:133-135). Every session ever recorded with --id "" therefore collides on the same merge key and folds into a single phantom registry entry, silently losing those sessions' task↔session linkage (the file's stated purpose, script header :5-11); a parentId of "" likewise points at that phantom instead of meaning "no parent". Because the script exits 0 and prints the usual recorded … line, a launcher passing an unset shell variable (--id "$SESSION_ID") gets no signal that it just registered a nameless session.
Acceptance criteria
Every value-taking flag (--label, --id, --parent, --task, --model, --status, --file) refuses an empty or whitespace-only value with the existing usage-error path: message naming the flag, exit 2, and nothing appended (the launch-records file is byte-identical afterwards).
A pinning test in the style of pm-stack/aggregator/test/record-claude-launch-flag-value-3415.test.ts covers at least --id "", --parent "", --status "", and a whitespace-only --label, asserting exit 2 and an untouched records file.
agent-note:v1
state: filed
agent: new-issue-creator-code-b
Found via: filed this run — verified on the laptop @ 4cd2927 with the real script (probe ~/git/fleet/probe-launch-empty): --id "" appends {"id":"", …} rc 0, --parent ""/--status "" recorded verbatim, --file "" raw ENOENT stack. Residual door of closed #3415 (flag-as-value): the empty-value case its guard omitted, which both sibling guards (post-alert.ts:131, collect-fleet-feed.ts:231) do check.
Disposition: guarded self-solve this run (trivial, one guard function + pinning test) — work/self-assigned + status/in-progress instead of the queued labels; no queue packet per the self-solve path.
agent-note:v1
state: done
agent: new-issue-creator-code-b
Fixed and merged this run: PR #6896 (branch creator-b/6895-record-launch-empty-values, commit 8cdf874) — valueAfter now refuses empty/whitespace-only values via the usage-error path (exit 2, nothing appended) for every value-taking flag, matching the sibling guards; pinning test record-claude-launch-empty-value-6895.test.ts added beside the #3415 test.
Verification: laptop bun test on the branch and again on merged origin/main — 4 pass / 0 fail across the new + #3415 test files. Issue closed by the PR's Fixes marker.
Activity
developing-today commentedon Nov 7, 2026
CODE-2157
dezren39 commentedon Nov 7, 2026
agent-note:v1
state: filed
agent: new-issue-creator-code-b
Found via: filed this run — verified on the laptop @ 4cd2927 with the real script (probe ~/git/fleet/probe-launch-empty):
--id ""appends{"id":"", …}rc 0,--parent ""/--status ""recorded verbatim,--file ""raw ENOENT stack. Residual door of closed #3415 (flag-as-value): the empty-value case its guard omitted, which both sibling guards (post-alert.ts:131, collect-fleet-feed.ts:231) do check.Disposition: guarded self-solve this run (trivial, one guard function + pinning test) — work/self-assigned + status/in-progress instead of the queued labels; no queue packet per the self-solve path.
Merge pull request #6896 from developing-today/creator-b/6895-record-…
dezren39 commentedon Nov 7, 2026
agent-note:v1
state: done
agent: new-issue-creator-code-b
Fixed and merged this run: PR #6896 (branch creator-b/6895-record-launch-empty-values, commit 8cdf874) —
valueAfternow refuses empty/whitespace-only values via the usage-error path (exit 2, nothing appended) for every value-taking flag, matching the sibling guards; pinning testrecord-claude-launch-empty-value-6895.test.tsadded beside the #3415 test.Verification: laptop
bun teston the branch and again on merged origin/main — 4 pass / 0 fail across the new + #3415 test files. Issue closed by the PR's Fixes marker.