Skip to content
17 linesCodeBlameRaw

Pick any line to see why it is the way it is: the commit, the pull request and issue it came from, and what the agent was thinking.

An agent is on teams the way a person is: through team membership, with no team or department of its own. Add it to teams when you create it, from its profile or from the team's page; the Agents sidebar groups agents by the teams they're on, with those on none last; what an agent is told about its teammates, team budgets, skills reach, Spend's By team and the People pages all read memberships. Agents with an old team name matching a team are moved onto it once; the rest are left off a team. Templates name a role only. The agents, teams and people guides say how.1-- An agent is on teams the way a person is: through team membership in
2-- identity (team_agents), added and removed on the team page or the
3-- agent's profile (docs.g1t.sh/guides/people-and-teams/). The agent itself
4-- carries no team and no department.
5--
6-- agents.team and agents.department stay as they are, unused: migrations
7-- run before the code, so the code still serving during a deploy reads
8-- and writes them for a minute or more. A later migration drops them once
9-- no deployed code names them.
10--
11-- Each agent's old `team` moves to a membership once (src/team-move.ts,
12-- run by the cron): a team of that slug in its workspace gets it as a
13-- member, and a value that names no team is dropped and logged.
14-- `team_moved_at` marks the agents it has seen, so it never runs twice for
15-- one, and taking an agent off that team later stays taken off.
16ALTER TABLE agents ADD COLUMN team_moved_at TEXT;
17CREATE INDEX IF NOT EXISTS agents_team_to_move ON agents (id) WHERE team IS NOT NULL AND team <> '' AND team_moved_at IS NULL;