agentselect

package
v2.34.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 10, 2026 License: AGPL-3.0 Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const Suffix = "-coderd-chat"

Suffix marks chat-designated agents during the current PoC. This naming convention is an implementation detail, not a stable contract.

Variables

This section is empty.

Functions

func FindChatAgent

func FindChatAgent(
	agents []database.WorkspaceAgent,
) (database.WorkspaceAgent, error)

FindChatAgent picks the best workspace agent for a chat session from the provided candidates. It applies these rules in order:

  1. Filter to root agents only (ParentID is null).
  2. Sort stably and deterministically by DisplayOrder ASC, then Name ASC (case-insensitive), then Name ASC, then ID ASC.
  3. If exactly one root agent name ends with Suffix (case-insensitive), return it.
  4. If zero root agents match the suffix, return the first root agent after sorting (deterministic fallback).
  5. If more than one root agent matches the suffix, return an error with an actionable message.
  6. If no root agents exist at all, return an error.

func IsChatAgent

func IsChatAgent(name string) bool

IsChatAgent reports whether name uses the chat-agent suffix convention.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL