Skip to content

Commit cc27a4a

Browse files
Davidson Gomesclaude
andcommitted
fix(telegram): eliminate duplicate notifications from inline reply() template
Root cause: notify_telegram instruction showed reply(chat_id=..., text="...") as an inline code snippet, causing the agent to execute it immediately on reading the instruction AND again at the end — 2x per instruction. Financial Pulse was getting 4x because the skill's Step 8 also contained a reply() call instruction (2 instructions × 2 executions = 4 messages). Fixes: - runner.py: rewrite notify_telegram prompt to describe the action in plain text without an inline function-call template - fin-daily-pulse SKILL.md: remove Step 8 Telegram section — notification is handled by the routine caller via notify_telegram=True Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent fb9ebd2 commit cc27a4a

2 files changed

Lines changed: 10 additions & 10 deletions

File tree

.claude/skills/fin-daily-pulse/SKILL.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -157,9 +157,9 @@ workspace/finance/reports/daily/[C] YYYY-MM-DD-financial-pulse.html
157157

158158
Create the directory `workspace/finance/reports/daily/` if it does not exist.
159159

160-
## Step 8 — Confirm and notify (ONE Telegram message only)
160+
## Step 8 — Confirm
161161

162-
Output the completion summary, then send **exactly one** Telegram message. Do NOT call `reply` more than once per run.
162+
Output the completion summary in the terminal:
163163

164164
```
165165
## Financial Pulse generated
@@ -171,6 +171,4 @@ Output the completion summary, then send **exactly one** Telegram message. Do NO
171171
**Alerts:** {N} attention points
172172
```
173173

174-
Call `reply` **once** with a short summary (do not send the full markdown above — send a compact version):
175-
176-
- Format: `[emoji] Financial Pulse [date] | MRR: R$ X,XXX | Receita: R$ X,XXX | Churn: X% | [N] alertas`
174+
Do NOT send a Telegram message here — the caller handles notifications.

ADWs/runner.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -317,11 +317,13 @@ def run_skill(
317317
)
318318
if chat_id:
319319
prompt += (
320-
f"\n\nAo concluir TODOS os passos acima, envie UMA única mensagem Telegram via:"
321-
f'\nreply(chat_id="{chat_id}", text="...")'
322-
f"\nFormato: emoji + nome da rotina + principais resultados em 2-3 linhas."
323-
f"\nCRÍTICO: chame reply() EXATAMENTE UMA VEZ, somente aqui no final."
324-
f" Não envie mensagens intermediárias nem de progresso."
320+
f"\n\n---\n"
321+
f"NOTIFICAÇÃO TELEGRAM — executar SOMENTE após concluir TODOS os passos acima.\n"
322+
f"Use a ferramenta Telegram reply com chat_id={chat_id} e um texto compacto:\n"
323+
f" emoji + nome da rotina + data + principais resultados em 2-3 linhas.\n"
324+
f"REGRA ABSOLUTA: chame a ferramenta reply UMA ÚNICA VEZ, no final de tudo.\n"
325+
f"Nunca chame reply para progresso, confirmação intermediária ou teste.\n"
326+
f"---"
325327
)
326328
return run_claude(prompt, log_name or skill_name, timeout, agent=agent)
327329

0 commit comments

Comments
 (0)