From c4270e8baf54e57607e5dd7673b1cd414a0aed8b Mon Sep 17 00:00:00 2001 From: Danyang Chen Date: Mon, 26 Oct 2026 16:07:20 +0800 Subject: [PATCH] Ask for one round-trip per new fact (#1235) #796 measured what a round costs on this machine: 7.4 model calls per member-turn, 6.8 members woken by one group message, 13,136 calls and 1.96B prompt tokens a day, every call re-sending the context (~150k here). The largest lever that needs no code is a norm: spend a round-trip on facts the room does not have yet. AGENTS.md gains one subsection beside "Read the board once per round (#796)": independent reads go in one call, a fact already read is quoted with its anchor instead of fetched again, and the same message carries the tip sha, the CI state at that tip and the files read. It also names the empty shapes that pay the whole context for nothing - "let me take a look and get back to you", a second gh pr view, three rounds of one grep. Fixes #1235 --- AGENTS.md | 8 ++++++++ changelog.d/1235-one-round-trip.changed.md | 1 + 2 files changed, 9 insertions(+) create mode 100644 changelog.d/1235-one-round-trip.changed.md diff --git a/AGENTS.md b/AGENTS.md index 0f7ce11a3..43c63190a 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -105,6 +105,14 @@ Decided by the owner (Danyang, GitHub `Birfy`) on 2026-10-18/19; what runs today One read of the open state per round — issues, pull requests, checks — is the budget, not a step to repeat. Whoever reads it writes the facts down where the next Bot will look: the pull request body or a comment, as text. Nobody else re-pulls the same list, restates it in a group chat, or pastes more than five lines of a log; they read the comment. A second opinion needs a second question, not a second fetch. #796 measures what a round actually costs. +#### One round-trip per new fact (#796) + +**Spend a round-trip on what is new.** A round-trip exists to bring back something the room did not have — spend it on all of it at once, and never on what it already has. Independent reads go in one call: one `bash` that runs the greps and the API calls the question needs, one call that reads the files, not three round-trips of one read each. A fact already read is quoted from the last answer with its anchor, and the line above about a list holds for every read. + +**A round-trip carries its facts out in the same message:** the tip sha it saw, the CI state at that tip (green, or the failing check and its reason), and which files it read. That is what the next Bot acts on; a round that brings back less leaves it to open one to ask. + +**An empty round-trip looks like this:** "let me take a look and get back to you" followed by a turn that reads only what the previous one read; a second `gh pr view` to confirm what the verdict already said; three rounds of one `grep` each. Every one of those re-sends the whole context — ~150k tokens on this machine — and the count multiplies: #796 measures 7.4 model calls per member-turn, 6.8 members woken by one group message, 13,136 calls and 1.96B prompt tokens a day, so a round the room did not need is paid once per member that repeats it. + #### A schedule is per session, not per Bot (#628) `schedule_list` answers for **the session the call runs in**, not for the Bot. A schedule the owner created in another session of the same Bot is simply absent from the answer, and nothing in the response says which session it answered for — so `[]` is indistinguishable from "nothing is scheduled". This cost two wrong conclusions on 2026-10-21: a Bot reported "0 timers" and the team concluded a live schedule had never existed, and another run came close to deleting and recreating a schedule that was running. diff --git a/changelog.d/1235-one-round-trip.changed.md b/changelog.d/1235-one-round-trip.changed.md new file mode 100644 index 000000000..1b72d7cc7 --- /dev/null +++ b/changelog.d/1235-one-round-trip.changed.md @@ -0,0 +1 @@ +A round-trip now exists to bring back a fact the room did not have: independent reads go in one call, a fact already read is quoted with its anchor instead of fetched again, and the same message carries the tip sha, the CI state and the files read, because every avoidable round-trip re-sends the whole context ([#796](https://github.com/ThinkFlowLab/FlyBot/issues/796), [#1235](https://github.com/ThinkFlowLab/FlyBot/issues/1235)).