Repository navigation
feat(site/src): list the available agents and their recent chats - #190
Conversation
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.
…ge-1b-root-agent-type-api
…t-usage-5-agent-types-catalog
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.
…ge-1b-root-agent-type-api
…t-usage-5-agent-types-catalog
…t-usage-5-agent-types-catalog
…ge-1b-root-agent-type-api
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
There was a problem hiding this comment.
💡 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".
…t-usage-5-agent-types-catalog # Conflicts: # docs/fork/pstack-adapter.md
…atalog' into mike/agent-usage-6-composer-picker
…er' into mike/agent-usage-7-available-agents
|
@codex review
|
|
Codex Review: Didn't find any major issues. More of your lovely PRs please. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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
|
@codex review
|
|
Codex Review: Didn't find any major issues. What shall we delve into next? Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
…er' into mike/agent-usage-7-available-agents
|
@codex review
|
There was a problem hiding this comment.
💡 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".
|
@codex review
|
…ailable-agents # Conflicts: # site/src/pages/AgentsPage/components/ChatElements/ForkCompactAgentTypeSelector.tsx
There was a problem hiding this comment.
💡 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".
Merged as a squash of head
|
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-definitionsexperiment, a new Available agents page at/agents/settings/available-agents, with an item in the Agents settings nav, lists them: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./agents/settingsand 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
LoadedandNoAgentsstories 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-agentslists 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.