Skip to content

fix(chat): bot_message_id is update-only; never invent one - #164

Merged
xergioalex merged 2 commits into
mainfrom
release__bot_message_id
Dec 3, 2026
Merged

xergioalex merged 2 commits into
mainfrom
release__bot_message_id

Conversation

@xergioalex

Copy link
Copy Markdown
Member

Why

A coding agent sent messages with its own bot_message_id values (e.g. gos-test-plain-1). bot_message_id only 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 with 400 unknown_bot_message_id (api-services feature__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 returns bot_message_id; keep it only for chat update (72h); never invent one.
  • dailybot chat update --help: BOT_MESSAGE_ID is the id a send returned, never one you choose.
  • chat send --payload-json with a bot_message_id is refused locally (exit 1) with a pointer to chat update.
  • The API's unknown_bot_message_id error gets a plain explanation.
  • README: a "New message vs. edit" paragraph and a clearer chat update row.

Tests

ruff check, ruff format --check, mypy dailybot_cli clean; pytest tests/chat_commands_test.py 53 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.

`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
@github-actions

This comment has been minimized.

github-actions[bot]

This comment was marked as outdated.

@github-actions github-actions Bot added the pr-reviewed Passed AI code review label Dec 3, 2026
@github-actions

This comment has been minimized.

github-actions[bot]

This comment was marked as outdated.

…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>
@xergioalex xergioalex added Ready Trigger AI code review and removed Ready Trigger AI code review labels Dec 3, 2026
@github-actions

github-actions Bot commented Dec 3, 2026 •

Copy link
Copy Markdown

AI review for a37479a — ✅ done

View review →

Highest severity: none

Verifier: 0 checked · 0 verified · 0 downgraded · 0 refuted · 0 unverified · 0 skipped — grok-4.5 (economy), 0s

Strictness gate: ✅ highest severity none ≤ critical threshold

0 inline comment(s) attached.

Usage: 163.8k in (74% cached) · 1.5k out · est. $0.13 · 4 turns · 29s

Iteration-Aware Review: gen 2, round 1, policy=first-pass-exhaustive (new_commits, mode=incremental) — 0 surfaced.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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_id inside chat send --payload-json before the wire call; the API returns 400 unknown_bot_message_id only on chat update with an unknown id.
  • _payload_names_a_message uses 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 to TestChatUpdateCommand where 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 effect none: highest severity none ≤ 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.

@xergioalex
xergioalex merged commit 78f2cd6 into main Dec 3, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-reviewed Passed AI code review Ready Trigger AI code review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants