feat(bot-mode): bring Group Chats to mobile gateways - #100386
andrexibiza wants to merge 20 commits into
Conversation
Surface stale peer authorization and journal exact-grant cleanup across Desktop restarts.
Give Bot Group Chats one durable gateway control surface across Telegram, Discord, Matrix, Signal, WhatsApp, Slack, and other messaging clients. Mobile commands append to the room log or Desktop mailbox without interrupting the ordinary agent session, preserve exact authority/idempotency/stop fences, and suppress standalone lease-wait refresh floods on adapters that cannot update status in place.
Replace the prior flaky-check object while preserving the green source-authored train.
Recompose the reviewed Messaging contract on the current Desktop continuity head.
…pters Cross-process session turn lease waits emit a periodic 'Still waiting' refresh roughly every 15s. On adapters without send_or_update_status the status path falls back to a plain send, so each refresh landed as another standalone chat message — eight messages for a two-minute wait on WeCom/Weixin/QQ/Signal-class adapters, drowning the eventual delivery. Extract the refresh wording into a module-level template constant and derive a compile-once matcher from it, then suppress the periodic refresh in the status callback when the adapter cannot update the status in place. Adapters that can (Telegram, Slack) keep refreshing the existing bubble. The initial wait notice and the lease-timeout warning use different wording and are always delivered. (cherry picked from commit 6cb8e33)
Rebuild NousResearch#100386 as an append-only composition instead of replacing contributor history with a single-author squash. The second-parent train preserves: - David Dudok de Wit's NousResearch#97846/NousResearch#98073 continuity and messaging commits through exact source head 6fb588d. - jugol's source-authored NousResearch#96162 forward port at 22b26d0. - liuhao1024's NousResearch#89180 lease-refresh fix through the adapted source-authored replay 6a74634. The lease-status extraction at e3ec744 keeps gateway/run.py from growing, keeps run_agent.py shrinking, and preserves the original import seams and behavior. This merge commit changes no bytes relative to its second parent. Its first parent is the published NousResearch#100386 head, so the correction is forward-only: no force-push, rebase, amend, or source-history rewrite. Related: NousResearch#97681 Fixes: NousResearch#89166
Preserve the resolved Slack Bot-sender predicate with api_human_users, retain Discord guild/profile routing coverage, and compose multi-profile session signatures through the extracted watcher helper.
|
I owe David Dudok de Wit (@dokterdok), @jugol, and @liuhao1024 an apology for the malformed Git provenance in the earlier head of this PR. I collapsed the composed work into The repaired head is now
I am sorry. This should have been caught before the original push. Body credit never substitutes for source-authored commits in the graph; overlapping work must be deduplicated and composed with authorship intact before a PR head moves. |
Landing-edge interlock update — 2026-09-02Fresh live FILE-LIST reconciliation against
These are complementary mechanisms, not duplicates of #100386's mobile Group Chat control/continuity composition. Whichever object lands first changes the landing edge for the others: every later carrier must recompose its shared paths on the landed implementation, preserve both contracts, and reacquire exact-head/every-surviving-commit proof. No receipt transfers across that recomposition. Current #100386 head remains |
|
Thanks, Axl. I appreciate the quick correction and the clear provenance breakdown. All good from my side. |
Bot Group Chats on mobile gateways
Fixes #89166
Related: #97681
Source composition: #97846, #98073, #96162, #89180
Why this matters to users
A Group Chat should not become unreachable when its owner leaves Desktop. From an authorized Signal, Telegram, WhatsApp, Slack, Matrix, Discord, SMS, email, or other connected chat, the owner can inspect recent activity, send the next instruction, retry failed work, approve or deny an exact hosted command, or Stop the Group Chat without knowing which gateway currently hosts it.
Before this change, mobile clients could not reliably control Desktop-created or gateway-hosted Group Chats, and periodic cross-process lease refreshes could flood adapters that cannot edit a status message in place. After it, Group Chats have one durable
/groupcontrol surface across Desktop and messaging gateways, while non-editing adapters keep the initial wait notice and terminal warning without receiving a new refresh message every 15 seconds.What changed
/grouplists and opens existing Bot Group Chats from mobile messaging clients./group <number> send <message>appends one durable room turn without acquiring or interrupting the ordinary chat session's turn lease./group <number> retryand/group <number> stopuse exact idempotency, authority, generation, and cancellation fences./group <number> approvals,approve, anddenyexpose only exact, owner-authorized hosted command decisions; permanent/session-wide approval is not available from messaging.The mobile path is gateway control, not a model prompt. It dispatches while an ordinary agent turn is active without cancelling, steering, or queueing behind that conversation.
Git authorship and provenance
The prior submitted object
2e2ecc074b4c37f22408cc6f29071e6bb251e314incorrectly collapsed the composition into one commit authored solely by Axl. Body acknowledgements were not sufficient Git attribution. David Dudok de Wit (@dokterdok) identified the defect in this source-composition review; that assessment is correct. This head corrects it forward-only: the published commit remains the first parent, while the complete source-authored train is the second parent. No force-push, rebase, amend, or source-history rewrite is required.Preserved source work:
240f42ff4f54428a7a4b59309d56ebd0312d42d5and6fb588dc7c367139dcb25986d611893170066afc.22b26d04ca6719a4e87326681079dc1c040eabbcwithjugol <solomoj94@gmail.com>as Git author.6a746344e42a8cdbbf614e3b3730187dc55f8934withliuhao1024 <sunsky.lau@gmail.com>as Git author.The final bridge
5a467ef9671eed2a2cbd70c011c6c87187daf789is byte-identical to its source-composed second parente3ec744b16c591f4e3fda49188e53466bd1fb172; it exists only to advance the already-published PR ref without rewriting history.The submitted head
63fd45b6245b3430db17fdeb409f38932eb3414dthen merges currentmain@2e25b472108d0f36e02a95bae212255ae76fac0eat4e1051daa25b8581d914ca893aad38fc66e6e1e2. The three landing-edge conflicts preserve both sides: Slack's resolved Bot predicate plusapi_human_users, Discord's guild/profile routing regression, and multi-profile session signatures through the extracted watcher helper.Reliability and security
Composition order
240f42ff4f, including @jugol's source-authored cross-source creation forward port.6fb588dc7c, including ownership splits and hardening.6a746344e42a.e3ec744b16c5: the new owner is 38 lines;gateway/run.pyhas zero net growth andrun_agent.pyshrinks by one line relative to the source merge base.5a467ef9671efrom the published PR head to the source-composed tree.4e1051daa25b, with all three conflicts resolved by preserving both contracts.63fd45b6245b: every changed watcher fixture writes text with explicit UTF-8 encoding.This is the integrated landing object. If it lands, the overlapping source branches must not then be merged independently as duplicate feature payloads; their authorship already survives here in Git.
How to test
Exercise from an authenticated owner chat:
Verification
Local verification on the exact final tree (
63fd45b6245b3430db17fdeb409f38932eb3414d, tree90c847d67a2d204b31c7eaecbca564445f5ed0bf):python scripts/audit_pr_attribution.py: passed;run_agentexports the canonical template object andgateway.runexports the canonical matcher object;git diff --check: passed;2e25b472108d0f36e02a95bae212255ae76fac0e; newsession_turn_lease.pyis 38 lines.The incorporated #98073 source head
6fb588dc7c367139dcb25986d611893170066afcis independently green on GitHub for required CI, contributor attribution, Python, JavaScript/TypeScript, Windows, macOS, Docker amd64/arm64, and Nix. Those are source-head receipts, not a substitute for final-head CI. Final hosted CI is not claimed until GitHub completes it on the corrected PR head.