Skip to content

[FEATURE] Route a room post by mention or a decision model #1945

Description

@edenreich

Summary

Second step of rooms (part of #1943): decide which members get a post the user writes in a room.

  • @mentions of members win, as in Slack: a post with @tester goes to tester only, without asking a model.
  • A post with no mention asks the decision model, through the existing internal/decision context (Decider, one Decide call with one predicate per member): should <agent> (its description) act on this post, given the recent posts? The post goes to every member at or above rooms.router.min_confidence.
  • When no member passes, rooms.router.fallback decides: top sends it to the most relevant member, none posts a notice asking for a mention.

The gateway serves POST /v1/decisions only when started with DECISIONS_ENABLED=true, which the supervisor sets today for Judge.UsesDecisions() (internal/gateway/supervisor.go).

Acceptance Criteria

  • A router domain service in internal/rooms routes a post by its mentions. @x is a mention only when x names an agent the CLI knows: a member gets the post, an agent outside the room gets a "not in this room" notice, and every other @ token, such as @README.md, is left for the member's file expansion
  • In a room a member's name wins over a file of the same name, and @./<name> refers to the file
  • Without mentions, one Decide request asks a predicate per member, with the member's description and the last posts as evidence, on rooms.router.model
  • The post routes to members at or above min_confidence, and fallback top or none handles a post nobody passed
  • The post records whom it routed to and with what probability, so a client can show why
  • Without rooms.router.model, only mentions route and an unmentioned post gets a notice
  • config.NeedsGatewayDecisions() covers the judge and rooms, and the supervisor starts the gateway with DECISIONS_ENABLED=true for either (container and binary paths)
  • Table tests with the counterfeiter Decider fake cover mentions, an agent outside the room, file references left alone, a name clash, threshold, both fallbacks and no model

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Projects

    • Status
      Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions