Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion bin/fm-discord-notify.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,20 @@ async function sendRecord(path, record, botId, recover) {
const sending = { ...record, state: "sending", attempted_at: Math.floor(Date.now() / 1000) };
saveRecord(path, sending);
const payload = {
content: `작업: ${record.task_id}\n왜 연락했나: ${localize(record.summary)}\n필요한 결정: ${decisionPrompt(record.trigger)}\n선택지: ${record.options.map(localize).join(" / ")}\n권장안: ${localize(record.recommendation || record.options[0])}\n답장으로 선택해 주세요.`,
content: [
`**결정 필요** - 작업: ${record.task_id}`,
"",
`왜 연락했나: ${localize(record.summary)}`,
"",
`**필요한 결정: ${decisionPrompt(record.trigger)}**`,
"",
"**선택지**",
...record.options.map(localize).map((option, index) => `${index + 1}. ${option}`),
"",
`**권장안: ${localize(record.recommendation || record.options[0])}**`,
"",
"↩️ 답장으로 선택해 주세요.",
].join("\n"),
allowed_mentions: { parse: [] },
nonce: record.nonce,
enforce_nonce: true,
Expand Down
3 changes: 2 additions & 1 deletion tests/fm-discord-decision-push.test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,8 @@ test_failed_notification_retries_from_durable_outbox() {
state=$(jq -r '.state' "$record")
assert_equals "sent" "$state" "retry completes the retained notification"
assert_equals "2" "$(wc -l < "$log" | tr -d ' ')" "one initial failed POST and one retry POST"
assert_contains "$(sed -n '2p' "$log" | jq -r '.payload.content')" "제안된 변경 사항 승인 / 현재 동작 유지" "legacy retry options are localized"
assert_contains "$(sed -n '2p' "$log" | jq -r '.payload.content')" "1. 제안된 변경 사항 승인" "legacy retry first option is localized and numbered"
assert_contains "$(sed -n '2p' "$log" | jq -r '.payload.content')" "2. 현재 동작 유지" "legacy retry second option is localized and numbered"
assert_contains "$(sed -n '2p' "$log" | jq -r '.payload.content')" "제안된 변경 사항에 대한 결정이 필요합니다." "legacy retry summary is localized"
pass "failed decision notifications retry after their source cursor advances"
}
Expand Down
Loading