Repository navigation
feat(rooms): route a room post by mention or a decision model - #1955
Merged
Merged
Conversation
The Router in internal/rooms decides which members get a post. An @x is a mention only when x names an agent the CLI knows, so @README.md and @./tester stay file references and a member's name wins over a file of the same name. Mentioned members get the post with probability 1 and no model call, and a mentioned agent outside the room gets a notice. A post that mentions no member asks the decision context one predicate per member on rooms.router.model, with the member's description and the last context_posts posts as evidence. It goes to every member at or above min_confidence, and otherwise fallback top sends it to the most relevant member while none asks the author for a mention. Without a model only mentions route. The routes carry the router's probability for the post. config.NeedsGatewayDecisions covers the judge's decisions backend and a rooms router model, and the supervisor starts the gateway with DECISIONS_ENABLED=true for either, in the container and the binary path. rooms.router.model must be provider/model.
…a ping A post that pings agents never asks the decision model. Pinged members get it and a pinged agent outside the room gets a notice, where an outsider-only ping used to fall through to a decision request. rooms.router.max_members (default 2) caps how many members answer a post that pings nobody, the most relevant first, so a noisy room with five members does not get five answers to one question. Pings are never capped. The routes now list the most relevant member first, and 0 means the default.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #1945
Summary
Second step of rooms (#1943): decide which members of a room get a post. Nothing calls the router yet. #1946 logs routed posts and delivers them to member sessions.
Changes
internal/rooms/domain/mention.go:Mentionsreturns the agents a text @mentions. An@xthat starts the text or follows whitespace is a mention only whenxnames an agent the CLI knows, with trailing punctuation dropped.@README.md,@./testerand email addresses are never mentions.internal/rooms/router.go: theRouterdomain service.@x is not in room <room>.notice. Pings are never capped.decisioncontext oneDeciderequest with one predicate per member, named by the agent and carrying its description. The evidence is the lastcontext_postsposts and the new one, each capped at 2000 columns.rooms.router.max_members(default 2) of the members at or abovemin_confidence, the most relevant first, so a noisy room with five members doesn't get five answers. When nobody passes,fallback: toproutes to the most relevant member (first in room order on a tie), andfallback: noneasks the author for a mention.rooms.router.modelonly mentions route, and an unmentioned post gets the mention notice.Routingresult carries the mentions, the routes with their probabilities, and the notices, so [FEATURE] The daemon hosts rooms: post, deliver to members and log their replies #1946 can record them on the post.config.NeedsGatewayDecisions()covers the judge's decisions backend and a rooms router model.internal/gateway/supervisor.gouses it in both the container and the binary start path, so either starts the gateway withDECISIONS_ENABLED=true.rooms.router.modelmust beprovider/modelandrooms.router.max_membersat least 0 (0 means the default), checked at load.internal/rooms/README.mddescribes the router,internal/decision/README.mdlists rooms as a consumer, anddocs/judge-mode.mdnotes that a router model also enables decisions.Notes for #1946
control.gorunsExpandFileReferenceson the text, which would inline a project file namedtesterfor@tester.Tests
TestMentions: order, repeats, trailing punctuation, dashed names, file references,@./<name>, email addresses and unknown names.TestRouterRoute, with the counterfeiterDeciderfake:TestRouterCapsUnmentionedPosts: the default cap of 2, a higher cap, and pings left uncapped.TestRouterAsksOnePredicatePerMember: the request's model, its questions, and thecontext_postsevidence window.TestNeedsGatewayDecisionsand the router model check inTestRoomsConfigValidate.No test covers the supervisor's environment, as there is no harness for its start args. Both call sites now read
NeedsGatewayDecisions().