feat(bot-mode): complete Group Chat continuity, control, and files - #98307
feat(bot-mode): complete Group Chat continuity, control, and files#98307dokterdok wants to merge 104 commits into
Conversation
Review: add crash-window tests around artifact settlementThe integration description says upload, commit, acknowledgement, redelivery, restart, and cleanup are idempotent. In the hosted attachment path, those claims cross several different durability boundaries: Suggested focused matrixInject a crash or forced exception at each boundary and restart the store/room owner: For every row, assert the SQLite state, blob digest/size, room and gateway quota counters, visible event payload, and the next cold-start read. The random |
2dc1ef4 to
4baab59
Compare
|
Addressed in The focused matrix now injects and verifies:
The subsequent packaged UAT also exercised image, PDF, generic-file, Bot-generated-file, close/reopen, and cross-gateway handoff paths on real gateways. Thanks for pointing the review at the filesystem/SQLite boundaries rather than only the happy-path RPCs. |
b9980df to
b0a36b0
Compare
eda6432 to
4cddb54
Compare
ddc950f to
3199a84
Compare
Cold /api/status through a Windows no-mux SSH forward routinely exceeds the 2.5s dispatch budget, so Desktop retires a live tunnel and respawns. Use the cheap /api/health route (5s, same as DEFAULT_HEALTH_PROBE_TIMEOUT_MS). Background liveness still probes /api/status at 10s. (cherry picked from commit cc6054c)
Persist the reciprocal peer target profile at live-reservation registration and use that durable binding for named room discovery and remote Files. Legacy migration accepts only one unrevoked room/member binding that existed by control creation; natural expiry is not revocation, while missing, reassigned, or ambiguous history stays unbound. Keep a unique live reservation mandatory for initial control registration and leave RoomLink execution admission, explicit control revocation, authority/member/profile checks, recipient eligibility, publication fencing, and post-fetch revocation unchanged. Source-control-owner: NousResearch#98073 at 65b2e53 (ported here by 4909ab5). Source-file-bridge: 4f9678762f (ported here by 1e993be). NousResearch#98072 and NousResearch#99159 do not contain these reciprocal-control/file-access owners. Test: 220 passed across 8 focused files, one worker, zero retries.
Mark the exact peer control credential locally revoked before contacting the room authority, retaining its bearer after transport failure or malformed acknowledgement so cleanup can be retried after reservation GC. Validate the home DELETE's idempotent revoked=0/1 response and erase only a still-matching terminal row after verified completion. Match target profile, endpoint, authority/epoch, token, creation, and expiry under an immediate transaction. A concurrently rotated or replaced active row is never removed by stale cleanup. Natural reservation expiry remains independent from revocation. Source-owner: NousResearch#98073 at 65b2e53, composed above ad35dd4 and Galileo Desktop commit b412108. NousResearch#98072 and NousResearch#99159 do not contain these reciprocal-control owners. RED: partial remote revoke left the peer control active after home failure; later reservation GC removed the only denial fence. Test: 239 passed across 10 focused files, one worker, zero retries.
When a shared-store RoomLink scope revocation commits, atomically mark any compatible matching reciprocal peer control revoked in the same SQLite transaction. The optional table is neither imported nor created, so core RoomLink storage remains independent when messaging controls are absent; exact-grant revocation remains unchanged. This closes the shared-success/profile-failure path before API or RPC cleanup can run. Reservation expiry and unrelated admission GC can no longer reactivate Files, while the revoked control row retains its bearer for verified remote cleanup retry. Accept additive home DELETE response fields while requiring revoked to be the integer 0 or 1. Source-owner: NousResearch#98073 at 65b2e53, composed above 1d97ae2 and Galileo Desktop commit 80755ef. NousResearch#98072/NousResearch#99159 have the shared storage file but no reciprocal-control consumer or test. Test: 101 passed across 8 focused files, one worker, zero retries.
Reproduce the Workshop follow-up failure reported on source269 and preserved at c54b733. Preserve immutable retry admissions and schedule a fresh recipient input after late committed output. Rebuild compacted policy state from bounded receipts, fence completion writes, and expose nonblocking needs_attention status. Validation: 9 targeted regression cases plus 227 adjacent tests across 10 distinct files pass via scripts/run_tests.sh with zero failures or retries. No controls, Files access, native client, hosts, or publication changes.
Use pending retry and approval actions when settled activity is otherwise idle. Preserve stopping and healthy-running priority, and support older host replies without a needs_attention field. Verified with 65 messaging tests.
Keep retry available after the room settles without hiding healthy ongoing work. Consume both explicit attention and existing pending actions from older hosts. Verified with 25 runtime tests.
Reconcile the upstream Slack model picker into the existing extracted owners. The five relocated methods preserve the upstream AST after facade qualification. Retain the reviewed retry/handoff and attention repairs, and both authorship histories.
Real cross-gateway creation sent /p/member/p/member/v1/room-members/capabilities and fell back on HTTP404. Reuse matching endpoint scope and reject a conflicting explicit profile before I/O. Seven baseline regression failures now pass within an 84-test JSON/binary routing gate. Independent bounded review cleared the change; no grant or redirect policy is loosened.
(cherry picked from commit 76db196cdb6c8851d5eef375d7e441529de503d1)
(cherry picked from commit 179dc0cb1be4b5f0bd9a0894085256f637ef788c)
(cherry picked from commit b9d34be2b8f890df970c7ab0a76d17619049f1ec)
(cherry picked from commit d057f2faf56eef408e0701149913cae5b241d0b3)
(cherry picked from commit bf95af28699aa04f518f143b86a6e30ae90ed68b)
(cherry picked from commit e1d93610a9e0b9e7269cd971b3fd2b115c29fea4)
(cherry picked from commit 416c26fbaac92c652b1bfda015eeac81e614f231)
Compose the Desktop mailbox consumer with classic file handoff. Recover accepted output under its command lease, keep stopped outcomes durable, and let newer work continue without resubmitting retired commands.
Keep Your Bots Working Together, Then Pick Up From Your Phone
This is the complete Group Chat field build for #97681. Bots on the same or different gateways can exchange messages and files while Desktop is closed, provided their gateways support and can reach the shared group. The owner can return in Desktop or use a connected messaging chat to inspect progress, steer the work, retrieve files, or Stop it.
Create a Group Chat normally. Hermes selects the available continuity path and shows when Desktop is still needed. Older gateways keep the compatible Desktop-driven behavior.
Current field gate: hosted Bot-to-Bot file handoff and human retrieval work in real-client tests, including file retrieval after an execution grant expires. Classic Desktop-driven file handoff also passes a real six-Bot writer/reviewer transfer and exact Desktop download. The missing classic messaging consumer and its recovery cases are now implemented and independently reviewed. The final packaged Desktop acceptance run is in progress.
A Concrete Workflow
/groupand choose the group to see recent work.Where shared files live, and which Bots receive them
In a hosted Group Chat, the home gateway retains a verified shared copy. A Bot receives bytes when its task includes the attachment; the other Bots do not automatically synchronize a copy to their disks. Files lists the available items and downloads only the one you choose.
flowchart TB W["Writer Bot"] -->|"Shares a file"| H["Group's home gateway: stored shared copy"] H -->|"Bytes for the admitted task"| R["Reviewer Bot"] H -->|"Selected download"| U["You: Desktop or messaging"] H -->|"Attachment reference"| L["Group history and Files list"]These are roles, not necessarily separate machines: the home gateway may also run one or both Bots. Mentioning a reviewer directs the work, not privacy. Other eligible group members can receive the file on a later turn. This is neither a shared disk nor an automatic backup on every gateway.
Classic Desktop chats use a separate storage path. Their user uploads are retained by Desktop; explicitly shared Bot output is retained on the producing gateway, with verified references in Desktop. A packaged six-Bot writer/reviewer transfer and exact Desktop download have passed. The diagram above describes hosted chats only.
What Is In This Build
The build composes the Desktop continuity client, durable Files, Bot-to-Bot file handoff, native messaging controls, shared history, approvals, and route recovery. The source commits and contributor history remain preserved.
Recent repairs include named-profile upload/download routing, exact credential retirement, stale route fencing, stable file selection after new arrivals, Home changes surviving failed writes, simultaneous Stop redelivery, and retaining Bot output across publication recovery. Published repairs have owning source PRs; the newest classic-file candidate keeps backend and Desktop commits separately selectable while its source drafts are prepared.
This remains an integration draft, not a request to merge every layer as one change. #97846 is the Desktop-only client; #98072 owns Files; #99159 owns Bot-generated handoff; #98073 owns messaging controls and its optional Files consumer; #100016 owns route recovery. #99107 and #96162 remain independent. The maintainer's staged merge direction still applies.
The new Desktop Files client and classic Bot file-export backend are already available as focused drafts in the contributor fork, included in this field build. They preserve the upstream prerequisites' scope while their live acceptance checks finish. Please coordinate related implementation through #97681 and reuse the linked authored commits rather than rebuilding these paths independently.
Validation And Remaining Gate
Current integration head:
25cda8f8f76729de746dcaf424dfbf883323fb14. The final classic-command repairs pass 120 focused tests, all three TypeScript checks, changed-owner lint and the strict 2K check. One independent reviewer cleared the final code with no remaining confirmed P0/P1/P2/P3 in the reviewed boundary. The Git tree is identical to reviewed commit467131c92a; unpublished repair iterations were folded while retaining their authored source and test evidence. New CI is running. Packaged Desktop UAT remains a separate gate.The latest field results are the cross-gateway writer/reviewer workflow, exact Desktop and Signal downloads, a Signal-only revision with Desktop closed, and natural grant-expiry recovery through Telegram. A classic six-Bot group completed a producer-to-reviewer file handoff with exact bytes. After #103638 repaired the profile-policy mismatch, a fresh maximum-size six-Bot group created as hosted and all six Bots settled exactly once.
Test evidence and repaired failure cases
ci-reviewedlabel.da19f696f5, whose backend code is unchanged by the later Desktop-only repairs. Whole-source hygiene and non-root, network-isolated real agent import/tool discovery passed before deployment. Fresh zero-work checks preceded each graceful restart; protected task/delegation records remained unchanged. The final Desktop package is being prepared for acceptance.Full replylabel; the action remained present asGet full reply, and the corrected exact tests pass. Live verification remains before the walkthrough video.Fresh real-client UAT is in progress. A recovered writer's late output exposed a missing follow-on reviewer turn; the repair preserves the old task input and creates a fresh recipient turn. It passes 233 tests in the Bot-handoff source and is deployed here. Classic Bot-produced file handoff and hosted six-Bot stress now pass.
The classic messaging consumer now publishes the required commitment and executes queued commands through the existing serial Desktop runner. Recovery tests cover lost acknowledgments, trimmed history, legacy groups, Disband/recreation, delayed session setup, expired command leases, and unresolved file output. A newer input can retire old work without a later retry submitting it again; failed storage writes cannot bypass that protection. These repairs are reviewed and tested, with the final real-client retry still pending. Earlier field receipts remain historical evidence, not certification of every case on this head.
Try The Complete Stack
Check out this PR at the pinned head and use disposable gateways and data. Build Desktop and the backend from the same candidate. Do not assemble moving sibling PRs by hand; the smaller PRs are the review/merge path and this branch is the combined test recipe.
Keep production credentials and data out of automated tests. For field testing, verify the actual recipient's file bytes and one visible result, then repeat with a named remote profile, a reconnect, and a stopped turn. The authority gateway must remain available; this build does not enable unfenced automatic takeover.
The most useful feedback is on missing everyday journeys, regressions from existing Group Chats or single-Bot conversations, confusing recovery controls, and cases that should be included in broader field testing.