Skip to content

Bots are told when a chat is allowed and what became of their offers; they say an offer arrived only when it was confirmed - #2502

Merged
TheAnimatrix merged 3 commits into
masterfrom
issue-2490-offer-guidance
Nov 30, 2026
Merged

TheAnimatrix merged 3 commits into
masterfrom
issue-2490-offer-guidance

Conversation

@TheAnimatrix

@TheAnimatrix TheAnimatrix commented Nov 30, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

Since #2497, a bot's offered message can reach a bot on the owner's other computer without a click, and that computer reports what became of each offer. The bot still reads the stage-1 words: "Your owner picks the bot there and sends it, or not. You get no answer." It can't tell the owner whether an offer arrived, and nothing tells it that the chat was allowed.

Change

  • bot_offer's description says an offer goes without a click only while the owner's messages in that turn came with the chat allowed and to matches exactly one bot they picked; otherwise the owner can use Send while it is open. to asks for the bot's name as the owner gave it, or nothing.
  • The tool's result is status: "offered" (what the call did, also on a retry after delivery) and confirms the offer only: "Offered on ANIMATRIX. This confirms the offer only. Don't wait or offer it again." A retry under the same call key starts with "Same offer as before, not a second one."
  • The situation gets two facts:
    • A chat turn whose owner message came with the chat allowed: "When your owner wrote this message, they had allowed this chat to send to selected bots on their computer. Only that computer knows which bots they picked." It is said of that message, so a later turn without it needs no word. A message from another window that joins or continues that turn takes the allowance off, and its own text then ends with "Your owner sent this message without "Allow for this chat", so what you offer from now on in this turn waits for their Send."
    • Every chat turn: up to 3 recent offers (48 hours, any device), newest change first, each with what that device said: "confirmed delivery to Alpha", "reached its hourly limit. The offer was left for Send", "reported that the offer expired", "doesn't report delivery" (an older PC), "A day passed without word", or "No word yet". The quoted words are the offer's first line, screened like any text in the pack, at most 50 characters. Quotes and angle brackets are taken out of the words and the names, so nothing in them ends the pack's frame. A running conversation reads the list again only when it changes, and "none now" once it empties.
  • Reading the offers uses the id's index (+bot_id keeps SQLite off the bot's index), so a long chat with no offers costs nothing.
  • The bot guidance (BOTS_GUIDANCE) adds three short lines:
    • offer an unlisted bot once per update, with facts that stand on their own, and no other route (bot_send, a relay or a thread);
    • say an offer arrived only when that computer confirms delivery, and offer an expired or busy one again only if the owner asks;
    • mention "Allow for this chat" at most once, and only if the owner wants messages to go without Send.
  • Changelog entry 46 tells running conversations, and retires the old "You get no answer" words.
  • Docs. docs/bots.md → "What the bot is told".

Design

The wording came from a level 3 design: three independent proposals, then a one-round council review of all three against one rubric. Two of the three reviewers picked the proposal built here (the most truthful and the shortest). The third picked another proposal but grafted this one's list lines and grant line into it. Grafts from the other two:

  • the offer list comes from the engine, like open questions, not from the pack;
  • the quoted words are screened;
  • the turn's own message decides the grant line;
  • "offer again only if your owner asks" after an expiry.

The list was first planned for turns from the offering device only. It is on every chat turn instead, so "none now" is never said while offers still stand.

How to review

  1. src/shared/bots/personal/offers.ts: the words (OFFER_ALLOWED_LINE, OFFER_ALLOWED_DROPPED_LINE, recentOfferLine).
  2. BotEngine.offerSituation and BotStore.recentRowsWithPrefix: which offers, and how they are read.
  3. contextPack.ts → situationFacts: where the two facts sit, and what decides a change.
  4. BotChatService.send: the line on a message that takes the allowance off.
  5. catalogue.ts, appTools/bots.ts, changelog.ts: the bot-facing text.

Verification

  • node scripts/verify.mjs PASS @ ddbbfff (master with Allow for this chat: the picker, who it reaches, time left and End access; offer cards say what became of each #2500 merged in): 23 test files (1,266 tests, with the two-daemon test) and both typechecks.
  • tests/bots/memory/botChatEpochPack.test.ts → "offered messages in the situation":
    • the allowed line on that turn only;
    • the list, with the quote cut to one line and its double quotes replaced;
    • an unchanged list not sent again, a changed one sent;
    • "none now" once it empties;
    • words and names that try to close the pack's frame;
    • the line for each state.
  • tests/bots/offeredMessagesGrant.test.ts, over the two-daemon setup:
    • a message from the granting window is told the chat was allowed; after the PC delivers, the next message (from another window) is not, and lists the offer as delivered to Alpha; any other chat turn lists it too, never as allowed;
    • another window's message that joins a granted turn carries the dropped-allowance line.
  • The read uses the id's index (EXPLAIN QUERY PLAN: SEARCH bot_messages USING INDEX sqlite_autoindex_bot_messages_1 (id>? AND id<?)).
  • Not checked: a real model under a grant.

Refs #2490

… allowed, and what became of its recent offers; it says an offer arrived only when that computer confirms delivery
…names and quotes can't end the pack's frame; a message that drops the chat's allowance says so; the tool says offered and when no click is needed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant