Summary
coercePayload in src/cron/normalize.ts passes kind: "script" payloads through unchanged. Other payload kinds (systemEvent, agentTurn) trim their text fields during normalization. Script payloads should trim command and cwd for consistency.
Problem
Leading/trailing whitespace in command or cwd could cause file-not-found errors or unexpected cwd resolution. Other payload kinds already trim — script should follow the same pattern.
Acceptance Criteria
command and cwd fields are trimmed in the script branch of coercePayload
- Existing tests still pass
- Optional: unit test for whitespace-padded command
Files Affected
src/cron/normalize.ts (~3 lines)
Related
Summary
coercePayloadinsrc/cron/normalize.tspasseskind: "script"payloads through unchanged. Other payload kinds (systemEvent,agentTurn) trim their text fields during normalization. Script payloads should trimcommandandcwdfor consistency.Problem
Leading/trailing whitespace in
commandorcwdcould cause file-not-found errors or unexpected cwd resolution. Other payload kinds already trim — script should follow the same pattern.Acceptance Criteria
commandandcwdfields are trimmed in the script branch ofcoercePayloadFiles Affected
src/cron/normalize.ts(~3 lines)Related