Skip to content

feat(tg): send_trading_report script with HTML->plain fallback - #200

Merged
JoTalbot merged 1 commit into
mainfrom
agent/20260819-report-sender
Aug 19, 2026
Merged

feat(tg): send_trading_report script with HTML->plain fallback#200
JoTalbot merged 1 commit into
mainfrom
agent/20260819-report-sender

Conversation

@JoTalbot

Copy link
Copy Markdown
Owner

Скрипт отправки детального трейдинг-отчёта в TG с фолбэком HTML->plain (LLM-текст иногда ломает HTML-парсер).

@JoTalbot
JoTalbot merged commit 0ede832 into main Aug 19, 2026
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@JoTalbot
JoTalbot deleted the agent/20260819-report-sender branch August 19, 2026 11:04
@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Aug 19, 2026
import urllib.request
from pathlib import Path

ROOT = Path("/root/AIOS")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥 The Roast: ROOT = Path("/root/AIOS") — This script is so committed to its /root/AIOS address that it won't even consider running anywhere else. It's the "I only date people from my hometown" of Python scripts.

🩹 The Fix:

Suggested change
ROOT = Path("/root/AIOS")
ROOT = Path(__file__).resolve().parent.parent

📏 Severity: warning


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

if not token or not chat:
return False, "no credentials"
base = {
"chat_id": int(chat),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥 The Roast: "chat_id": int(chat) — Converting to int() with the optimism of a golden retriever. If chat contains a single non-numeric character, this script crashes harder than a cron job at 3 AM.

🩹 The Fix:

Suggested change
"chat_id": int(chat),
"chat_id": int(chat) if str(chat).lstrip("-").isdigit() else chat,

📏 Severity: warning


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

def main() -> int:
from tg_bot.trading_report import full_report

messages = full_report()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥 The Roast: messages = full_report() — Calling an external function with all the safety precautions of a base jumper without a parachute. If full_report() raises, the script exits with a stack trace instead of a graceful error.

🩹 The Fix:

Suggested change
messages = full_report()
try:
messages = full_report()
except Exception as exc:
print(f"failed to generate report: {exc}")
return 1

📏 Severity: suggestion


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

@kilo-code-bot

kilo-code-bot Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Code Review Roast 🔥

Verdict: 3 Issues Found | Recommendation: Address before merge

Overview

Severity Count
⚠️ warning 2
💡 suggestion 1
Issue Details (click to expand)
File Line Roast
scripts/send_trading_report.py 10 Hardcoded /root/AIOS path — script is stuck in one location
scripts/send_trading_report.py 61 int(chat) without validation — crashes on non-numeric input
scripts/send_trading_report.py 76 No error handling for full_report() — stack trace instead of graceful exit

🏆 Best part: The HTML→plain fallback is genuinely well-executed — quick, simple, and exactly addresses the stated problem without overengineering.

💀 Worst part: The hardcoded /root/AIOS path. This isn't a bug waiting to happen; it's a bug that has already happened on every machine that isn't the production host.

📊 Overall: Like a GPS that only knows one route — it'll get you there, but only if you never leave the neighborhood.

Files Reviewed (2 files)
  • scripts/send_trading_report.py - 3 issues
  • docs/PROJECT_INVENTORY.md - 0 issues

Fix these issues in Kilo Cloud


Reviewed by free · Input: 46.2K · Output: 7.4K · Cached: 177.4K

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant