Repository navigation
fix(chat): bot_message_id is update-only; never invent one - #164
Conversation
`chat send` help and the README now say every send posts a new message, Dailybot creates and returns its bot_message_id, and that id is kept only for `chat update` (72h). A `--payload-json` body carrying bot_message_id is refused locally with a pointer to `chat update`, and the API's new `400 unknown_bot_message_id` gets a plain explanation. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AY6kxNxkCZG2pPJSh1Bxer
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
…s API refusal - chat send --payload-json refuses the key itself, so an empty or null id is caught too (test added). - README says the CLI refuses it on send and the API answers unknown_bot_message_id on update. - The update refusal test moves into TestChatUpdateCommand. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
AI review for
|
There was a problem hiding this comment.
Code review — 0 finding(s): 0 critical · 0 warning · 0 info
Check: ✅ passing — strictness block-on-critical: highest severity none ≤ critical threshold
No findings posted inline.
Summary
Looks good — the follow-up commit closes all three prior info notes cleanly; nothing new to flag.
What changed since last review
- README now splits the two refusal paths: CLI rejects
bot_message_idinsidechat send --payload-jsonbefore the wire call; the API returns400 unknown_bot_message_idonly onchat updatewith an unknown id. _payload_names_a_messageuses key presence ("bot_message_id" in raw) and documents that any value (empty/null included) is refused.- Tests: empty/null payload-key coverage lives under
TestChatSendCommand; the API-error explanation test moved toTestChatUpdateCommandwhere the command under test belongs.
Core change (unchanged intent)
Local pre-flight on chat send --payload-json prevents the silent no-op that invented ids used to cause; unknown_bot_message_id gets a plain override in _execute_send; help/README steer agents toward chat update with a real returned id. Branding, print_error + SystemExit(1), typed helpers, and mocked HTTP all look correct.
Recommendation: approve
Since last review (55e1ceb → a37479a): resolved 3 · still open 0 · regressed 0 · new 0 · 3 auto-retired (fix corroborated; thread already collapsed).
Prior findings
- retired
dailybot_cli/commands/chat.py:592(verified_fixed) - retired
tests/chat_commands_test.py:269(verified_fixed) - retired
README.md:1164(verified_fixed)
Check status: ✅ passing — strictness
block-on-critical, highest severity in effectnone: highest severitynone≤ critical threshold.This line is written by the reviewer runtime after the gate ran and matches the check conclusion and the tracking comment. Any recommendation above is the model's advisory opinion, not the gate.
Why
A coding agent sent messages with its own
bot_message_idvalues (e.g.gos-test-plain-1).bot_message_idonly updates a message Dailybot already sent, so every send was a silent no-op edit:200, the id echoed back, nothing delivered. The API now refuses such ids with400 unknown_bot_message_id(api-servicesfeature__new_dailybot); this makes the CLI say the same thing up front.What
dailybot chat send --help: every send posts a new message; Dailybot creates and returnsbot_message_id; keep it only forchat update(72h); never invent one.dailybot chat update --help:BOT_MESSAGE_IDis the id a send returned, never one you choose.chat send --payload-jsonwith abot_message_idis refused locally (exit 1) with a pointer tochat update.unknown_bot_message_iderror gets a plain explanation.chat updaterow.Tests
ruff check,ruff format --check,mypy dailybot_cliclean;pytest tests/chat_commands_test.py53 passed (3 new).🤖 Generated with Claude Code
https://claude.ai/code/session_01AY6kxNxkCZG2pPJSh1Bxer
Carries the commits of #162 by @mauriciomdb, reopened from a maintainer account so the AI review gate runs.