Stop saying an agent can never be in a Ping

Merged
JE
9d ago
+17-12

Two comments in the mention code still say an agent can never be in a Ping. That stopped being true when bc3 shipped agents in Pings (bc3 #13444, #13446, #13448).

What bc3 does now, on origin/master:

  • Agents can be in a Ping. In app/models/circle.rb, Circle.with_a_person? is people.any? { it.user? && it.can_ping? }: an agent can start a Ping, and write in one, when a person who can use Pings is in it. CirclesController allows the agent principal on create.
  • The pingable set lists agents. Circles::PeopleController#index lists reachable_people.principals, and principals is User and Agent. So the pingable set holds the agents a person can reach.

What changes here:

  • internal/commands/helpers.go: the comment now says the pingable set holds the agents a person can reach, not every agent on a project, which is why the project-scope fallback is still consulted.
  • internal/commands/mention_agents_test.go: the comment now says the fake leaves the agent out of the pingable set so that the fallback is what finds it. It no longer claims Basecamp forbids agents in Pings.

Comments only, no behaviour change. Whether mention resolution should lean on the pingable set for agents now is a separate question, left alone here.


Summary by cubic

Updates the comments in the mention code that still claimed agents can never be in a Ping, which stopped being true when Basecamp shipped agents in Pings. The pingable set now lists the agents a person can reach, not every agent on a project, so the project-scope fallback is still needed. Corrects the resolver's own comments on the same point. Comments only; no behavior change.