Skip to content

feat(site/src): list the available agents and their recent chats - #190

Merged
ibetitsmike merged 74 commits into
mainfrom
mike/agent-usage-7-available-agents
Nov 11, 2026
Merged

ibetitsmike merged 74 commits into
mainfrom
mike/agent-usage-7-available-agents

Conversation

@ibetitsmike

@ibetitsmike ibetitsmike commented Nov 11, 2026 •

Copy link
Copy Markdown
Owner

Xum opened this PR on behalf of @ibetitsmike.

Part of #187 (F2, available agents page). Stacked on #189 (F3), which is stacked on #188 (S2 catalog).

No page showed which agents a user can use. Behind the fork-agent-definitions experiment, a new Available agents page at /agents/settings/available-agents, with an item in the Agents settings nav, lists them:

  • Rows: every type the feat: list the agent types of new chats and spawn_agent #188 catalog returns, built-ins included. Each row has the name, the description, the tier (Built-in, Personal, Organization, Project or Workspace), and whether it can start a chat, or the catalog's reason why not.
  • Pickers: an organization picker, plus optional project and workspace pickers. Project and workspace agents come back only when the catalog gets a project or workspace, so without these pickers those two tiers would never show. A pick from another organization is dropped instead of sent.
  • Recent chats: up to 3 per agent, linking to the chat. They come from the chat list the sidebar already loaded, from its cache, with no new server query. Both top-level chats and spawned children count, filtered to the organization and matched on agent_type, with the <source>/ prefix removed from qualified names. "Recent" means within the loaded chat pages, and agents that share a base name across sources show the same chats.
  • Without the experiment the route redirects to /agents/settings and fetches nothing.

There is no "start a chat as this agent" button. The F3 picker in the new-chat composer does that. The Agents sidebar row from #182 still opens the definitions page, and it moves to this page in a follow-up.

Tests: the list test checks each row's tier and reason, that only the matching spawned chat is linked, and that clicking it navigates there. The picker test picks a workspace and checks that the catalog is fetched again with it. The experiment test checks the redirect and that nothing is fetched. Removing the prefix strip, the organization filter, the spawned chats, the workspace parameter, the redirect, the agent type filter or the tier labels each fails a test. The Loaded and NoAgents stories render the page.

Checks: tsc, biome, oxlint, knip, lint:check, lint:compiler, lint:circular-deps, the page's unit tests (3) and story tests (2), and the settings nav's story tests pass locally.

UAT: 4/4 PASS on f080e0a (branch server built from this stack, member account, local Vite against it). /agents/settings/available-agents lists every type with its tier and status, including the unavailable reasons. Picking a project adds the Project row. Settings has one Available agents link. A chat started as a personal agent shows up as that agent's recent chat, and the link opens it.

ResolveRootAgent resolves an agent type for a new root chat the way
spawn_agent does, from the built-in general and explore types and the
owner's personal, organization and project definitions. Workspace
definitions are not pinned when a chat is created, so they are refused.

CreateChat takes the result in CreateOptions.RootAgent. It appends the
definition's prompt, sets the base type's mode, drops the orchestration
guidance when the type cannot spawn, and stores a depth 0 chat_subagents
row with the definition's tool policy in the insert transaction.
customAgentToolPolicyOfChat now loads the policy for any chat with a row,
so the policy holds for such a root from its first turn. The depth 0 row
counts toward no subagent limit: every count selects children by
parent_chat_id or root_chat_id.
POST /chats takes agent_type, which starts the chat as general, explore,
or a personal, organization or project agent definition, behind the
fork-agent-definitions experiment. The definition's model and reasoning
effort apply unless the request sets model_config_id or reasoning_effort.
Unknown, unreadable and workspace-only types fail with 400, and so does
agent_type without the experiment.

The chat list, GET /chats/{chat} and the created watch event report the
root's agent_type from its chat_subagents row. Roots without a row are
unchanged.
GET /api/v2/chats/fork/organizations/{organization}/agent-types lists
the built-in general and explore types and the caller's enabled
personal, readable organization and project definitions, plus the
definitions that a workspace's agent reports when workspace= is given.
Each row carries the name spawn_agent accepts, qualified the same way,
its source, description, model and base type, and whether a new root
chat can start as it, with the reason when it cannot. Workspace rows
are never root-available.

The catalog reuses the S1a resolution helpers: mergeCustomAgentTypes
for naming and rootAgentFromDefinition for root availability.
Root turns now read their tool policy with forkdb.From when
fork-agent-definitions is on, so a database.Store wrapper that a turn runs
through must forward ForkUnwrap and ForkWrap like dbmetrics does. Without
them TestProcessChatPanicRecovery failed its turn before the first model
call.
buildTurnEnvironment decided whether to add the ACP subagent guidance
from the tools before the custom agent policy filtered them, so a root
or child whose policy drops acp_spawn_agent still got the guidance. It
now checks the tools that the policy keeps.

CreateChat also refuses a RootAgent for a chat with a parent, so a child
cannot get a depth 0 chat_subagents row.
List computer_use when spawn_agent offers it, check project= like POST /chats, resolve definition models against the root model (new model_config_id= parameter), and report a workspace with several chat agents as an error.
…atalog' into mike/agent-usage-6-composer-picker
…n its policy

Show the ACP guidance only when the policy keeps every ACP tool, drop
dynamic tool names whose tools the policy removed, and leave out the
create_workspace advice for a detached root that cannot create a
workspace.
…ge-1b-root-agent-type-api

# Conflicts:
#	coderd/x/chatd/fork_root_agent.go
…t-usage-5-agent-types-catalog

# Conflicts:
#	coderd/x/chatd/fork_root_agent.go
…er' into mike/agent-usage-7-available-agents
…ge-1b-root-agent-type-api

# Conflicts:
#	coderd/x/chatd/fork_root_agent.go
…t-usage-5-agent-types-catalog

# Conflicts:
#	coderd/x/chatd/fork_root_agent.go
…oot-agent-type-api

# Conflicts:
#	coderd/x/chatd/fork_root_agent.go
#	docs/fork/pstack-adapter.md
…t-usage-5-agent-types-catalog

# Conflicts:
#	docs/fork/pstack-adapter.md

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9459d06d9e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ibetitsmike

Copy link
Copy Markdown
Owner Author

@codex review

Xum commented on behalf of @ibetitsmike.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

Reviewed commit: 1264f7b3a9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

…ent-types-catalog

# Conflicts:
#	docs/fork/pstack-adapter.md
…atalog' into mike/agent-usage-6-composer-picker
…er' into mike/agent-usage-7-available-agents
@ibetitsmike

Copy link
Copy Markdown
Owner Author

@codex review

Xum commented on behalf of @ibetitsmike.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. What shall we delve into next?

Reviewed commit: c947146663

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ibetitsmike

Copy link
Copy Markdown
Owner Author

@codex review

Xum commented on behalf of @ibetitsmike.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e6ca1071e0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ibetitsmike

Copy link
Copy Markdown
Owner Author

@codex review

Xum commented on behalf of @ibetitsmike.

Base automatically changed from mike/agent-usage-6-composer-picker to main November 11, 2026 12:01
…ailable-agents

# Conflicts:
#	site/src/pages/AgentsPage/components/ChatElements/ForkCompactAgentTypeSelector.tsx

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e6ca1071e0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ibetitsmike
ibetitsmike merged commit b3c4911 into main Nov 11, 2026
15 of 16 checks passed
@ibetitsmike

Copy link
Copy Markdown
Owner Author

Xum merged this PR on behalf of @ibetitsmike.

Merged as a squash of head 1d217457fc on main 1a88b7c2bb. This is the last PR of the agent usage UI stack (#187).

  • CI: fork-ci run 43016881635 green on the exact head (attempt 2), which contains main 1a88b7c2bb. Attempt 1 failed only on the upstream ChatsSidebar keyboard-drag test timing out at 5 s. This PR touches neither that test nor the drag code.
  • Codex: the tree is identical to c947146663, which has a clean receipt (6794739799). The later passes on the same tree raised only P2 polish and test-style points, all dropped with reasons. 0 unresolved threads.
  • UAT: covered by the w10-agents stack run (8/8) on the f080e0a769 superset.

@ibetitsmike
ibetitsmike deleted the mike/agent-usage-7-available-agents branch November 11, 2026 12:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant