Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

feat(signals): preserve scout display names separately from slugs (#101481)

posthog[bot]a23938953922
diff --git a/products/replay_vision/frontend/generated/api.schemas.ts b/products/replay_vision/frontend/generated/api.schemas.ts
index 8bc8aae141d1..c4735d86e7c3 100644
--- a/products/replay_vision/frontend/generated/api.schemas.ts
+++ b/products/replay_vision/frontend/generated/api.schemas.ts
@@ -1850,10 +1850,15 @@ export interface SignalScoutConfigOptionsApi {
*/
export interface ScannerScoutCreateApi {
/**
- * Unique scout name, containing only lowercase letters, numbers, and hyphens. The `signals-scout-` prefix is optional.
+ * Name shown wherever people identify this scout, written however you want it — spaces, capitalization, and acronyms are kept as typed, and two scouts may share one. It does not change the scout's skill name, which stays its identity, so renaming a scout keeps its schedule, run history, notes, memory, and links. At most 200 characters; blank means the scout has no name of its own and is labelled from its skill name instead.
+ * @maxLength 200
+ */
+ display_name?: string
+ /**
+ * Optional skill name for the scout — its permanent identifier, containing only lowercase letters, numbers, and hyphens. Omit it and one is generated from `display_name` (`My APM scout` becomes `my-apm-scout`), with a numeric suffix when that name is taken. Pass it to pick the identifier yourself, or to keep a client written before display names working unchanged. The `signals-scout-` prefix is optional.
* @maxLength 64
*/
- name: string
+ name?: string
/**
* Short description of the signal or behavior this scout investigates.
* @maxLength 1024
diff --git a/products/replay_vision/frontend/generated/api.zod.ts b/products/replay_vision/frontend/generated/api.zod.ts
index 06849f23ceeb..41e18c68d75b 100644
--- a/products/replay_vision/frontend/generated/api.zod.ts
+++ b/products/replay_vision/frontend/generated/api.zod.ts
@@ -944,6 +944,8 @@ export const VisionScannersPromptSuggestionsEvaluateCreateBody = /* @__PURE__ */
/**
* Create a scout that watches this scanner, recorded as belonging to it.
*/
+export const visionScannersScoutsCreateBodyDisplayNameMax = 200
+
export const visionScannersScoutsCreateBodyNameMax = 64
export const visionScannersScoutsCreateBodyDescriptionMax = 1024
@@ -977,11 +979,19 @@ export const visionScannersScoutsCreateBodyConfigOneRunCronScheduleMax = 100
export const VisionScannersScoutsCreateBody = /* @__PURE__ */ zod
.object({
+ display_name: zod
+ .string()
+ .max(visionScannersScoutsCreateBodyDisplayNameMax)
+ .optional()
+ .describe(
+ "Name shown wherever people identify this scout, written however you want it — spaces, capitalization, and acronyms are kept as typed, and two scouts may share one. It does not change the scout's skill name, which stays its identity, so renaming a scout keeps its schedule, run history, notes, memory, and links. At most 200 characters; blank means the scout has no name of its own and is labelled from its skill name instead."
+ ),
name: zod
.string()
.max(visionScannersScoutsCreateBodyNameMax)
+ .optional()
.describe(
- 'Unique scout name, containing only lowercase letters, numbers, and hyphens. The `signals-scout-` prefix is optional.'
+ 'Optional skill name for the scout — its permanent identifier, containing only lowercase letters, numbers, and hyphens. Omit it and one is generated from `display_name` (`My APM scout` becomes `my-apm-scout`), with a numeric suffix when that name is taken. Pass it to pick the identifier yourself, or to keep a client written before display names working unchanged. The `signals-scout-` prefix is optional.'
),
description: zod
.string()
diff --git a/products/signals/backend/models.py b/products/signals/backend/models.py
index f30380b44ce9..5f48930216c1 100644
--- a/products/signals/backend/models.py
+++ b/products/signals/backend/models.py
@@ -1864,6 +1864,10 @@ class SignalScoutConfig(ModelActivityMixin, TeamScopedRootMixin, UUIDModel):
MAX_TAGS = 10
MAX_TAG_LENGTH = 50
+ # Cap on `display_name`. Generous rather than tight: the name is prose a person writes, and
+ # every surface truncates it anyway, so the limit only has to stop a pasted document.
+ MAX_DISPLAY_NAME_LENGTH = 200
+
# `objects` (TeamScopedManager) inherited from TeamScopedRootMixin stays fail-closed for
# explicit user code. `all_teams` is the unscoped sibling for Django framework internals
# (admin changelist queryset, related-object access, prefetch_related) that must not
@@ -1886,8 +1890,11 @@ class SignalScoutConfig(ModelActivityMixin, TeamScopedRootMixin, UUIDModel):
# `signals-scout-foo` gets a row (on the default schedule) on the next tick. A bare-named
# skill is registered through the scout create endpoint instead.
skill_name = models.CharField(max_length=200)
+ # What a person calls this scout, kept exactly as typed — spaces, capitalization, acronyms.
+ # `skill_name` above stays the identity every other row keys on, so a rename touches only this
+ # column. Blank means "no name of its own": every surface then derives a label from the slug.
display_name = models.CharField(
- max_length=200,
+ max_length=MAX_DISPLAY_NAME_LENGTH,
blank=True,
default="",
db_default="",
diff --git a/products/signals/backend/scout_harness/AGENTS.md b/products/signals/backend/scout_harness/AGENTS.md
index 13c46e6c06cf..3f1e8f53aa24 100644
--- a/products/signals/backend/scout_harness/AGENTS.md
+++ b/products/signals/backend/scout_harness/AGENTS.md
@@ -22,12 +22,13 @@ In production it is driven by `SignalsScoutCoordinatorWorkflow` (periodic tick e
`resolve_skill_owner_user_uuids` exposes the owner set (seed-creator first) to the report tools' reviewer provenance stamp (`is_skill_owner`). Author resolution is opt-in via `load_skill_for_run(..., include_authors=True)` — only the runner's prompt-building path pays for it; the report-authorization gate in `views.py` loads the skill per report write just to check `allowed_tools` and skips it.
- `lazy_seed.py`
Canonical skill sync. Reads `products/signals/skills/signals-scout-*/` from disk and reconciles them against the team's `LLMSkill` rows: creates missing rows, updates ones the team hasn't edited, leaves diverged / hand-authored rows alone, tombstones rows whose canonical skill was deleted. Only rows tagged `metadata.seeded_by="signals_scout_harness"` are ever updated. Called both lazily (coordinator tick, runner cold-start) and explicitly via the `sync_signals_scout_skills` management command.
- It also parses the two config-shaping frontmatter keys, neither of which enters the content hash (both belong to the config, not the skill row): `scout-tags` (`canonical_config_tags_for`) and `scout-role` (`is_operational_scout`). `scout-role: operational` marks a scout that watches the self-driving system itself rather than a product surface — the fleet's follow-up validation scout — and an unknown value fails the parse rather than falling back, since a silently downgraded operational scout is the silencing the role exists to prevent.
+ It also parses the three config-shaping frontmatter keys, none of which enters the content hash (all belong to the config, not the skill row): `scout-tags` (`canonical_config_tags_for`), `scout-role` (`is_operational_scout`), and `scout-display-name` (`canonical_display_name_for`). `scout-display-name` is the label the scout ships under, and every canonical scout states one, because the clients' fallback sentence-cases the slug and turns `signals-scout-apm` into "Apm". `scout-role: operational` marks a scout that watches the self-driving system itself rather than a product surface — the fleet's follow-up validation scout — and an unknown value fails the parse rather than falling back, since a silently downgraded operational scout is the silencing the role exists to prevent.
- `fleet_sync.py`
`materialize_scout_fleet(team, surface=...)` — the on-demand `configs/sync/` path, and the only place that records what a materialization did. Resolves the seed posture + holdback from one flag read, runs `sync_canonical_skills(prune=True)` and `register_missing_configs`, then captures `signals_scout_fleet_synced` with the per-bucket counts the `SyncResult` carries (created / updated / diverged / tombstoned / pruned), the configs it registered, the fleet it left behind, whether the project had one before (`was_empty` — the rescue metric), the `surface` the caller declared, and how long the pass took. Every sync captures, zero counts included: a no-op sync is the denominator for "how often does opening the tab find work to do". Best-effort, like every other scout event.
It also carries the mass-prune tripwire. A reap that takes more than half the canonical fleet, and at least `MASS_PRUNE_FLOOR` scouts, is not a retirement — it means the sync read a fleet the deploy did not ship — so it stamps `unexpected_prune` on the event and captures `UnexpectedScoutFleetPrune` into error tracking. A detector, not a guard: by the time the count exists the rows are tombstoned.
- `config_registry.py`
`register_missing_configs(team_id)` — auto-creates an enabled, default-schedule `SignalScoutConfig` for any `signals-scout-*` skill lacking one ("author a skill, get a scout"). Called by the coordinator tick; the HTTP surface registers explicitly via the write-scoped config `create` endpoint instead (reads stay side-effect free). A canonical scout's `scout-tags` frontmatter (read through `lazy_seed.canonical_config_tags_for`) is stamped on the row it creates, which is how a product surface claims its scouts by tag instead of by hardcoded skill name — AI observability's self-driving tab lists the `ai-observability`-tagged configs. Forward-only like the rest of the seed posture: adding the key to an already-seeded scout leaves that team's existing config untagged until someone tags it through the config API.
+ The scout's `scout-display-name` is stamped the same way, and additionally backfilled onto existing rows by `reconcile_canonical_display_names` — every canonical config predates the key, so nothing else would ever give them a label. That pass writes only where `display_name` is blank, so it can run on every tick without ever undoing a rename.
An **operational** scout (`scout-role: operational`) is the one exception to all of that: it seeds enabled and `auto_pause_exempt`, past the `enabled_skills` allowlist and past `MAX_ENABLED_SCOUTS_PER_TEAM` (it still counts toward the cap, so its slot is visible), and `reconcile_operational_configs` runs on every tick to put rows seeded before the role existed back on those terms. The reconcile undoes only the harness's own silencing — a sweep warning or pause via `transition_status_by_system`, and a row the seed created disabled, which the model stores as `paused_by_user` and the reconcile tells apart by its null `status_changed_at`. A person's pause and a `repeated_failures` pause are both left standing. The holdback still gates the scout, whatever its role, and the config API refuses to delete it (`views.destroy`).
- `suggestions.py` / `suggestions_runner.py`
Pre-computed scout suggestions: the push-side twin of the "Suggest a scout" chat button. `suggestions.py` (temporalio-free, cheap to import) holds the structured-output contract the headless run returns (`ScoutSuggestionBatch`: 3-5 items, each a `canonical` "turn this on" pick or a `custom` draft with a ready-to-create `draft_body`), the `signals-scout-suggestions` flag-payload settings (`enabled`, `eligibility_tier` 0-4 (0 = allowlist only), `refresh_days`, `max_children_per_tick`, allow/blocklist, failure breaker), the planner (`plan_suggestion_runs`: recomputes the priority queue from Postgres every tick; tier, then never-generated, then most overdue, then most recently engaged; engagement is a report view or rating, a scout a person turned on or off (`status_changed_by`), or a scout a person created (`created_by`), never a plain edit or a system touch; nothing is stored as a queue; engagement is read only for the teams already in the tier map, since `SignalReportAction.last_at` is deliberately unindexed and an unbounded filter on it scans the whole action history; a team past the failure breaker doubles its refresh interval per further failure, because the cooldown is shorter than the refresh window and so could never hold a scheduled retry back), draft validation (`validate_suggestion_items` drops anything the one-click Create could not apply as-is), and persistence on `SignalScoutSuggestionSet` (one row per team, items as JSON, every write under a row lock since each is a read-modify-write of the column; dismissals carry forward by `skill_name` and survive as hidden tombstones when a batch omits the name, compacted to the dismissal fields so a dropped draft body does not sit in the row forever; a batch persisted after the fleet moved is stored `stale`, and a batch that merely aged past `refresh_days`, whether it held items or concluded there was nothing to suggest, reads as `stale` through `effective_status`, since nothing writes that status on expiry; a failed generation anywhere after the gates keeps the prior items and counts toward the breaker; `mark_stale_if_fleet_changed` is wired to `SignalScoutConfig` saves in `../receivers.py`). Reads hide dismissed, created, and already-enabled items, plus custom drafts whose name a stored skill or config has since taken; the manual refresh endpoint honors the same kill switch and blocklist as the planner, runs the scan as its authenticated caller rather than the resolved team member, and a manual dispatch stamps `last_requested_at` so the coordinator does not double up. `suggestions_runner.py` is the one piece that needs the tasks agent facade: `arun_scout_suggestions` gates (AI-processing consent, an acting user; deliberately no self-driving credits gate, since a scan opens no pull request and so bills nothing, while a skip would still burn the team's whole refresh window), mints a `read_only` headless task with the reserved `SIGNALS_SCOUT_SUGGESTIONS` origin, no GitHub token and no MCP Store servers, because the scan reads project text any member can write, parses the batch with no prose salvage (an unparseable close-out is a failed generation), validates, persists, and emits `$scout_suggestions_generated`. Driven by `temporal/agentic/scout_suggestions.py` (coordinator + child, same shape as the scout coordinator, own schedule) and exposed read/dismiss/refresh at `signals/scout/suggestions/` (`../scout_suggestions_api.py`), where membership, token scope, and resource-level RBAC all anchor to the canonical parent team. The prompt shares `SCOUT_PROJECT_SCAN_GUIDANCE` (in `prompt.py`) with the chat template so the two voices never drift.
diff --git a/products/signals/backend/scout_harness/config_registry.py b/products/signals/backend/scout_harness/config_registry.py
index 9cc5f66912ad..38a5e211da44 100644
--- a/products/signals/backend/scout_harness/config_registry.py
+++ b/products/signals/backend/scout_harness/config_registry.py
@@ -30,6 +30,7 @@ from products.signals.backend.scout_harness.lazy_seed import (
HARNESS_SEEDED_BY,
SCOUT_SKILL_CATEGORY,
canonical_config_tags_for,
+ canonical_display_name_for,
canonical_skill_names,
is_operational_scout,
)
@@ -290,6 +291,12 @@ def register_missing_configs(
# removed. Only canonical names read from disk: a team's scout sharing the name is its own.
if name in canonical_names and (canonical_tags := canonical_config_tags_for(name)):
defaults["tags"] = list(canonical_tags)
+ # The label the fleet ships this scout under (`scout-display-name`), so a canonical scout
+ # reads as "APM" rather than the "Apm" a sentence-cased slug would produce. Unlike the rest
+ # of the posture this is also reconciled onto existing rows below, because a row created
+ # before the scout declared a label has no way to acquire one otherwise.
+ if name in canonical_names and (canonical_display_name := canonical_display_name_for(name)):
+ defaults["display_name"] = canonical_display_name
# The launch cadence is stamped on every canonical (gated) scout — whether it seeds
# enabled now or stays disabled for the user to switch on later — so a specialist a user
# toggles on runs at the flag's launch cadence rather than the model default (daily).
@@ -313,6 +320,8 @@ def register_missing_configs(
cap=MAX_ENABLED_SCOUTS_PER_TEAM,
)
+ reconcile_canonical_display_names(team_id, canonical_names & skill_names)
+
reconcile_operational_configs(team_id, operational_names & skill_names, withheld_skill_names)
# Keep the skills UI's Scouts tab in sync: stamp `category="scout"` on any scout skill rows
@@ -322,6 +331,33 @@ def register_missing_configs(
return skill_names | live_scout_skill_names(team_id, withheld_skill_names)
+def reconcile_canonical_display_names(team_id: int, canonical_names: set[str]) -> None:
+ """Give every canonical scout on this team the label the fleet ships it under, if it has none.
+
+ The rest of the seed posture is forward-only, and for the same reason this pass is narrow: it
+ writes only where `display_name` is blank, so a scout a person renamed keeps the name they gave
+ it, on this tick and on every tick after. Blank is not a choice a person can lose — it is what
+ "no name of its own" is stored as, and the label the fleet ships is exactly the default that
+ stands for, so filling it in is the sync doing what blank already meant.
+
+ Backfill, not posture: a canonical scout registered before the fleet declared its label would
+ otherwise read as "Apm" forever, since nothing else ever revisits the column. Costs one read
+ per tick once every row is named, and nothing after that.
+ """
+ labelled = {name: label for name in canonical_names if (label := canonical_display_name_for(name))}
+ if not labelled:
+ return
+ configs = SignalScoutConfig.objects.for_team(team_id)
+ unnamed = set(configs.filter(skill_name__in=labelled, display_name="").values_list("skill_name", flat=True))
+ for skill_name in sorted(unnamed):
+ # Re-checking `display_name=""` in the update makes the write lose to a rename that landed
+ # since the read, rather than reverting it. QuerySet.update() skips both auto_now and the
+ # activity log, which is what this should do: a seeded default is not an edit anyone made.
+ configs.filter(skill_name=skill_name, display_name="").update(
+ display_name=labelled[skill_name], updated_at=timezone.now()
+ )
+
+
@transaction.atomic
def reconcile_operational_configs(
team_id: int,
diff --git a/products/signals/backend/scout_harness/lazy_seed.py b/products/signals/backend/scout_harness/lazy_seed.py
index 49095f8b22f2..78b4d236deaf 100644
--- a/products/signals/backend/scout_harness/lazy_seed.py
+++ b/products/signals/backend/scout_harness/lazy_seed.py
@@ -109,6 +109,8 @@ class CanonicalSkill:
alongside SKILL.md. `config_tags` is the optional `scout-tags` frontmatter list, seeded onto
the scout's `SignalScoutConfig` when that row is first created. `role` is the optional
`scout-role` frontmatter value — what the harness is allowed to do to the scout.
+ `display_name` is the optional `scout-display-name` frontmatter value, the label the fleet
+ ships the scout under.
"""
name: str
@@ -119,6 +121,7 @@ class CanonicalSkill:
source_path: Path
config_tags: tuple[str, ...] = ()
role: ScoutRole = SCOUT_ROLE_SPECIALIST
+ display_name: str = ""
@dataclass(frozen=True)
@@ -231,6 +234,34 @@ def _parse_scout_role(frontmatter: dict, skill_file: Path, *, is_scout: bool) ->
)
+def _parse_display_name(frontmatter: dict, skill_file: Path, *, is_scout: bool) -> str:
+ """Read the optional `scout-display-name` frontmatter value — the label the scout ships under.
+
+ A scout's skill name is a slug, and a slug sentence-cased at render time gets acronyms wrong:
+ `signals-scout-apm` reads as "Apm", `signals-scout-mcp-tool-calls` as "Mcp tool calls". Rather
+ than grow a table of capitalization fixes somewhere downstream, each canonical scout states its
+ own label here, and it is seeded onto the config's `display_name` where every surface already
+ reads it. Absent means the scout has no name of its own and clients derive one from the slug.
+
+ Only scouts have a config for the name to land on, so the key is rejected on a companion skill.
+ """
+ if "scout-display-name" not in frontmatter:
+ return ""
+ if not is_scout:
+ raise CanonicalSkillParseError(f"Only a signals-scout-* skill may declare 'scout-display-name': {skill_file}")
+ raw = frontmatter["scout-display-name"]
+ if not isinstance(raw, str) or not (display_name := raw.strip()):
+ raise CanonicalSkillParseError(
+ f"SKILL.md frontmatter 'scout-display-name' must be a non-empty string: {skill_file}"
+ )
+ if len(display_name) > SignalScoutConfig.MAX_DISPLAY_NAME_LENGTH:
+ raise CanonicalSkillParseError(
+ f"SKILL.md frontmatter 'scout-display-name' exceeds the "
+ f"{SignalScoutConfig.MAX_DISPLAY_NAME_LENGTH} character limit: {skill_file}"
+ )
+ return display_name
+
+
def _parse_canonical_skill(skill_dir: Path, *, is_scout: bool = True) -> CanonicalSkill:
skill_file = skill_dir / "SKILL.md"
raw = skill_file.read_text(encoding="utf-8")
@@ -293,6 +324,7 @@ def _parse_canonical_skill(skill_dir: Path, *, is_scout: bool = True) -> Canonic
config_tags = _parse_config_tags(frontmatter, skill_file, is_scout=is_scout)
role = _parse_scout_role(frontmatter, skill_file, is_scout=is_scout)
+ display_name = _parse_display_name(frontmatter, skill_file, is_scout=is_scout)
body = raw[match.end() :]
if len(body.encode("utf-8")) > _MAX_SKILL_BODY_BYTES:
@@ -339,6 +371,7 @@ def _parse_canonical_skill(skill_dir: Path, *, is_scout: bool = True) -> Canonic
source_path=skill_dir,
config_tags=config_tags,
role=role,
+ display_name=display_name,
)
@@ -436,6 +469,31 @@ def canonical_config_tags_for(skill_name: str) -> tuple[str, ...]:
return _canonical_config_tags().get(skill_name, ())
+@lru_cache(maxsize=1)
+def _canonical_display_names() -> dict[str, str]:
+ """`scout-display-name` per canonical scout name, for the scouts that declare one.
+
+ Cached for the process like `canonical_skill_names` — the shipped fleet only changes on
+ deploy — and degrades to empty on a malformed canonical rather than failing config
+ registration, which leaves clients deriving a label from the slug as they did before.
+ """
+ try:
+ return {skill.name: skill.display_name for skill in discover_canonical_skills() if skill.display_name}
+ except CanonicalSkillParseError:
+ logger.warning("canonical_display_names: malformed canonical skill on disk; seeding no display names")
+ return {}
+
+
+def canonical_display_name_for(skill_name: str) -> str:
+ """The label the canonical scout of this name ships under, to stamp on its config.
+
+ Empty for a custom scout, and for a canonical scout that states no label. Callers must confirm
+ the name is canonical first — a team's own `signals-scout-*` skill can share a canonical name,
+ and it inherits nothing from disk.
+ """
+ return _canonical_display_names().get(skill_name, "")
+
+
@lru_cache(maxsize=1)
def _canonical_operational_scouts() -> frozenset[str]:
"""Names of the canonical scouts that declare `scout-role: operational`.
@@ -494,9 +552,10 @@ def _compute_canonical_hash(canonical: CanonicalSkill) -> str:
SHA-256 is overkill cryptographically but content-addressable hashes are cheap and we want
no false positives.
- Deliberately excludes `config_tags` and `role`: the hash is compared against
- `_compute_row_hash` over the team's `LLMSkill` row, which stores neither (both shape the
- config instead), so folding them in here would make every seeded row read as diverged forever.
+ Deliberately excludes `config_tags`, `role`, and `display_name`: the hash is compared against
+ `_compute_row_hash` over the team's `LLMSkill` row, which stores none of them (all three shape
+ the config instead), so folding them in here would make every seeded row read as diverged
+ forever.
"""
payload = {
"description": canonical.description,
diff --git a/products/signals/backend/scout_harness/scout_naming.py b/products/signals/backend/scout_harness/scout_naming.py
new file mode 100644
index 000000000000..5b5da95b16ed
--- /dev/null
+++ b/products/signals/backend/scout_harness/scout_naming.py
@@ -0,0 +1,114 @@
+"""Turning a scout's display name into the stable slug that identifies it.
+
+A scout carries two names. `SignalScoutConfig.display_name` is what a person typed and what
+every surface renders; the skill name is the slug, and it is the identity: run history, notes,
+scratchpad memory, report attribution, and deep links are all keyed on it. So the slug is
+generated once, at creation, and never moves again — renaming a scout only rewrites the
+display name.
+
+Generation lives here rather than in the serializer because the create path has to retry it:
+the slug is chosen by reading the names already taken, and a concurrent create can take the
+chosen one between the read and the insert.
+"""
+
+from __future__ import annotations
+
+import re
+import unicodedata
+from secrets import token_hex
+
+from django.utils.text import slugify
+
+from products.signals.backend.models import SignalScoutConfig
+from products.skills.backend.api.skill_services import MAX_SKILL_NAME_LENGTH
+from products.skills.backend.models.skills import LLMSkill
+
+# The slug has to satisfy `validate_skill_name_value`, which allows lowercase letters, digits and
+# single interior hyphens only. Underscores survive Django's `slugify`, so they are folded to
+# hyphens before it runs rather than stripped after, which would join the words either side.
+_UNDERSCORES = re.compile(r"_+")
+_HYPHEN_RUNS = re.compile(r"-{2,}")
+
+# Tried in order before falling back to a random slug. A team holds a couple of dozen scouts, so
+# a name colliding ten deep means something other than ordinary duplicate naming.
+_MAX_COLLISION_SUFFIX = 10
+
+# How many times a create may re-allocate after a concurrent create takes the slug it picked.
+# One per deterministic candidate (the base plus every suffix), and one more for the random
+# fallback the allocator returns once they are all spoken for. Sized from the candidate list
+# rather than picked, because a budget shorter than the list answers 409 while free names remain:
+# each lost race retires one candidate, so a request can only exhaust the list by losing every
+# one of them. The last attempt cannot lose, since the fallback slug is random.
+SLUG_ALLOCATION_ATTEMPTS = _MAX_COLLISION_SUFFIX + 1
+
+# Stem for the fallback slug, used when a display name survives slugification with nothing left
+# (all punctuation, or a script `slugify` transliterates away) or when the suffix search is
+# exhausted. The hex tail makes it unique on its own, so it needs no collision pass.
+_FALLBACK_SLUG_PREFIX = "scout"
+
+
+def slugify_scout_name(display_name: str) -> str:
+ """The slug a display name reduces to, or `""` when nothing usable survives.
+
+ Callers decide what empty means; both current ones fall back to `fallback_scout_slug`, so a
+ name written in a script that does not transliterate still produces a usable scout.
+ """
+ folded = _UNDERSCORES.sub("-", unicodedata.normalize("NFKD", display_name))
+ slug = _HYPHEN_RUNS.sub("-", slugify(folded)).strip("-")
+ return _truncate_slug(slug, MAX_SKILL_NAME_LENGTH)
+
+
+def fallback_scout_slug() -> str:
+ """A valid slug for a display name that reduces to nothing."""
+ return f"{_FALLBACK_SLUG_PREFIX}-{token_hex(4)}"
+
+
+def allocate_scout_slug(*, team_id: int, display_name: str, taken: set[str] | None = None) -> str:
+ """A slug for `display_name` that no scout on this team holds yet.
+
+ Duplicate display names are allowed, so the collision pass is the normal path, not an error
+ case: a second "Checkout failures" becomes `checkout-failures-2`. Both name spaces are
+ checked, because a scout needs a free skill name and a free config row under it.
+
+ `taken` adds names this caller has already tried and lost — the create path passes the slugs
+ a concurrent create won from under it, so a retry does not re-pick one of them.
+
+ Best-effort, like every read-then-insert: the caller still has to handle losing the race.
+ """
+ base = slugify_scout_name(display_name)
+ if not base:
+ return fallback_scout_slug()
+ candidates = _slug_candidates(base)
+ # Matched against the exact candidates rather than a `startswith(base)` prefix, because a name
+ # that fills the length cap has its base cut back to make room for the suffix: the candidate
+ # after a 64-character `base` is `base[:62]-2`, which the prefix would not have found. Missing
+ # it hands back a slug another scout already holds.
+ reserved = set(taken or ())
+ reserved |= set(
+ LLMSkill.objects.filter(team_id=team_id, deleted=False, name__in=candidates).values_list("name", flat=True)
+ )
+ reserved |= set(
+ SignalScoutConfig.objects.for_team(team_id)
+ .filter(skill_name__in=candidates)
+ .values_list("skill_name", flat=True)
+ )
+ return next((candidate for candidate in candidates if candidate not in reserved), fallback_scout_slug())
+
+
+def _slug_candidates(base: str) -> list[str]:
+ """`base`, then its numbered variants, in the order a caller should prefer them.
+
+ The base is cut back by the width of the suffix it carries, so every candidate fits the skill
+ name cap. Deduped because that cut makes two suffixes collide on a long enough base only if the
+ suffix widths differ, and a duplicate candidate would otherwise waste an allocation attempt.
+ """
+ candidates = [_truncate_slug(base, MAX_SKILL_NAME_LENGTH)]
+ for suffix in range(2, _MAX_COLLISION_SUFFIX + 1):
+ tail = f"-{suffix}"
+ candidates.append(f"{_truncate_slug(base, MAX_SKILL_NAME_LENGTH - len(tail))}{tail}")
+ return list(dict.fromkeys(candidates))
+
+
+def _truncate_slug(slug: str, limit: int) -> str:
+ """`slug` cut to `limit` characters, without leaving the trailing hyphen the cut can expose."""
+ return slug[:limit].rstrip("-")
diff --git a/products/signals/backend/scout_harness/serializers.py b/products/signals/backend/scout_harness/serializers.py
index 2732ee09bac0..6419e9e2f832 100644
--- a/products/signals/backend/scout_harness/serializers.py
+++ b/products/signals/backend/scout_harness/serializers.py
@@ -2601,12 +2601,24 @@ class SignalScoutConfigListQuerySerializer(serializers.Serializer):
),
)
+ search = serializers.CharField(
+ required=False,
+ help_text=(
+ "Case-insensitive substring filter over a scout's display name and its skill name. A "
+ "scout matches on either, so a person who knows the label and a caller who knows the "
+ "identifier both find it. Omit for the whole fleet."
+ ),
+ )
+
def validate_tags(self, value: str) -> list[str]:
tags = sorted({slug for raw in value.split(",") if (slug := slugify_tag(raw))})
if not tags:
raise serializers.ValidationError("No usable tags in the filter once normalized to lowercase slugs.")
return tags
+ def validate_search(self, value: str) -> str:
+ return value.strip()
+
@extend_schema_field(OpenApiTypes.OBJECT)
class StructuredOutputSchemaField(serializers.JSONField):
@@ -3170,9 +3182,28 @@ class _ScoutConfigCapabilityFieldsMixin(serializers.Serializer):
return _validate_write_scopes(value)
+def _display_name_field() -> serializers.CharField:
+ """The scout's label, as written. Separate from the skill name, which stays its identity."""
+ return serializers.CharField(
+ required=False,
+ allow_blank=True,
+ trim_whitespace=True,
+ max_length=SignalScoutConfig.MAX_DISPLAY_NAME_LENGTH,
+ help_text=(
+ "Name shown wherever people identify this scout, written however you want it — spaces, "
+ "capitalization, and acronyms are kept as typed, and two scouts may share one. It does "
+ "not change the scout's skill name, which stays its identity, so renaming a scout keeps "
+ "its schedule, run history, notes, memory, and links. At most "
+ f"{SignalScoutConfig.MAX_DISPLAY_NAME_LENGTH} characters; blank means the scout has no "
+ "name of its own and is labelled from its skill name instead."
+ ),
+ )
+
+
class SignalScoutConfigUpdateSerializer(_ScoutConfigCapabilityFieldsMixin, serializers.ModelSerializer):
"""Editable display name, schedule, enablement, and emit posture for one scout config."""
+ display_name = _display_name_field()
enabled = serializers.BooleanField(
required=False,
help_text=(
@@ -3392,6 +3423,7 @@ class SignalScoutConfigCreateSerializer(SignalScoutConfigOptionsSerializer):
registered the row, the provided tunables are applied to it instead.
"""
+ display_name = _display_name_field()
skill_name = serializers.CharField(
max_length=200,
help_text=(
@@ -3415,11 +3447,17 @@ class SignalScoutConfigCreateSerializer(SignalScoutConfigOptionsSerializer):
class SignalScoutCreateSerializer(serializers.Serializer):
"""Create a runnable custom scout and its config in one atomic request."""
+ display_name = _display_name_field()
name = serializers.CharField(
+ required=False,
max_length=64,
help_text=(
- "Unique scout name, containing only lowercase letters, numbers, and hyphens. The "
- "`signals-scout-` prefix is optional."
+ "Optional skill name for the scout — its permanent identifier, containing only "
+ "lowercase letters, numbers, and hyphens. Omit it and one is generated from "
+ "`display_name` (`My APM scout` becomes `my-apm-scout`), with a numeric suffix when "
+ "that name is taken. Pass it to pick the identifier yourself, or to keep a client "
+ "written before display names working unchanged. The `signals-scout-` prefix is "
+ "optional."
),
)
description = serializers.CharField(
@@ -3460,6 +3498,14 @@ class SignalScoutCreateSerializer(serializers.Serializer):
raise serializers.ValidationError(error)
return value
+ def validate(self, attrs: dict[str, Any]) -> dict[str, Any]:
+ # One of the two has to say what the scout is called. `name` alone is the pre-display-name
+ # client; `display_name` alone is the modern one, and the slug is derived from it. The
+ # error names `display_name` because that is the field a person fills in.
+ if not attrs.get("name") and not attrs.get("display_name"):
+ raise serializers.ValidationError({"display_name": "Give the scout a name."})
+ return attrs
+
def validate_body(self, value: str) -> str:
return validate_skill_body_size(value)
diff --git a/products/signals/backend/scout_harness/views.py b/products/signals/backend/scout_harness/views.py
index dad15c930490..db18fd2ada57 100644
--- a/products/signals/backend/scout_harness/views.py
+++ b/products/signals/backend/scout_harness/views.py
@@ -26,6 +26,8 @@ from dataclasses import dataclass
from typing import Any, cast
from django.db import transaction
+from django.db.models import Q, Value
+from django.db.models.functions import Coalesce, Lower, NullIf
import structlog
from drf_spectacular.types import OpenApiTypes
@@ -85,6 +87,7 @@ from products.signals.backend.scout_harness.run_gates import (
check_spend_gates,
)
from products.signals.backend.scout_harness.scout_costs import SCOUT_COST_WINDOW_DAYS, scout_costs
+from products.signals.backend.scout_harness.scout_naming import SLUG_ALLOCATION_ATTEMPTS, allocate_scout_slug
from products.signals.backend.scout_harness.serializers import (
REPOSITORIES_REACHABILITY_CHECKED_CONTEXT_KEY,
EditReportRequestSerializer,
@@ -1961,6 +1964,7 @@ def create_scout_for_source(
team: Team,
user: User,
name: str,
+ display_name: str = "",
description: str,
body: str,
files: list[Any],
@@ -1980,6 +1984,11 @@ def create_scout_for_source(
Creating a scout creates an `LLMSkill` carrying the report-channel agent tools, so the caller
clears the skill-authoring bar here whatever route they came in by. A product that owns the
object checks its own access on top; it cannot stand in for this one.
+
+ `name` is the scout's permanent identity; `display_name` is the label, and it is the only one
+ of the two a rename ever touches. A caller that has a display name and no identity in mind
+ should go through `create_scout_with_generated_slug`, which derives one and handles the
+ collision case this function cannot see.
"""
if not UserAccessControl(user=user, team=team).check_access_level_for_resource("llm_skill", "editor"):
raise exceptions.PermissionDenied("Creating a scout requires editor access to skills.")
@@ -2013,6 +2022,10 @@ def create_scout_for_source(
skill_created = False
tunables = dict(config_options)
+ if display_name:
+ # Only when one was given: the upsert applies every tunable to a row that already
+ # exists, and a blank would clear a label the existing scout was renamed to.
+ tunables["display_name"] = display_name
if "write_scopes" in tunables:
# Creating the scout in this request makes the requester its author, which is who its
# runs act as. Reusing an existing name adopts someone else's scout and its config, so
@@ -2062,6 +2075,48 @@ def create_scout_for_source(
return ScoutCreationOutcome(skill=skill, config=config, created=skill_created or config_created)
+def create_scout_with_generated_slug(
+ *,
+ team: Team,
+ user: User,
+ display_name: str,
+ **kwargs: Any,
+) -> ScoutCreationOutcome:
+ """Create a scout under a slug derived from `display_name`, retrying when the slug is taken.
+
+ `allocate_scout_slug` picks a free slug by reading the names already in use, so a create that
+ lands between that read and the insert takes the chosen slug out from under this one. The loop
+ is what makes two concurrent creates of "Checkout failures" resolve to `checkout-failures` and
+ `checkout-failures-2` instead of one of them failing: each attempt re-allocates, holding back
+ the slugs it already lost so it cannot pick one of them twice.
+
+ Retrying is only correct for a generated slug, which is why it lives here rather than in
+ `create_scout_for_source`: a caller that named the scout itself gets the conflict, because
+ quietly storing a different identifier than the one it asked for would be worse. Each attempt
+ opens its own transaction, so a failed insert is rolled back before the next one starts.
+
+ One case the loop deliberately does not retry: the request loses the race to a create whose
+ definition matches byte for byte, and `create_scout_for_source` adopts that scout and answers
+ 200 rather than suffixing past it. Only a concurrent double-submit reaches that — a later
+ repeat never does, because allocation has already moved on to the next free suffix — and
+ sharing one scout beats leaving a duplicate behind a request the client sent twice.
+
+ So a generated name is not the idempotent route an explicit `name` is: repeating the same
+ display name and body makes a second scout. That follows from generating the identity, since
+ nothing in a repeated request says which earlier scout it meant.
+ """
+ lost: set[str] = set()
+ for attempt in range(SLUG_ALLOCATION_ATTEMPTS):
+ name = allocate_scout_slug(team_id=team.id, display_name=display_name, taken=lost)
+ try:
+ return create_scout_for_source(team=team, user=user, name=name, display_name=display_name, **kwargs)
+ except (Conflict, LLMSkillDuplicateNameConflictError):
+ if attempt == SLUG_ALLOCATION_ATTEMPTS - 1:
+ raise
+ lost.add(name)
+ raise AssertionError("unreachable: the last attempt either returns or re-raises")
+
+
def _skill_matches_scout_definition(
skill: LLMSkill,
*,
@@ -2306,12 +2361,15 @@ class SignalScoutViewSet(TeamAndOrgViewSetMixin, viewsets.GenericViewSet):
},
summary="Create a scout",
description=(
- "Create a scout skill and its runnable config atomically. Any valid skill name works — the "
- "config row is what makes the skill a scout. The skill always receives the "
- "report-channel tools. The optional config controls schedule, enablement, dry-run posture, network "
- "access, and typed destinations such as Slack. Repeating the same definition is safe and applies any "
- "supplied config fields; "
- "reusing its name for a different definition returns 409."
+ "Create a scout skill and its runnable config atomically. Give it a `display_name` — the "
+ "label people read, kept exactly as written — and the scout's permanent skill name is "
+ "generated from it, with a numeric suffix when that name is taken, so two scouts may "
+ "share a label without sharing an identity. Pass `name` instead to pick that identifier "
+ "yourself; any valid skill name works, since the config row is what makes a skill a "
+ "scout. The skill always receives the report-channel tools. The optional config controls "
+ "schedule, enablement, dry-run posture, network access, and typed destinations such as "
+ "Slack. Repeating the same definition is safe and applies any supplied config fields; "
+ "reusing an explicit `name` for a different definition returns 409."
),
operation_id="signals_scout_create",
include_serializer_context=True,
@@ -2324,16 +2382,24 @@ class SignalScoutViewSet(TeamAndOrgViewSetMixin, viewsets.GenericViewSet):
# No source here: this endpoint cannot check the caller's access to another product's object,
# so a scout created through it records no owner. A product that stands scouts up for its own
# objects calls `create_scout_for_source` after making that check itself.
- outcome = create_scout_for_source(
- team=canonical_team,
- user=user,
- name=validated["name"],
- description=validated["description"],
- body=validated["body"],
- files=validated.get("files", []),
- config_options=validated.get("config", {}),
- request=request,
- serializer_context={**self.get_serializer_context(), "project_id": self.team.project_id},
+ definition = {
+ "team": canonical_team,
+ "user": user,
+ "display_name": validated.get("display_name", ""),
+ "description": validated["description"],
+ "body": validated["body"],
+ "files": validated.get("files", []),
+ "config_options": validated.get("config", {}),
+ "request": request,
+ "serializer_context": {**self.get_serializer_context(), "project_id": self.team.project_id},
+ }
+ # A caller that named the scout keeps that name, conflict and all. One that only gave a
+ # display name has no identifier to be held to, so the slug is derived and re-derived until
+ # it lands.
+ outcome = (
+ create_scout_for_source(name=validated["name"], **definition)
+ if validated.get("name")
+ else create_scout_with_generated_slug(**definition)
)
# Hides the suggestion the moment its scout exists, rather than waiting for the read to
# notice the name is taken — which it only does for enabled scouts and custom drafts.
@@ -2343,7 +2409,7 @@ class SignalScoutViewSet(TeamAndOrgViewSetMixin, viewsets.GenericViewSet):
if suggestion_id := validated.get("suggestion_id"):
try:
record = find_suggestion(canonical_team.id, suggestion_id)
- if record is not None and record.get("skill_name") == validated["name"]:
+ if record is not None and record.get("skill_name") == outcome.skill.name:
mark_suggestion_created(canonical_team.id, suggestion_id, config_id=str(outcome.config.id))
except Exception:
logger.warning(
@@ -2354,7 +2420,7 @@ class SignalScoutViewSet(TeamAndOrgViewSetMixin, viewsets.GenericViewSet):
)
response = SignalScoutCreateResponseSerializer(
{"created": outcome.created, "skill": outcome.skill, "config": outcome.config},
- context=scout_config_context(canonical_team, [validated["name"]], request),
+ context=scout_config_context(canonical_team, [outcome.skill.name], request),
)
return Response(
response.data,
@@ -2449,16 +2515,18 @@ class SignalScoutConfigViewSet(TeamAndOrgViewSetMixin, viewsets.GenericViewSet):
responses={
200: OpenApiResponse(
response=SignalScoutConfigSerializer(many=True),
- description="Per-scout configs for this project, ordered by skill name.",
+ description="Per-scout configs for this project, ordered by the name each scout displays under.",
),
},
summary="List scout configs",
description=(
- "List the per-(team, skill) scout configs for this project. Each row includes its schedule "
- "(rolling `run_interval_minutes`, or a project-local `run_cron_schedule` when set), `enabled`, "
- "`emit` posture, and `tags`. A freshly authored scout skill appears here once its config is "
- "registered, either explicitly via create or by the coordinator's next tick. Pass `tags` to "
- "narrow the fleet to the scouts carrying at least one of the given labels."
+ "List the per-(team, skill) scout configs for this project. Each row includes its "
+ "`display_name` (the label people read), its `skill_name` (the permanent identifier), its "
+ "schedule (rolling `run_interval_minutes`, or a project-local `run_cron_schedule` when "
+ "set), `enabled`, `emit` posture, and `tags`. A freshly authored scout skill appears here "
+ "once its config is registered, either explicitly via create or by the coordinator's next "
+ "tick. Pass `tags` to narrow the fleet to the scouts carrying at least one of the given "
+ "labels, and `search` to narrow it to the scouts matching a substring of either name."
),
operation_id="signals_scout_config_list",
)
@@ -2474,10 +2542,19 @@ class SignalScoutConfigViewSet(TeamAndOrgViewSetMixin, viewsets.GenericViewSet):
# Any-of, matching how the fleet UI's tag picker reads. `&&` over the array column rather
# than a join table or a GIN index: the team filter already bounds this to the handful of
# scouts an org is allowed to create, so there is nothing left for an index to save.
- tags = (getattr(request, "validated_query_data", None) or {}).get("tags")
+ query = getattr(request, "validated_query_data", None) or {}
+ tags = query.get("tags")
if tags:
queryset = queryset.filter(tags__overlap=tags)
- configs = list(queryset.order_by("skill_name"))
+ # Either name matches, because the two audiences know the scout by different ones: a person
+ # types the label they see, a caller holding a stored identifier types the slug.
+ if search := query.get("search"):
+ queryset = queryset.filter(Q(display_name__icontains=search) | Q(skill_name__icontains=search))
+ # Ordered by the label the reader sees rather than by the identifier, which no surface shows
+ # first. A scout with no name of its own falls back to its slug, which is close enough to the
+ # label the clients derive from it to keep the two kinds interleaved instead of clumping the
+ # unnamed ones at one end.
+ configs = list(queryset.order_by(Lower(Coalesce(NullIf("display_name", Value("")), "skill_name"))))
context = scout_config_context(team, [c.skill_name for c in configs], request)
serializer = SignalScoutConfigSerializer(configs, many=True, context=context)
return Response(serializer.data)
diff --git a/products/signals/backend/test/test_scout_create_api.py b/products/signals/backend/test/test_scout_create_api.py
index dc6a428d2be0..1f7681fdf881 100644
--- a/products/signals/backend/test/test_scout_create_api.py
+++ b/products/signals/backend/test/test_scout_create_api.py
@@ -14,6 +14,7 @@ from posthog.models.user import User
from posthog.models.utils import generate_random_token_personal, hash_key_value
from products.signals.backend.models import SignalScoutConfig
+from products.signals.backend.scout_harness.scout_naming import SLUG_ALLOCATION_ATTEMPTS, _slug_candidates
from products.signals.backend.scout_harness.serializers import SignalScoutCreateSerializer
from products.skills.backend.api.skill_serializers import SPEC_DESCRIPTION_MAX_LENGTH
from products.skills.backend.models.skills import LLMSkill, LLMSkillFile
@@ -327,7 +328,118 @@ class TestSignalScoutCreateAPI(APIBaseTest):
assert not LLMSkill.objects.filter(team=self.team, name=self._payload()["name"], deleted=False).exists()
+class TestSignalScoutCreateDisplayNameAPI(APIBaseTest):
+ def _url(self) -> str:
+ return f"/api/projects/{self.team.id}/signals/scout/"
+
+ def _payload(self, **overrides: object) -> dict:
+ return {
+ "description": "Investigates meaningful checkout_failed spikes.",
+ "body": "# Checkout failure scout\n\nInvestigate the `checkout_failed` signal.",
+ **overrides,
+ }
+
+ def _create(self, **overrides: object):
+ return self.client.post(self._url(), data=self._payload(**overrides), format="json")
+
+ def test_display_name_is_stored_verbatim_under_a_generated_slug(self) -> None:
+ response = self._create(display_name=" My APM scout ")
+
+ assert response.status_code == status.HTTP_201_CREATED
+ body = response.json()
+ assert body["config"]["display_name"] == "My APM scout"
+ assert body["skill"]["name"] == "my-apm-scout"
+ config = SignalScoutConfig.all_teams.get(team=self.team, skill_name="my-apm-scout")
+ assert config.display_name == "My APM scout"
+
+ def test_a_team_holding_every_deterministic_slug_still_gets_its_scout(self) -> None:
+ # The fallback path end to end: with the base and all nine suffixes held, the allocator has
+ # only its random slug left, and the create still has to land. The retry budget that gets a
+ # request there after losing each candidate to a concurrent create is the sibling test —
+ # here the allocator returns the fallback on the first attempt.
+ for name in _slug_candidates("checkout-failures"):
+ SignalScoutConfig.objects.create(team=self.team, skill_name=name)
+ LLMSkill.objects.create(team=self.team, name=name, description="taken", body="taken")
+
+ response = self._create(display_name="Checkout failures")
+
+ assert response.status_code == status.HTTP_201_CREATED, response.json()
+ assert response.json()["config"]["display_name"] == "Checkout failures"
+ assert response.json()["skill"]["name"].startswith("scout-")
+
+ def test_the_retry_budget_outlasts_the_candidate_list(self) -> None:
+ # The two used to be separate numbers and drifted apart. Reading one from the other is what
+ # this guards: raising the suffix ceiling without the budget reintroduces the 409 above.
+ assert SLUG_ALLOCATION_ATTEMPTS > len(_slug_candidates("checkout-failures"))
+
+ def test_a_second_scout_of_the_same_name_gets_its_own_identity(self) -> None:
+ # Duplicate labels are allowed, so the slug is what has to stay unique. The first scout's
+ # skill, config, and body must be untouched — attaching to it would silently hand the
+ # second author someone else's scout.
+ first = self._create(display_name="Checkout failures")
+ second = self._create(display_name="Checkout failures", body="# A different scout\n\nWatch refunds.")
+
+ assert first.status_code == status.HTTP_201_CREATED
+ assert second.status_code == status.HTTP_201_CREATED
+ assert first.json()["skill"]["name"] == "checkout-failures"
+ assert second.json()["skill"]["name"] == "checkout-failures-2"
+ assert second.json()["config"]["display_name"] == "Checkout failures"
+ assert (
+ LLMSkill.objects.get(team=self.team, name="checkout-failures", is_latest=True).body
+ == (self._payload()["body"])
+ )
+
+ def test_repeating_a_whole_definition_still_mints_a_second_scout(self) -> None:
+ # A generated identity cannot be recovered from the display name, so this route is not the
+ # idempotent one an explicit `name` gets: the repeat allocates past the slug it already
+ # took. Worth pinning, because the sibling create endpoint answers 200 for the same body
+ # and a reader is entitled to expect the same here.
+ first = self._create(display_name="Checkout failures")
+ second = self._create(display_name="Checkout failures")
+
+ assert first.status_code == status.HTTP_201_CREATED
+ assert second.status_code == status.HTTP_201_CREATED
+ assert [first.json()["skill"]["name"], second.json()["skill"]["name"]] == [
+ "checkout-failures",
+ "checkout-failures-2",
+ ]
+ assert SignalScoutConfig.all_teams.filter(team=self.team, display_name="Checkout failures").count() == 2
+
+ def test_a_name_that_slugifies_to_nothing_still_creates_a_scout(self) -> None:
+ # A name in a script that does not transliterate leaves no slug to derive. Falling back to
+ # a generated one keeps the scout creatable under the name its author wrote.
+ response = self._create(display_name="監視")
+
+ assert response.status_code == status.HTTP_201_CREATED
+ assert response.json()["config"]["display_name"] == "監視"
+ assert response.json()["skill"]["name"].startswith("scout-")
+
+ def test_an_explicit_name_is_kept_alongside_the_display_name(self) -> None:
+ # The identifier a caller picks is the one it gets, so a client that stored the name
+ # before display names existed keeps working, display name or not.
+ response = self._create(name="signals-scout-checkout-failures", display_name="Checkout failures")
+
+ assert response.status_code == status.HTTP_201_CREATED
+ assert response.json()["skill"]["name"] == "signals-scout-checkout-failures"
+ assert response.json()["config"]["display_name"] == "Checkout failures"
+
+
class TestSignalScoutCreateSerializerValidation(SimpleTestCase):
+ @parameterized.expand(
+ [
+ ("neither name is given", {}, False),
+ ("the display name is blank", {"display_name": " "}, False),
+ ("a display name alone", {"display_name": "My APM scout"}, True),
+ ("a skill name alone", {"name": "signals-scout-checkout-failures"}, True),
+ ]
+ )
+ def test_a_scout_must_be_called_something(self, _name: str, names: dict, expected_valid: bool) -> None:
+ serializer = SignalScoutCreateSerializer(data={"description": "Watches checkout.", "body": "# Body", **names})
+
+ assert serializer.is_valid() is expected_valid
+ if not expected_valid:
+ assert "display_name" in serializer.errors
+
@parameterized.expand(
[
("over the spec cap is rejected", SPEC_DESCRIPTION_MAX_LENGTH + 1, False),
diff --git a/products/signals/backend/test/test_scout_harness_api.py b/products/signals/backend/test/test_scout_harness_api.py
index 69813d77a2e8..32e6fcddf139 100644
--- a/products/signals/backend/test/test_scout_harness_api.py
+++ b/products/signals/backend/test/test_scout_harness_api.py
@@ -2450,6 +2450,38 @@ class TestScoutHarnessConfigAPI(APIBaseTest):
assert body[0]["emit"] is True
assert body[0]["run_interval_minutes"] == 1440
+ def test_list_orders_by_the_name_each_scout_displays_under(self) -> None:
+ # A renamed scout has to sort where the reader sees it, not where its slug puts it —
+ # ordering by the identifier files "Alpha" under S for `signals-scout-zeta`.
+ SignalScoutConfig.objects.create(team=self.team, skill_name="signals-scout-zeta", display_name="Alpha watch")
+ SignalScoutConfig.objects.create(team=self.team, skill_name="signals-scout-beta")
+
+ response = self.client.get(self._list_url())
+
+ assert response.status_code == status.HTTP_200_OK
+ assert [c["skill_name"] for c in response.json()] == ["signals-scout-zeta", "signals-scout-beta"]
+
+ @parameterized.expand(
+ [
+ ("by display name", "checkout", ["signals-scout-zeta"]),
+ ("by skill name", "beta", ["signals-scout-beta"]),
+ ("case-insensitively", "CHECKOUT", ["signals-scout-zeta"]),
+ ("matching neither", "nothing here", []),
+ ]
+ )
+ def test_list_search_matches_either_name(self, _name: str, search: str, expected: list[str]) -> None:
+ # The two audiences know a scout by different names: a person types the label, a stored
+ # client types the identifier. Matching only one leaves the other unable to find it.
+ SignalScoutConfig.objects.create(
+ team=self.team, skill_name="signals-scout-zeta", display_name="Checkout failures"
+ )
+ SignalScoutConfig.objects.create(team=self.team, skill_name="signals-scout-beta")
+
+ response = self.client.get(self._list_url(), data={"search": search})
+
+ assert response.status_code == status.HTTP_200_OK
+ assert [c["skill_name"] for c in response.json()] == expected
+
def test_list_excludes_withheld_config(self) -> None:
# A held-back scout that still has a row (previously seeded, then withheld) is not surfaced
# in the config list — the read surface stays consistent with the seeding + dispatch gates.
diff --git a/products/signals/backend/test/test_scout_harness_lazy_seed.py b/products/signals/backend/test/test_scout_harness_lazy_seed.py
index 3cb9154f08ce..5757b042213b 100644
--- a/products/signals/backend/test/test_scout_harness_lazy_seed.py
+++ b/products/signals/backend/test/test_scout_harness_lazy_seed.py
@@ -315,6 +315,47 @@ class TestDiscoverCanonicalSkills:
with pytest.raises(CanonicalSkillParseError, match="Only a signals-scout-\\* skill may declare 'scout-tags'"):
discover_canonical_skills(tmp_path)
+ @pytest.mark.parametrize(
+ "display_name_yaml,expected",
+ [
+ ("scout-display-name: MCP tool calls", "MCP tool calls"),
+ ("scout-display-name: ' APM '", "APM"),
+ ("", ""),
+ ],
+ )
+ def test_parses_scout_display_name(self, tmp_path: Path, display_name_yaml: str, expected: str) -> None:
+ # The label is how a canonical scout avoids reading as "Mcp tool calls", so a dropped key
+ # silently hands every surface the sentence-cased slug again.
+ _write_canonical_skill(
+ tmp_path,
+ dir_name="signals-scout-bar",
+ frontmatter=f"---\nname: signals-scout-bar\ndescription: bar skill\n{display_name_yaml}\n---\n",
+ body="# Bar\n",
+ )
+ assert discover_canonical_skills(tmp_path)[0].display_name == expected
+
+ @pytest.mark.parametrize(
+ "dir_name,display_name_yaml,expected_error",
+ [
+ ("signals-scout-bar", "scout-display-name: ''", "must be a non-empty string"),
+ ("signals-scout-bar", "scout-display-name:", "must be a non-empty string"),
+ ("signals-scout-bar", f"scout-display-name: {'a' * 201}", "character limit"),
+ ("authoring-scouts", "scout-display-name: Authoring", "Only a signals-scout-\\* skill may declare"),
+ ],
+ )
+ def test_rejects_malformed_scout_display_name(
+ self, tmp_path: Path, dir_name: str, display_name_yaml: str, expected_error: str
+ ) -> None:
+ name = dir_name if dir_name == "authoring-scouts" else "signals-scout-bar"
+ _write_canonical_skill(
+ tmp_path,
+ dir_name=dir_name,
+ frontmatter=f"---\nname: {name}\ndescription: bar skill\n{display_name_yaml}\n---\n",
+ body="# Bar\n",
+ )
+ with pytest.raises(CanonicalSkillParseError, match=expected_error):
+ discover_canonical_skills(tmp_path)
+
def test_parses_scout_role(self, tmp_path: Path) -> None:
_write_canonical_skill(
tmp_path,
@@ -1080,3 +1121,28 @@ class TestSeedCanonicalSkillsAlias(BaseTest):
assert tagged.tag_list == ["ai-observability"]
untagged = SignalScoutConfig.all_teams.get(team=self.team, skill_name="signals-scout-general")
assert untagged.tag_list == []
+
+ def test_real_fleet_display_names_land_on_the_seeded_config(self) -> None:
+ # The acronyms are the whole point of the frontmatter key: a slug sentence-cased at render
+ # time reads as "Apm" and "Mcp tool calls", which is what this stops.
+ seed_canonical_skills(self.team)
+ register_missing_configs(self.team.id)
+
+ named = SignalScoutConfig.all_teams.filter(team=self.team).values_list("skill_name", "display_name")
+ assert dict(named)["signals-scout-apm"] == "APM"
+ assert dict(named)["signals-scout-mcp-tool-calls"] == "MCP tool calls"
+ assert all(display_name for _, display_name in named)
+
+ def test_reconcile_names_a_row_seeded_before_the_label_existed_but_never_a_rename(self) -> None:
+ # Every canonical config predates the frontmatter key, so the backfill is the only way they
+ # acquire a label — and it runs on every tick, so it must lose to a person's rename forever.
+ seed_canonical_skills(self.team)
+ register_missing_configs(self.team.id)
+ configs = SignalScoutConfig.all_teams.filter(team=self.team)
+ configs.filter(skill_name="signals-scout-apm").update(display_name="")
+ configs.filter(skill_name="signals-scout-mcp-tool-calls").update(display_name="Our MCP watch")
+
+ register_missing_configs(self.team.id)
+
+ assert configs.get(skill_name="signals-scout-apm").display_name == "APM"
+ assert configs.get(skill_name="signals-scout-mcp-tool-calls").display_name == "Our MCP watch"
diff --git a/products/signals/backend/test/test_scout_naming.py b/products/signals/backend/test/test_scout_naming.py
new file mode 100644
index 000000000000..a83f08cb034b
--- /dev/null
+++ b/products/signals/backend/test/test_scout_naming.py
@@ -0,0 +1,99 @@
+from posthog.test.base import BaseTest
+
+from django.test import SimpleTestCase
+
+from parameterized import parameterized
+
+from posthog.models.team.team import Team
+
+from products.signals.backend.models import SignalScoutConfig
+from products.signals.backend.scout_harness.scout_naming import (
+ _slug_candidates,
+ allocate_scout_slug,
+ fallback_scout_slug,
+ slugify_scout_name,
+)
+from products.skills.backend.api.skill_serializers import validate_skill_name_value
+from products.skills.backend.api.skill_services import MAX_SKILL_NAME_LENGTH
+from products.skills.backend.models.skills import LLMSkill
+
+
+class TestSlugifyScoutName(SimpleTestCase):
+ @parameterized.expand(
+ [
+ ("spaces and acronyms", "My APM scout", "my-apm-scout"),
+ ("punctuation between words", "Checkout / daily digest", "checkout-daily-digest"),
+ ("underscores are word separators", "checkout_failed watch", "checkout-failed-watch"),
+ ("accents transliterate", "Café latency", "cafe-latency"),
+ ("surrounding whitespace", " Checkout failures ", "checkout-failures"),
+ ("leading and trailing punctuation", "-- Checkout! --", "checkout"),
+ ("punctuation only", "!!! ???", ""),
+ ("script that does not transliterate", "監視", ""),
+ ]
+ )
+ def test_slug_for(self, _name: str, display_name: str, expected: str) -> None:
+ assert slugify_scout_name(display_name) == expected
+
+ @parameterized.expand(
+ [
+ ("an ordinary name", "My APM scout"),
+ ("a name far past the cap", "Checkout failures " * 20),
+ ("a name whose cut lands on a word boundary", "a" * (MAX_SKILL_NAME_LENGTH - 1) + " tail"),
+ ]
+ )
+ def test_slug_is_a_usable_skill_name(self, _name: str, display_name: str) -> None:
+ # Every slug is stored as an LLMSkill name, so one the skill contract refuses is a create
+ # that fails on a name the user never chose — a trailing hyphen left by the length cut is
+ # the way that happens.
+ validate_skill_name_value(slugify_scout_name(display_name))
+
+ def test_fallback_slug_is_a_usable_skill_name(self) -> None:
+ validate_skill_name_value(fallback_scout_slug())
+
+
+class TestAllocateScoutSlug(BaseTest):
+ def _allocate(self, display_name: str) -> str:
+ return allocate_scout_slug(team_id=self.team.id, display_name=display_name)
+
+ def test_suffixes_past_every_slug_the_team_already_holds(self) -> None:
+ LLMSkill.objects.create(team=self.team, name="checkout-failures", description="d", body="b")
+ SignalScoutConfig.objects.create(team=self.team, skill_name="checkout-failures-2")
+
+ assert self._allocate("Checkout failures") == "checkout-failures-3"
+
+ def test_finds_a_suffixed_slug_whose_base_was_cut_to_fit(self) -> None:
+ # A base that fills the name cap loses its last characters to make room for the suffix, so
+ # the taken slug does not start with the base. Matching on the base as a prefix misses it
+ # and hands back a name another scout already holds.
+ display_name = "a" * MAX_SKILL_NAME_LENGTH
+ taken = f"{'a' * (MAX_SKILL_NAME_LENGTH - 2)}-2"
+ SignalScoutConfig.objects.create(team=self.team, skill_name="a" * MAX_SKILL_NAME_LENGTH)
+ SignalScoutConfig.objects.create(team=self.team, skill_name=taken)
+
+ allocated = self._allocate(display_name)
+
+ assert allocated != taken
+ validate_skill_name_value(allocated)
+
+ def test_falls_back_once_the_suffixes_run_out(self) -> None:
+ # A generated slug is never reported as free when it is taken, however many are: the
+ # caller creates under whatever comes back, so a wrong answer attaches to another scout.
+ for name in _slug_candidates("checkout-failures"):
+ SignalScoutConfig.objects.create(team=self.team, skill_name=name)
+
+ allocated = self._allocate("Checkout failures")
+
+ assert allocated.startswith("scout-")
+ validate_skill_name_value(allocated)
+
+ def test_holds_back_the_slugs_a_concurrent_create_already_won(self) -> None:
+ assert (
+ allocate_scout_slug(team_id=self.team.id, display_name="Checkout failures", taken={"checkout-failures"})
+ == "checkout-failures-2"
+ )
+
+ def test_another_teams_slug_is_not_reserved(self) -> None:
+ other = Team.objects.create(organization=self.organization, name="other")
+ SignalScoutConfig.objects.create(team=other, skill_name="checkout-failures")
+
+ assert self._allocate("Checkout failures") == "checkout-failures"
diff --git a/products/signals/frontend/generated/api.schemas.ts b/products/signals/frontend/generated/api.schemas.ts
index f0072a433da6..16aeeded0a93 100644
--- a/products/signals/frontend/generated/api.schemas.ts
+++ b/products/signals/frontend/generated/api.schemas.ts
@@ -2737,10 +2737,15 @@ export interface SignalScoutConfigOptionsApi {
*/
export interface SignalScoutCreateApi {
/**
- * Unique scout name, containing only lowercase letters, numbers, and hyphens. The `signals-scout-` prefix is optional.
+ * Name shown wherever people identify this scout, written however you want it — spaces, capitalization, and acronyms are kept as typed, and two scouts may share one. It does not change the scout's skill name, which stays its identity, so renaming a scout keeps its schedule, run history, notes, memory, and links. At most 200 characters; blank means the scout has no name of its own and is labelled from its skill name instead.
+ * @maxLength 200
+ */
+ display_name?: string
+ /**
+ * Optional skill name for the scout — its permanent identifier, containing only lowercase letters, numbers, and hyphens. Omit it and one is generated from `display_name` (`My APM scout` becomes `my-apm-scout`), with a numeric suffix when that name is taken. Pass it to pick the identifier yourself, or to keep a client written before display names working unchanged. The `signals-scout-` prefix is optional.
* @maxLength 64
*/
- name: string
+ name?: string
/**
* Short description of the signal or behavior this scout investigates.
* @maxLength 1024
@@ -3101,6 +3106,11 @@ export interface SignalScoutConfigCreateApi {
* @nullable
*/
run_cron_schedule?: string | null
+ /**
+ * Name shown wherever people identify this scout, written however you want it — spaces, capitalization, and acronyms are kept as typed, and two scouts may share one. It does not change the scout's skill name, which stays its identity, so renaming a scout keeps its schedule, run history, notes, memory, and links. At most 200 characters; blank means the scout has no name of its own and is labelled from its skill name instead.
+ * @maxLength 200
+ */
+ display_name?: string
/**
* The skill to register a config for. Any valid skill name works — the config row is what makes a skill a scout. The skill must already exist on this project — author it via the skills store first.
* @maxLength 200
@@ -3151,7 +3161,7 @@ export interface SignalScoutOutputDestinationsUpdateApi {
*/
export interface PatchedSignalScoutConfigUpdateApi {
/**
- * Name shown in the UI. Does not change the skill name. Leave blank to use the default name.
+ * Name shown wherever people identify this scout, written however you want it — spaces, capitalization, and acronyms are kept as typed, and two scouts may share one. It does not change the scout's skill name, which stays its identity, so renaming a scout keeps its schedule, run history, notes, memory, and links. At most 200 characters; blank means the scout has no name of its own and is labelled from its skill name instead.
* @maxLength 200
*/
display_name?: string
@@ -5556,6 +5566,11 @@ export type SignalsReportsPrCiStatusesParams = {
}
export type SignalsScoutConfigListParams = {
+ /**
+ * Case-insensitive substring filter over a scout's display name and its skill name. A scout matches on either, so a person who knows the label and a caller who knows the identifier both find it. Omit for the whole fleet.
+ * @minLength 1
+ */
+ search?: string
/**
* Comma-separated tags, e.g. `revenue,on-call`. Returns the scouts carrying at least one of them. Values are normalized the same way stored tags are, so `On Call` matches `on-call`. Omit for the whole fleet.
* @minLength 1
diff --git a/products/signals/frontend/generated/api.ts b/products/signals/frontend/generated/api.ts
index 0ca04db66668..415177877b18 100644
--- a/products/signals/frontend/generated/api.ts
+++ b/products/signals/frontend/generated/api.ts
@@ -1031,7 +1031,7 @@ export const getSignalsScoutCreateUrl = (projectId: string) => {
}
/**
- * Create a scout skill and its runnable config atomically. Any valid skill name works — the config row is what makes the skill a scout. The skill always receives the report-channel tools. The optional config controls schedule, enablement, dry-run posture, network access, and typed destinations such as Slack. Repeating the same definition is safe and applies any supplied config fields; reusing its name for a different definition returns 409.
+ * Create a scout skill and its runnable config atomically. Give it a `display_name` — the label people read, kept exactly as written — and the scout's permanent skill name is generated from it, with a numeric suffix when that name is taken, so two scouts may share a label without sharing an identity. Pass `name` instead to pick that identifier yourself; any valid skill name works, since the config row is what makes a skill a scout. The skill always receives the report-channel tools. The optional config controls schedule, enablement, dry-run posture, network access, and typed destinations such as Slack. Repeating the same definition is safe and applies any supplied config fields; reusing an explicit `name` for a different definition returns 409.
* @summary Create a scout
*/
export const signalsScoutCreate = async (
@@ -1085,7 +1085,7 @@ export const getSignalsScoutConfigListUrl = (projectId: string, params?: Signals
}
/**
- * List the per-(team, skill) scout configs for this project. Each row includes its schedule (rolling `run_interval_minutes`, or a project-local `run_cron_schedule` when set), `enabled`, `emit` posture, and `tags`. A freshly authored scout skill appears here once its config is registered, either explicitly via create or by the coordinator's next tick. Pass `tags` to narrow the fleet to the scouts carrying at least one of the given labels.
+ * List the per-(team, skill) scout configs for this project. Each row includes its `display_name` (the label people read), its `skill_name` (the permanent identifier), its schedule (rolling `run_interval_minutes`, or a project-local `run_cron_schedule` when set), `enabled`, `emit` posture, and `tags`. A freshly authored scout skill appears here once its config is registered, either explicitly via create or by the coordinator's next tick. Pass `tags` to narrow the fleet to the scouts carrying at least one of the given labels, and `search` to narrow it to the scouts matching a substring of either name.
* @summary List scout configs
*/
export const signalsScoutConfigList = async (
diff --git a/products/signals/frontend/generated/api.zod.ts b/products/signals/frontend/generated/api.zod.ts
index 1626a29f64e2..25b27d38fc39 100644
--- a/products/signals/frontend/generated/api.zod.ts
+++ b/products/signals/frontend/generated/api.zod.ts
@@ -503,9 +503,11 @@ export const SignalsReportsRefreshMetricsCreateBody = /* @__PURE__ */ zod.object
})
/**
- * Create a scout skill and its runnable config atomically. Any valid skill name works — the config row is what makes the skill a scout. The skill always receives the report-channel tools. The optional config controls schedule, enablement, dry-run posture, network access, and typed destinations such as Slack. Repeating the same definition is safe and applies any supplied config fields; reusing its name for a different definition returns 409.
+ * Create a scout skill and its runnable config atomically. Give it a `display_name` — the label people read, kept exactly as written — and the scout's permanent skill name is generated from it, with a numeric suffix when that name is taken, so two scouts may share a label without sharing an identity. Pass `name` instead to pick that identifier yourself; any valid skill name works, since the config row is what makes a skill a scout. The skill always receives the report-channel tools. The optional config controls schedule, enablement, dry-run posture, network access, and typed destinations such as Slack. Repeating the same definition is safe and applies any supplied config fields; reusing an explicit `name` for a different definition returns 409.
* @summary Create a scout
*/
+export const signalsScoutCreateBodyDisplayNameMax = 200
+
export const signalsScoutCreateBodyNameMax = 64
export const signalsScoutCreateBodyDescriptionMax = 1024
@@ -546,11 +548,19 @@ export const signalsScoutCreateBodySuggestionIdMax = 64
export const SignalsScoutCreateBody = /* @__PURE__ */ zod
.object({
+ display_name: zod
+ .string()
+ .max(signalsScoutCreateBodyDisplayNameMax)
+ .optional()
+ .describe(
+ "Name shown wherever people identify this scout, written however you want it — spaces, capitalization, and acronyms are kept as typed, and two scouts may share one. It does not change the scout's skill name, which stays its identity, so renaming a scout keeps its schedule, run history, notes, memory, and links. At most 200 characters; blank means the scout has no name of its own and is labelled from its skill name instead."
+ ),
name: zod
.string()
.max(signalsScoutCreateBodyNameMax)
+ .optional()
.describe(
- 'Unique scout name, containing only lowercase letters, numbers, and hyphens. The `signals-scout-` prefix is optional.'
+ 'Optional skill name for the scout — its permanent identifier, containing only lowercase letters, numbers, and hyphens. Omit it and one is generated from `display_name` (`My APM scout` becomes `my-apm-scout`), with a numeric suffix when that name is taken. Pass it to pick the identifier yourself, or to keep a client written before display names working unchanged. The `signals-scout-` prefix is optional.'
),
description: zod
.string()
@@ -798,6 +808,8 @@ export const signalsScoutConfigCreateBodyOutputDestinationsOneSlackOneUsersMax =
export const signalsScoutConfigCreateBodyOutputDestinationsOneSlackOneThreadReportsDefault = true
export const signalsScoutConfigCreateBodyRunCronScheduleMax = 100
+export const signalsScoutConfigCreateBodyDisplayNameMax = 200
+
export const signalsScoutConfigCreateBodySkillNameMax = 200
export const SignalsScoutConfigCreateBody = /* @__PURE__ */ zod
@@ -938,6 +950,13 @@ export const SignalsScoutConfigCreateBody = /* @__PURE__ */ zod
.describe(
"Optional five-field cron expression, e.g. '30 9 \* \* \*' (daily at 09:30), '0 9,17 \* \* \*' (twice daily), or '0 9 \* \* 1-5' (weekday mornings). Evaluated in the project timezone. Takes precedence over `run_interval_minutes`; occurrences must be at least 30 minutes apart."
),
+ display_name: zod
+ .string()
+ .max(signalsScoutConfigCreateBodyDisplayNameMax)
+ .optional()
+ .describe(
+ "Name shown wherever people identify this scout, written however you want it — spaces, capitalization, and acronyms are kept as typed, and two scouts may share one. It does not change the scout's skill name, which stays its identity, so renaming a scout keeps its schedule, run history, notes, memory, and links. At most 200 characters; blank means the scout has no name of its own and is labelled from its skill name instead."
+ ),
skill_name: zod
.string()
.max(signalsScoutConfigCreateBodySkillNameMax)
@@ -987,7 +1006,9 @@ export const SignalsScoutConfigUpdateBody = /* @__PURE__ */ zod
.string()
.max(signalsScoutConfigUpdateBodyDisplayNameMax)
.optional()
- .describe('Name shown in the UI. Does not change the skill name. Leave blank to use the default name.'),
+ .describe(
+ "Name shown wherever people identify this scout, written however you want it — spaces, capitalization, and acronyms are kept as typed, and two scouts may share one. It does not change the scout's skill name, which stays its identity, so renaming a scout keeps its schedule, run history, notes, memory, and links. At most 200 characters; blank means the scout has no name of its own and is labelled from its skill name instead."
+ ),
enabled: zod
.boolean()
.optional()
diff --git a/products/signals/frontend/inbox/components/config/scouts/ScoutCreateModal.tsx b/products/signals/frontend/inbox/components/config/scouts/ScoutCreateModal.tsx
index 077058c8efdf..1f42c1012eba 100644
--- a/products/signals/frontend/inbox/components/config/scouts/ScoutCreateModal.tsx
+++ b/products/signals/frontend/inbox/components/config/scouts/ScoutCreateModal.tsx
@@ -18,7 +18,7 @@ import type {
SignalScoutConfigApi,
SignalScoutCreateResponseApi,
} from 'products/signals/frontend/generated/api.schemas'
-import { SKILL_DESCRIPTION_MAX_LENGTH, SKILL_NAME_MAX_LENGTH } from 'products/skills/frontend/skillConstants'
+import { SKILL_DESCRIPTION_MAX_LENGTH } from 'products/skills/frontend/skillConstants'
import {
ScoutCreateInitialValues,
@@ -29,6 +29,7 @@ import {
import {
getScoutScheduleMode,
getScoutScheduleOptions,
+ MAX_SCOUT_DISPLAY_NAME_LENGTH,
SCOUT_CUSTOM_CRON_SCHEDULE_MODE,
SCOUT_DAILY_AT_SCHEDULE_MODE,
SCOUT_WEEKDAY_OPTIONS,
@@ -103,8 +104,11 @@ export function ScoutCreateModal({
// form has errors, so a name typo would otherwise surface only as the button's tooltip. Show the
// name error in the help slot as soon as the field has been left, until the form shows it itself.
const touchedNameError =
- scoutCreateFormTouches.name && !showScoutCreateFormErrors ? scoutCreateFormValidationErrors.name : undefined
+ scoutCreateFormTouches.display_name && !showScoutCreateFormErrors
+ ? scoutCreateFormValidationErrors.display_name
+ : undefined
const firstError = [
+ scoutCreateFormValidationErrors.display_name,
scoutCreateFormValidationErrors.name,
scoutCreateFormValidationErrors.description,
scoutCreateFormValidationErrors.body,
@@ -151,21 +155,21 @@ export function ScoutCreateModal({
>
<div className="flex flex-col gap-4">
<LemonField
- name="name"
+ name="display_name"
label="Name"
help={
touchedNameError ? (
<span className="text-danger">{touchedNameError}</span>
) : (
- 'Lowercase letters, numbers, and hyphens.'
+ 'What this scout is called. You can change it later.'
)
}
>
<LemonInput
autoFocus={!turningOn}
disabledReason={turningOn ? 'This scout already has its name' : undefined}
- maxLength={SKILL_NAME_MAX_LENGTH}
- placeholder="checkout-failures"
+ maxLength={MAX_SCOUT_DISPLAY_NAME_LENGTH}
+ placeholder="Checkout failures"
data-attr="scout-create-name"
/>
</LemonField>
diff --git a/products/signals/frontend/inbox/logics/scoutCreateModalLogic.test.ts b/products/signals/frontend/inbox/logics/scoutCreateModalLogic.test.ts
index bc9472f07e34..fa86c1cd3eaf 100644
--- a/products/signals/frontend/inbox/logics/scoutCreateModalLogic.test.ts
+++ b/products/signals/frontend/inbox/logics/scoutCreateModalLogic.test.ts
@@ -147,6 +147,7 @@ describe('scoutCreateModalLogic', () => {
expect(logic.values.scoutCreateForm).toEqual({
name: 'signals-scout-checkout-failures',
+ display_name: 'Checkout failures',
description: 'Investigates recurring checkout failures.',
body: 'Inspect checkout failure signals and report meaningful regressions.',
dailyTime: '09:00',
@@ -173,6 +174,7 @@ describe('scoutCreateModalLogic', () => {
expect(mockSignalsScoutCreate).toHaveBeenCalledWith(String(MOCK_TEAM_ID), {
name: 'signals-scout-checkout-failures',
+ display_name: 'Checkout failures',
description: 'Investigates recurring checkout failures.',
body: 'Inspect checkout failure signals and report meaningful regressions.',
config: {
@@ -279,7 +281,7 @@ describe('scoutCreateModalLogic', () => {
expect(logic.values.mcpServersDefaulted).toBe(true)
expect(logic.values.scoutCreateForm.config.mcp_gateway_server_ids).toEqual(['github-id', 'linear-id'])
- logic.actions.setScoutCreateFormValue('name', 'checkout-failures')
+ logic.actions.setScoutCreateFormValue('display_name', 'Checkout failures')
logic.actions.setScoutCreateFormValue('description', 'Investigates recurring checkout failures.')
logic.actions.setScoutCreateFormValue(
'body',
@@ -436,7 +438,7 @@ describe('scoutCreateModalLogic', () => {
await expectLogic(logic, () => logic.actions.submitScoutCreateForm()).toFinishAllListeners()
expect(logic.values.scoutCreateFormManualErrors).toEqual({
- name: 'A scout with this name already exists with different instructions.',
+ display_name: 'A scout with this name already exists with different instructions.',
})
expect(logic.values.scoutCreateForm).toMatchObject(initialValues)
expect(onCreated).not.toHaveBeenCalled()
@@ -445,6 +447,26 @@ describe('scoutCreateModalLogic', () => {
it.each([
['', 'Name is required'],
+ [' ', 'Name is required'],
+ // Whatever the person writes is the name: spaces, capitals and acronyms all survive.
+ ['Checkout failures', undefined],
+ ['My APM scout', undefined],
+ ['a'.repeat(201), 'Name must be 200 characters or fewer'],
+ ])('validates the typed name %p', async (displayName, expectedError) => {
+ logic = scoutCreateModalLogic({ logicKey: `display-name-${displayName}`, onClose, onCreated })
+ logic.mount()
+
+ logic.actions.setScoutCreateFormValue('display_name', displayName)
+
+ await expectLogic(logic).toMatchValues({
+ scoutCreateFormValidationErrors: expect.objectContaining({ display_name: expectedError }),
+ })
+ })
+
+ it.each([
+ // Only a prefill carries a skill name, so an invalid one is a broken deep link rather
+ // than a typo, and a blank one is the ordinary create the server names for us.
+ ['', undefined],
['checkout failures', 'Name cannot contain spaces. Use hyphens between words.'],
['Checkout', 'Lowercase letters, numbers, and hyphens only'],
// The inbox routes these as sub-pages of /inbox/scouts/, so the backend refuses them too.
@@ -453,7 +475,7 @@ describe('scoutCreateModalLogic', () => {
['runs', "'runs' is reserved by the inbox. Pick another name."],
['checkout-failures', undefined],
['signals-scout-checkout-failures', undefined],
- ])('validates the typed name %p', async (name, expectedError) => {
+ ])('validates a prefilled skill name %p', async (name, expectedError) => {
logic = scoutCreateModalLogic({ logicKey: `name-${name}`, onClose, onCreated })
logic.mount()
@@ -465,13 +487,16 @@ describe('scoutCreateModalLogic', () => {
})
it.each([
- [' checkout-failures ', 'checkout-failures'],
+ // No prefilled skill name: the server derives the scout's identity from what was typed.
+ ['', undefined],
+ // A prefill proposed one, and it has to go back verbatim or the suggestion stays on offer.
[' signals-scout-checkout-failures ', 'signals-scout-checkout-failures'],
- ])('submits the typed name %p as it is', async (typedName, expectedName) => {
+ ])('submits the typed name with prefilled skill name %p', async (prefilledName, expectedName) => {
mockSignalsScoutCreate.mockResolvedValue(CREATED_SCOUT)
logic = scoutCreateModalLogic({
- logicKey: `typed-name-${typedName}`,
+ logicKey: `typed-name-${prefilledName}`,
initialValues: {
+ name: prefilledName || undefined,
description: 'Investigates recurring checkout failures.',
body: 'Inspect checkout failure signals and report meaningful regressions.',
},
@@ -480,13 +505,12 @@ describe('scoutCreateModalLogic', () => {
})
logic.mount()
- expect(logic.values.scoutCreateForm.name).toBe('')
- logic.actions.setScoutCreateFormValue('name', typedName)
+ logic.actions.setScoutCreateFormValue('display_name', ' Checkout failures ')
await expectLogic(logic, () => logic.actions.submitScoutCreateForm()).toFinishAllListeners()
expect(mockSignalsScoutCreate).toHaveBeenCalledWith(
String(MOCK_TEAM_ID),
- expect.objectContaining({ name: expectedName })
+ expect.objectContaining({ display_name: 'Checkout failures', name: expectedName })
)
})
diff --git a/products/signals/frontend/inbox/logics/scoutCreateModalLogic.ts b/products/signals/frontend/inbox/logics/scoutCreateModalLogic.ts
index 6ae58b30d16f..1ad9c0fb4665 100644
--- a/products/signals/frontend/inbox/logics/scoutCreateModalLogic.ts
+++ b/products/signals/frontend/inbox/logics/scoutCreateModalLogic.ts
@@ -25,6 +25,8 @@ import {
dayTimeToWeeklyCron,
DEFAULT_SCOUT_DAILY_TIME,
DEFAULT_SCOUT_WEEKLY_DAY,
+ MAX_SCOUT_DISPLAY_NAME_LENGTH,
+ prettifyScoutSkillName,
SCOUT_CUSTOM_CRON_SCHEDULE_MODE,
SCOUT_DAILY_AT_SCHEDULE_MODE,
SCOUT_WEEKLY_ON_SCHEDULE_MODE,
@@ -49,15 +51,20 @@ type ScoutCreateConfigFormValues = Required<
> &
Pick<SignalScoutConfigOptionsApi, 'output_destinations'>
-export type ScoutCreateFormValues = Pick<SignalScoutCreateApi, 'name' | 'description' | 'body'> & {
- config: ScoutCreateConfigFormValues
- /** Run time for both the daily and the weekly mode, so switching between them keeps it. */
- dailyTime: string
- /** Cron day-of-week the weekly mode runs on. */
- weeklyDay: string
-}
+// `display_name` and `name` are optional on the request body — the server accepts either — but the form
+// always holds both as strings, with `name` empty unless a prefill supplied one.
+export type ScoutCreateFormValues = Pick<SignalScoutCreateApi, 'description' | 'body'> &
+ Required<Pick<SignalScoutCreateApi, 'display_name' | 'name'>> & {
+ config: ScoutCreateConfigFormValues
+ /** Run time for both the daily and the weekly mode, so switching between them keeps it. */
+ dailyTime: string
+ /** Cron day-of-week the weekly mode runs on. */
+ weeklyDay: string
+ }
-export type ScoutCreateInitialValues = Partial<Pick<SignalScoutCreateApi, 'name' | 'description' | 'body'>> & {
+export type ScoutCreateInitialValues = Partial<
+ Pick<SignalScoutCreateApi, 'display_name' | 'name' | 'description' | 'body'>
+> & {
config?: Partial<ScoutCreateConfigFormValues>
/**
* The scout suggestion this form was opened from. Sent with the create so the suggestion stops
@@ -83,6 +90,10 @@ export interface ScoutCreateModalLogicProps {
}
export const DEFAULT_SCOUT_CREATE_FORM_VALUES: ScoutCreateFormValues = {
+ display_name: '',
+ // The skill name is the scout's permanent identity, and the server derives it from the display
+ // name. It is a form value only so a prefill that proposed one (a suggestion, a template deep
+ // link) can send that exact name back — nothing renders an input for it.
name: '',
description: '',
body: '',
@@ -117,6 +128,7 @@ export function getScoutCreateFormValues(initialValues: ScoutCreateInitialValues
...DEFAULT_SCOUT_CREATE_FORM_VALUES,
...editableInitialValues,
name: (initialValues?.name ?? '').trim(),
+ display_name: (initialValues?.display_name ?? '').trim() || prettifyScoutSkillName(initialValues?.name ?? ''),
config,
dailyTime:
dailyCronToTime(config.run_cron_schedule) ??
@@ -183,16 +195,31 @@ function scoutWeeklyDay(form: ScoutCreateFormValues): string {
// Restoring such a draft into the field that now holds the whole name would create a differently
// named scout, and would leave its suggestion on offer, because the backend retires a suggestion
// only when the submitted name matches the one it proposed. Bumping this drops those drafts.
-const SCOUT_CREATE_DRAFT_STORAGE_VERSION = 'v2.'
+// Bumped again for the display name: a v2 draft carries no `display_name`, and kea-localstorage
+// restores the stored object over the whole default rather than merging in new fields, so it would
+// reopen with a blank required field and the name the person typed gone.
+const SCOUT_CREATE_DRAFT_STORAGE_VERSION = 'v3.'
// Names the inbox reads as sub-pages of `/inbox/scouts/`, so a scout that took one could never be
// opened. The backend refuses them too; this is so the reason shows next to the field.
const RESERVED_SCOUT_NAMES = new Set(['scratchpad', 'findings', 'runs'])
+function scoutDisplayNameError(displayName: string): string | undefined {
+ const trimmed = displayName.trim()
+ if (!trimmed) {
+ return 'Name is required'
+ }
+ if (trimmed.length > MAX_SCOUT_DISPLAY_NAME_LENGTH) {
+ return `Name must be ${MAX_SCOUT_DISPLAY_NAME_LENGTH} characters or fewer`
+ }
+ return undefined
+}
+
function scoutNameError(name: string): string | undefined {
const normalizedName = name.trim()
if (!normalizedName) {
- return 'Name is required'
+ // Only a prefill carries one, and the server generates a name when none is sent.
+ return undefined
}
// The shared skill-name rule rejects spaces too, but as "lowercase letters, numbers, and hyphens
// only", which does not tell someone who typed "checkout failures" what to change.
@@ -339,7 +366,7 @@ export const scoutCreateModalLogic: LogicWrapper<scoutCreateModalLogicType> = ke
forms(({ props: logicProps, actions, values }) => ({
scoutCreateForm: {
defaults: getScoutCreateFormValues(logicProps.initialValues),
- errors: ({ name, description, body, config, dailyTime }) => {
+ errors: ({ display_name, name, description, body, config, dailyTime }) => {
const runIntervalError =
!Number.isFinite(config.run_interval_minutes) ||
config.run_interval_minutes < 30 ||
@@ -349,6 +376,7 @@ export const scoutCreateModalLogic: LogicWrapper<scoutCreateModalLogicType> = ke
const tagsError = scoutTagsError(config.tags)
return {
+ display_name: scoutDisplayNameError(display_name),
name: scoutNameError(name),
description: !description.trim()
? 'Description is required'
@@ -399,7 +427,11 @@ export const scoutCreateModalLogic: LogicWrapper<scoutCreateModalLogicType> = ke
try {
const scout = await signalsScoutCreate(String(values.currentTeamId), {
- name: formValues.name.trim(),
+ display_name: formValues.display_name.trim(),
+ // Omitted for an ordinary create, so the server derives the identity. A
+ // prefill sends the exact name it proposed, which is what retires its
+ // suggestion and what an existing scout of that name is matched against.
+ name: formValues.name.trim() || undefined,
description: formValues.description.trim(),
body: formValues.body.trim(),
config: formValues.config,
@@ -416,8 +448,10 @@ export const scoutCreateModalLogic: LogicWrapper<scoutCreateModalLogicType> = ke
} catch (error) {
const apiError = error instanceof ApiError ? error : null
if (apiError?.status === 409 || apiError?.attr === 'name') {
+ // Reported against the name field the person can actually edit: the skill
+ // name only ever comes from a prefill, so it has no input to point at.
actions.setScoutCreateFormManualErrors({
- name: apiError.detail ?? 'A scout with this name already exists',
+ display_name: apiError.detail ?? 'A scout with this name already exists',
})
} else {
lemonToast.error(apiError?.detail ?? 'Could not create the scout')
diff --git a/products/signals/frontend/inbox/utils/scoutRunsWindow.ts b/products/signals/frontend/inbox/utils/scoutRunsWindow.ts
index 90126e7a5eef..7a47702b3967 100644
--- a/products/signals/frontend/inbox/utils/scoutRunsWindow.ts
+++ b/products/signals/frontend/inbox/utils/scoutRunsWindow.ts
@@ -108,6 +108,9 @@ export function prettifyScoutSkillName(skillName: string): string {
return cleaned.charAt(0).toUpperCase() + cleaned.slice(1)
}
+/** Mirrors `SignalScoutConfig.MAX_DISPLAY_NAME_LENGTH`, so the field reports the cap the server enforces. */
+export const MAX_SCOUT_DISPLAY_NAME_LENGTH = 200
+
export function scoutDisplayName(config: Pick<SignalScoutConfig, 'skill_name' | 'display_name'>): string {
return config.display_name || prettifyScoutSkillName(config.skill_name)
}
diff --git a/products/signals/mcp/tools.yaml b/products/signals/mcp/tools.yaml
index 20a387bc9bd0..e2561c23316b 100644
--- a/products/signals/mcp/tools.yaml
+++ b/products/signals/mcp/tools.yaml
@@ -471,12 +471,14 @@ tools:
list: true
title: List scout configs
description: >
- List the per-scout configs for this project. Each scout has one row with its schedule (rolling
- `run_interval_minutes`, or a project-local cron `run_cron_schedule` when set), `enabled` flag, and `emit`
- (dry-run) posture, and output destinations. A freshly authored scout appears once its config is registered:
- immediately via `scout-config-create` (one skill) or `scout-config-sync` (the whole fleet), or on the
- coordinator's next tick. Use this to see which scouts run, how often, whether they emit findings to the
- inbox, and where those findings are delivered. Pair with `scout-config-update` to tune them.
+ List the per-scout configs for this project. Each scout has one row with the `display_name` people read, the
+ `skill_name` that is its permanent identity, its schedule (rolling `run_interval_minutes`, or a
+ project-local cron `run_cron_schedule` when set), `enabled` flag, and `emit` (dry-run) posture, and output
+ destinations. A freshly authored scout appears once its config is registered: immediately via
+ `scout-config-create` (one skill) or `scout-config-sync` (the whole fleet), or on the coordinator's next
+ tick. Use this to see which scouts run, how often, whether they emit findings to the inbox, and where those
+ findings are delivered. Pass `search` to narrow the list to the scouts matching a substring of either name.
+ Pair with `scout-config-update` to tune them.
scout-config-sync:
operation: signals_scout_config_sync
enabled: true
@@ -526,13 +528,16 @@ tools:
idempotent: true
title: Create a scout
description: >
- Create a custom scout skill and its runnable config in one atomic call. Any valid skill name works and the
+ Create a custom scout skill and its runnable config in one atomic call. Give it a `display_name`, the label
+ people read, kept exactly as written, and the server generates the scout's permanent skill name from it,
+ adding a numeric suffix when that name is taken, so two scouts may share a label without sharing an
+ identity. Pass `name` instead to choose that identifier yourself; any valid skill name works and the
`signals-scout-` prefix is optional. Pass the complete markdown prompt in `body`; include project-specific
event or signal names, thresholds, investigation steps, and report criteria there. The server always grants
the report-channel tools. Optional `files` bundle reference material, while `config` controls the rolling or
cron schedule, enabled and dry-run posture, and typed output destinations such as Slack (a channel to post
into, or users to DM directly). Repeating the same definition is safe and applies any supplied config
- fields. Reusing the name for a different definition returns a conflict.
+ fields. Reusing an explicit `name` for a different definition returns a conflict.
exclude_params:
- suggestion_id
scout-edit-report:
diff --git a/products/signals/skills/AGENTS.md b/products/signals/skills/AGENTS.md
index 28d210a87ac5..099d68cffe6d 100644
--- a/products/signals/skills/AGENTS.md
+++ b/products/signals/skills/AGENTS.md
@@ -88,6 +88,12 @@ It is how a canonical scout claims a product surface: AI observability's self-dr
Tags are seeded at creation only — a person who removes one keeps it removed — so adding the key to a scout teams already run leaves their existing configs untagged until someone tags them through the config API.
They sit outside the canonical content hash, since they belong to the config rather than the skill row.
+Frontmatter also carries the required-in-practice **`scout-display-name`** — the label the scout ships under, seeded onto `SignalScoutConfig.display_name` and shown wherever a person identifies the scout.
+Every canonical scout states one, because the fallback sentence-cases the slug and gets acronyms wrong: `signals-scout-apm` reads as "Apm" and `signals-scout-mcp-tool-calls` as "Mcp tool calls".
+Give a new scout a label rather than adding a capitalization fix downstream.
+Unlike tags, it is reconciled onto rows seeded earlier, but only where the column is still blank, so a scout a team renamed keeps the name they gave it.
+It sits outside the canonical content hash for the same reason tags do.
+
Frontmatter also carries the optional **`scout-role`** value, which is `specialist` unless a scout says otherwise.
A scout that watches the self-driving system rather than a product surface declares `scout-role: operational`, and the harness stops treating its quiet as waste: the config seeds enabled and exempt from the inactivity sweep, skips the launch allowlist and the per-team enabled-scout cap, and cannot be deleted through the config API.
Unlike tags, the role is reconciled onto rows seeded earlier on every coordinator tick, because a silenced operational scout is the failure the role exists to prevent — though a pause a person made is still left standing, and `withheld_skills` still gates the scout.
diff --git a/products/signals/skills/signals-scout-ai-observability/SKILL.md b/products/signals/skills/signals-scout-ai-observability/SKILL.md
index 05b27f1774d8..1a7f7f11c06e 100644
--- a/products/signals/skills/signals-scout-ai-observability/SKILL.md
+++ b/products/signals/skills/signals-scout-ai-observability/SKILL.md
@@ -1,5 +1,6 @@
---
name: signals-scout-ai-observability
+scout-display-name: AI observability
description: >
Signals scout for PostHog AI observability. Watches LLM traces for cost, latency, error,
volume, and eval-performance regressions.
diff --git a/products/signals/skills/signals-scout-anomaly-detection/SKILL.md b/products/signals/skills/signals-scout-anomaly-detection/SKILL.md
index d5c9c7f73126..146363355035 100644
--- a/products/signals/skills/signals-scout-anomaly-detection/SKILL.md
+++ b/products/signals/skills/signals-scout-anomaly-detection/SKILL.md
@@ -1,5 +1,6 @@
---
name: signals-scout-anomaly-detection
+scout-display-name: Anomaly detection
description: >
Signals scout that watches the project's most-viewed dashboards and insights for anomalies —
bursts, drops, flat-lines, and trend breaks — against each insight's own seasonality-matched
diff --git a/products/signals/skills/signals-scout-apm/SKILL.md b/products/signals/skills/signals-scout-apm/SKILL.md
index 0a442bc4525f..a967d782a7a0 100644
--- a/products/signals/skills/signals-scout-apm/SKILL.md
+++ b/products/signals/skills/signals-scout-apm/SKILL.md
@@ -1,5 +1,6 @@
---
name: signals-scout-apm
+scout-display-name: APM
description: >
Signals scout for PostHog distributed tracing (APM / OpenTelemetry spans). Watches per-service
RED metrics for error-rate and latency regressions, new error signatures, and traffic cliffs.
diff --git a/products/signals/skills/signals-scout-conversations/SKILL.md b/products/signals/skills/signals-scout-conversations/SKILL.md
index 276a79e40974..39a41638b627 100644
--- a/products/signals/skills/signals-scout-conversations/SKILL.md
+++ b/products/signals/skills/signals-scout-conversations/SKILL.md
@@ -1,5 +1,6 @@
---
name: signals-scout-conversations
+scout-display-name: Conversations
description: >
Signals scout for PostHog Conversations (support inbox). Watches `$conversation_*` ticket-
lifecycle events for SLA breach steps, first-response latency blowouts, backlog imbalance, and
diff --git a/products/signals/skills/signals-scout-csp-violations/SKILL.md b/products/signals/skills/signals-scout-csp-violations/SKILL.md
index e71e680703e7..1b9b21e47db1 100644
--- a/products/signals/skills/signals-scout-csp-violations/SKILL.md
+++ b/products/signals/skills/signals-scout-csp-violations/SKILL.md
@@ -1,5 +1,6 @@
---
name: signals-scout-csp-violations
+scout-display-name: CSP violations
description: >
Signals scout for Content Security Policy violations. Watches `$csp_violation` events for
blocked-URL clusters, per-directive bursts, post-deploy regressions, and suspicious third-
diff --git a/products/signals/skills/signals-scout-customer-analytics-billing-and-usage/SKILL.md b/products/signals/skills/signals-scout-customer-analytics-billing-and-usage/SKILL.md
index cd2eda325d8a..73367d0000b3 100644
--- a/products/signals/skills/signals-scout-customer-analytics-billing-and-usage/SKILL.md
+++ b/products/signals/skills/signals-scout-customer-analytics-billing-and-usage/SKILL.md
@@ -1,5 +1,6 @@
---
name: signals-scout-customer-analytics-billing-and-usage
+scout-display-name: 'Customer analytics: billing and usage'
description: >
Signals scout for per-account product-mix shifts. Watches each staked account's usage and
forecasted MRR per product for one product dropping or spiking against its own baseline while
diff --git a/products/signals/skills/signals-scout-customer-analytics/SKILL.md b/products/signals/skills/signals-scout-customer-analytics/SKILL.md
index c18e434d6a17..6848853cff3c 100644
--- a/products/signals/skills/signals-scout-customer-analytics/SKILL.md
+++ b/products/signals/skills/signals-scout-customer-analytics/SKILL.md
@@ -1,5 +1,6 @@
---
name: signals-scout-customer-analytics
+scout-display-name: Customer analytics
description: >
Signals scout for PostHog Customer analytics (Accounts). Watches per-account engagement for
churn-risk shapes — engagement cliffs, dormancy, champion departure — and the expansion
diff --git a/products/signals/skills/signals-scout-data-pipelines/SKILL.md b/products/signals/skills/signals-scout-data-pipelines/SKILL.md
index ee1c9babb758..03996e6f2e57 100644
--- a/products/signals/skills/signals-scout-data-pipelines/SKILL.md
+++ b/products/signals/skills/signals-scout-data-pipelines/SKILL.md
@@ -1,5 +1,6 @@
---
name: signals-scout-data-pipelines
+scout-display-name: Data pipelines
description: >
Signals scout for PostHog data pipelines — CDP destinations and transformations, batch
exports, and hog flows. Watches for delivery failures, degraded functions, and stalled exports
diff --git a/products/signals/skills/signals-scout-data-warehouse/SKILL.md b/products/signals/skills/signals-scout-data-warehouse/SKILL.md
index 053a7c01db14..b501f3de59c0 100644
--- a/products/signals/skills/signals-scout-data-warehouse/SKILL.md
+++ b/products/signals/skills/signals-scout-data-warehouse/SKILL.md
@@ -1,5 +1,6 @@
---
name: signals-scout-data-warehouse
+scout-display-name: Data warehouse
description: >
Signals scout for warehouse imports. Watches external data sources, sync schemas, webhook push
channels, and materialized views for failures, silent staleness, and row-volume cliffs, and
diff --git a/products/signals/skills/signals-scout-error-tracking/SKILL.md b/products/signals/skills/signals-scout-error-tracking/SKILL.md
index 9a1fe4a1f9f5..a5e85ccff489 100644
--- a/products/signals/skills/signals-scout-error-tracking/SKILL.md
+++ b/products/signals/skills/signals-scout-error-tracking/SKILL.md
@@ -1,5 +1,6 @@
---
name: signals-scout-error-tracking
+scout-display-name: Error tracking
description: >
Signals scout for PostHog error tracking. Watches `$exception` bursts, stuck loops, multi-
fingerprint clusters, and status regressions.
diff --git a/products/signals/skills/signals-scout-experiments/SKILL.md b/products/signals/skills/signals-scout-experiments/SKILL.md
index 30076801f52d..4032b6fed9f9 100644
--- a/products/signals/skills/signals-scout-experiments/SKILL.md
+++ b/products/signals/skills/signals-scout-experiments/SKILL.md
@@ -1,5 +1,6 @@
---
name: signals-scout-experiments
+scout-display-name: Experiments
description: >
Signals scout for PostHog A/B experiments. Watches running experiments for validity threats —
sample ratio mismatch, contamination, exposure stalls, mid-run flag mutations — and lifecycle
diff --git a/products/signals/skills/signals-scout-feature-flags/SKILL.md b/products/signals/skills/signals-scout-feature-flags/SKILL.md
index 06c160c722c4..d3c83d30d14b 100644
--- a/products/signals/skills/signals-scout-feature-flags/SKILL.md
+++ b/products/signals/skills/signals-scout-feature-flags/SKILL.md
@@ -1,5 +1,6 @@
---
name: signals-scout-feature-flags
+scout-display-name: Feature flags
description: >
Signals scout for PostHog feature flags. Watches the flag roster and the
`$feature_flag_called` stream for evaluation cliffs, ghost flags, response-distribution
diff --git a/products/signals/skills/signals-scout-general/SKILL.md b/products/signals/skills/signals-scout-general/SKILL.md
index 6ec254db1c67..c156d6c170f3 100644
--- a/products/signals/skills/signals-scout-general/SKILL.md
+++ b/products/signals/skills/signals-scout-general/SKILL.md
@@ -1,5 +1,6 @@
---
name: signals-scout-general
+scout-display-name: General
description: >
Cross-product Signals scout. Looks for cross-product correlations and explores the surfaces
the per-product specialist scouts don't cover.
diff --git a/products/signals/skills/signals-scout-health-checks/SKILL.md b/products/signals/skills/signals-scout-health-checks/SKILL.md
index c19acadb90db..3041e99a3581 100644
--- a/products/signals/skills/signals-scout-health-checks/SKILL.md
+++ b/products/signals/skills/signals-scout-health-checks/SKILL.md
@@ -1,5 +1,6 @@
---
name: signals-scout-health-checks
+scout-display-name: Health checks
description: >
Signals scout over PostHog's own health checks. Bundles the project's active health issues by
kind, weights them by blast radius, and surfaces the ones worth acting on.
diff --git a/products/signals/skills/signals-scout-inbox-validation/SKILL.md b/products/signals/skills/signals-scout-inbox-validation/SKILL.md
index 7e32a963d8b5..4b2f82e4ff3c 100644
--- a/products/signals/skills/signals-scout-inbox-validation/SKILL.md
+++ b/products/signals/skills/signals-scout-inbox-validation/SKILL.md
@@ -1,5 +1,6 @@
---
name: signals-scout-inbox-validation
+scout-display-name: Inbox validation
description: >
Follow-up Signals scout for the inbox itself. Re-measures the problems behind recently
resolved reports after a soak window and reports when a fix didn't hold, plus a gated
diff --git a/products/signals/skills/signals-scout-insight-alerts/SKILL.md b/products/signals/skills/signals-scout-insight-alerts/SKILL.md
index 013d3ef1a6f7..63f752f7ed99 100644
--- a/products/signals/skills/signals-scout-insight-alerts/SKILL.md
+++ b/products/signals/skills/signals-scout-insight-alerts/SKILL.md
@@ -1,5 +1,6 @@
---
name: signals-scout-insight-alerts
+scout-display-name: Insight alerts
description: >
Signals scout over the project's configured insight alerts. Reads each alert's recent firing
history and surfaces the firings a human likely missed.
diff --git a/products/signals/skills/signals-scout-logs/SKILL.md b/products/signals/skills/signals-scout-logs/SKILL.md
index 4c7306ed520e..6b70d5485102 100644
--- a/products/signals/skills/signals-scout-logs/SKILL.md
+++ b/products/signals/skills/signals-scout-logs/SKILL.md
@@ -1,5 +1,6 @@
---
name: signals-scout-logs
+scout-display-name: Logs
description: >
Signals scout for PostHog logs. Watches for emerging and rate-shifted message patterns, volume
bursts, severity-distribution shifts, service silence, and trace-correlated bursts.
diff --git a/products/signals/skills/signals-scout-mcp-tool-calls/SKILL.md b/products/signals/skills/signals-scout-mcp-tool-calls/SKILL.md
index 92a42ceb9597..e6754073c117 100644
--- a/products/signals/skills/signals-scout-mcp-tool-calls/SKILL.md
+++ b/products/signals/skills/signals-scout-mcp-tool-calls/SKILL.md
@@ -1,5 +1,6 @@
---
name: signals-scout-mcp-tool-calls
+scout-display-name: MCP tool calls
description: >
Signals scout for PostHog MCP tool calls. Watches `$mcp_tool_call` telemetry for tools that
need improvement — broad-reach failure rates, retry hammering, slow or context-bloating
diff --git a/products/signals/skills/signals-scout-observability-gaps/SKILL.md b/products/signals/skills/signals-scout-observability-gaps/SKILL.md
index 0c777e009404..385b4034300c 100644
--- a/products/signals/skills/signals-scout-observability-gaps/SKILL.md
+++ b/products/signals/skills/signals-scout-observability-gaps/SKILL.md
@@ -1,5 +1,6 @@
---
name: signals-scout-observability-gaps
+scout-display-name: Observability gaps
description: >
Signals scout for observability gaps — significant event volumes with no insight, dashboard,
or alert coverage. Recommends new insights, dashboards, or alerts as the product evolves.
diff --git a/products/signals/skills/signals-scout-product-analytics/SKILL.md b/products/signals/skills/signals-scout-product-analytics/SKILL.md
index 24fba8c5e031..f02b8eed5285 100644
--- a/products/signals/skills/signals-scout-product-analytics/SKILL.md
+++ b/products/signals/skills/signals-scout-product-analytics/SKILL.md
@@ -1,5 +1,6 @@
---
name: signals-scout-product-analytics
+scout-display-name: Product analytics
description: >
Signals scout for core product-analytics flows — funnels, retention, lifecycle, stickiness,
and paths. Watches the team's saved flows for a derived-rate regression while entrants hold.
diff --git a/products/signals/skills/signals-scout-replay-vision/SKILL.md b/products/signals/skills/signals-scout-replay-vision/SKILL.md
index fc1df9365313..e3b6bf281382 100644
--- a/products/signals/skills/signals-scout-replay-vision/SKILL.md
+++ b/products/signals/skills/signals-scout-replay-vision/SKILL.md
@@ -1,5 +1,6 @@
---
name: signals-scout-replay-vision
+scout-display-name: Replay vision
description: >
Signals scout for PostHog Replay Vision scanners. Watches that enabled scanners keep observing
(throughput and quota cliffs) and that aggregate score shifts and recurring themes get
diff --git a/products/signals/skills/signals-scout-revenue-analytics/SKILL.md b/products/signals/skills/signals-scout-revenue-analytics/SKILL.md
index 58fb7d3a1fa6..cab2bf185f5a 100644
--- a/products/signals/skills/signals-scout-revenue-analytics/SKILL.md
+++ b/products/signals/skills/signals-scout-revenue-analytics/SKILL.md
@@ -1,5 +1,6 @@
---
name: signals-scout-revenue-analytics
+scout-display-name: Revenue analytics
description: >
Signals scout for PostHog revenue analytics. Watches for upstream failures (Stripe sync
stalls, capture regressions), config drift, and goal-miss escalations.
diff --git a/products/signals/skills/signals-scout-session-replay/SKILL.md b/products/signals/skills/signals-scout-session-replay/SKILL.md
index 59cb65094e93..201cc9494aa2 100644
--- a/products/signals/skills/signals-scout-session-replay/SKILL.md
+++ b/products/signals/skills/signals-scout-session-replay/SKILL.md
@@ -1,5 +1,6 @@
---
name: signals-scout-session-replay
+scout-display-name: Session replay
description: >
Signals scout for PostHog session replay. Watches that sessions keep recording (capture
cliffs) and surfaces friction inside recordings — rage/dead-click clusters, error-after-
diff --git a/products/signals/skills/signals-scout-skills-store/SKILL.md b/products/signals/skills/signals-scout-skills-store/SKILL.md
index 18d8afdcd131..4fc7283d2f5a 100644
--- a/products/signals/skills/signals-scout-skills-store/SKILL.md
+++ b/products/signals/skills/signals-scout-skills-store/SKILL.md
@@ -1,5 +1,6 @@
---
name: signals-scout-skills-store
+scout-display-name: Skills store
description: >
Skill-hygiene scout for the team's PostHog skills store. Watches recently-changed and most-
used skills for authoring violations — vague descriptions, bloated bodies, dead file links,
diff --git a/products/signals/skills/signals-scout-surveys/SKILL.md b/products/signals/skills/signals-scout-surveys/SKILL.md
index d8e06bafae5b..083bcdc0a401 100644
--- a/products/signals/skills/signals-scout-surveys/SKILL.md
+++ b/products/signals/skills/signals-scout-surveys/SKILL.md
@@ -1,5 +1,6 @@
---
name: signals-scout-surveys
+scout-display-name: Surveys
description: >
Signals scout for PostHog surveys. Watches active surveys for score regressions, response-
volume drops, abandonment spikes, and targeting drift, and aggregates open-text responses into
diff --git a/products/signals/skills/signals-scout-tasks/SKILL.md b/products/signals/skills/signals-scout-tasks/SKILL.md
index 2c0efaf1051a..1a29f6c44700 100644
--- a/products/signals/skills/signals-scout-tasks/SKILL.md
+++ b/products/signals/skills/signals-scout-tasks/SKILL.md
@@ -1,5 +1,6 @@
---
name: signals-scout-tasks
+scout-display-name: Tasks
description: >
Signals scout for PostHog Tasks. Watches delivery health — failing runs clustered by
repository and error class, retry storms — and, on a slower rotation, recurring demand across
diff --git a/products/signals/skills/signals-scout-web-analytics/SKILL.md b/products/signals/skills/signals-scout-web-analytics/SKILL.md
index 16a3b3ebda2b..f6432d2f0447 100644
--- a/products/signals/skills/signals-scout-web-analytics/SKILL.md
+++ b/products/signals/skills/signals-scout-web-analytics/SKILL.md
@@ -1,5 +1,6 @@
---
name: signals-scout-web-analytics
+scout-display-name: Web analytics
description: >
Signals scout for PostHog web traffic. Watches per-channel session volume, attribution
breakage, and landing-page health (bounce and 404 steps) against the site's own baseline. Per-
diff --git a/products/signals/skills/signals-scout-web-vitals/SKILL.md b/products/signals/skills/signals-scout-web-vitals/SKILL.md
index 9899470376cf..5604857ac330 100644
--- a/products/signals/skills/signals-scout-web-vitals/SKILL.md
+++ b/products/signals/skills/signals-scout-web-vitals/SKILL.md
@@ -1,5 +1,6 @@
---
name: signals-scout-web-vitals
+scout-display-name: Web vitals
description: >
Signals scout for Core Web Vitals (`$web_vitals`). Watches each page's p75 LCP / INP / CLS /
FCP against Google's thresholds and its own history — poor-band pages, band crossings, sharp
diff --git a/services/mcp/schema/generated-tool-definitions.json b/services/mcp/schema/generated-tool-definitions.json
index a7e4acf9cb56..efc7f57fa248 100644
--- a/services/mcp/schema/generated-tool-definitions.json
+++ b/services/mcp/schema/generated-tool-definitions.json
@@ -9856,7 +9856,7 @@
}
},
"scout-config-list": {
- "description": "List the per-scout configs for this project. Each scout has one row with its schedule (rolling `run_interval_minutes`, or a project-local cron `run_cron_schedule` when set), `enabled` flag, and `emit` (dry-run) posture, and output destinations. A freshly authored scout appears once its config is registered: immediately via `scout-config-create` (one skill) or `scout-config-sync` (the whole fleet), or on the coordinator's next tick. Use this to see which scouts run, how often, whether they emit findings to the inbox, and where those findings are delivered. Pair with `scout-config-update` to tune them.",
+ "description": "List the per-scout configs for this project. Each scout has one row with the `display_name` people read, the `skill_name` that is its permanent identity, its schedule (rolling `run_interval_minutes`, or a project-local cron `run_cron_schedule` when set), `enabled` flag, and `emit` (dry-run) posture, and output destinations. A freshly authored scout appears once its config is registered: immediately via `scout-config-create` (one skill) or `scout-config-sync` (the whole fleet), or on the coordinator's next tick. Use this to see which scouts run, how often, whether they emit findings to the inbox, and where those findings are delivered. Pass `search` to narrow the list to the scouts matching a substring of either name. Pair with `scout-config-update` to tune them.",
"category": "Signals",
"feature": "signals",
"summary": "List scout configs",
@@ -9898,7 +9898,7 @@
}
},
"scout-create": {
- "description": "Create a custom scout skill and its runnable config in one atomic call. Any valid skill name works and the `signals-scout-` prefix is optional. Pass the complete markdown prompt in `body`; include project-specific event or signal names, thresholds, investigation steps, and report criteria there. The server always grants the report-channel tools. Optional `files` bundle reference material, while `config` controls the rolling or cron schedule, enabled and dry-run posture, and typed output destinations such as Slack (a channel to post into, or users to DM directly). Repeating the same definition is safe and applies any supplied config fields. Reusing the name for a different definition returns a conflict.",
+ "description": "Create a custom scout skill and its runnable config in one atomic call. Give it a `display_name`, the label people read, kept exactly as written, and the server generates the scout's permanent skill name from it, adding a numeric suffix when that name is taken, so two scouts may share a label without sharing an identity. Pass `name` instead to choose that identifier yourself; any valid skill name works and the `signals-scout-` prefix is optional. Pass the complete markdown prompt in `body`; include project-specific event or signal names, thresholds, investigation steps, and report criteria there. The server always grants the report-channel tools. Optional `files` bundle reference material, while `config` controls the rolling or cron schedule, enabled and dry-run posture, and typed output destinations such as Slack (a channel to post into, or users to DM directly). Repeating the same definition is safe and applies any supplied config fields. Reusing an explicit `name` for a different definition returns a conflict.",
"category": "Signals",
"feature": "signals",
"summary": "Create a scout",
diff --git a/services/mcp/schema/tool-definitions-all.json b/services/mcp/schema/tool-definitions-all.json
index fa0b67a0f24d..dde9a1c167ee 100644
--- a/services/mcp/schema/tool-definitions-all.json
+++ b/services/mcp/schema/tool-definitions-all.json
@@ -10428,7 +10428,7 @@
}
},
"scout-config-list": {
- "description": "List the per-scout configs for this project. Each scout has one row with its schedule (rolling `run_interval_minutes`, or a project-local cron `run_cron_schedule` when set), `enabled` flag, and `emit` (dry-run) posture, and output destinations. A freshly authored scout appears once its config is registered: immediately via `scout-config-create` (one skill) or `scout-config-sync` (the whole fleet), or on the coordinator's next tick. Use this to see which scouts run, how often, whether they emit findings to the inbox, and where those findings are delivered. Pair with `scout-config-update` to tune them.",
+ "description": "List the per-scout configs for this project. Each scout has one row with the `display_name` people read, the `skill_name` that is its permanent identity, its schedule (rolling `run_interval_minutes`, or a project-local cron `run_cron_schedule` when set), `enabled` flag, and `emit` (dry-run) posture, and output destinations. A freshly authored scout appears once its config is registered: immediately via `scout-config-create` (one skill) or `scout-config-sync` (the whole fleet), or on the coordinator's next tick. Use this to see which scouts run, how often, whether they emit findings to the inbox, and where those findings are delivered. Pass `search` to narrow the list to the scouts matching a substring of either name. Pair with `scout-config-update` to tune them.",
"category": "Signals",
"feature": "signals",
"summary": "List scout configs",
@@ -10470,7 +10470,7 @@
}
},
"scout-create": {
- "description": "Create a custom scout skill and its runnable config in one atomic call. Any valid skill name works and the `signals-scout-` prefix is optional. Pass the complete markdown prompt in `body`; include project-specific event or signal names, thresholds, investigation steps, and report criteria there. The server always grants the report-channel tools. Optional `files` bundle reference material, while `config` controls the rolling or cron schedule, enabled and dry-run posture, and typed output destinations such as Slack (a channel to post into, or users to DM directly). Repeating the same definition is safe and applies any supplied config fields. Reusing the name for a different definition returns a conflict.",
+ "description": "Create a custom scout skill and its runnable config in one atomic call. Give it a `display_name`, the label people read, kept exactly as written, and the server generates the scout's permanent skill name from it, adding a numeric suffix when that name is taken, so two scouts may share a label without sharing an identity. Pass `name` instead to choose that identifier yourself; any valid skill name works and the `signals-scout-` prefix is optional. Pass the complete markdown prompt in `body`; include project-specific event or signal names, thresholds, investigation steps, and report criteria there. The server always grants the report-channel tools. Optional `files` bundle reference material, while `config` controls the rolling or cron schedule, enabled and dry-run posture, and typed output destinations such as Slack (a channel to post into, or users to DM directly). Repeating the same definition is safe and applies any supplied config fields. Reusing an explicit `name` for a different definition returns a conflict.",
"category": "Signals",
"feature": "signals",
"summary": "Create a scout",
diff --git a/services/mcp/src/api/generated.ts b/services/mcp/src/api/generated.ts
index 522fb9c4db4a..102227046ecf 100644
--- a/services/mcp/src/api/generated.ts
+++ b/services/mcp/src/api/generated.ts
@@ -70621,7 +70621,7 @@ export namespace Schemas {
*/
export interface PatchedSignalScoutConfigUpdate {
/**
- * Name shown in the UI. Does not change the skill name. Leave blank to use the default name.
+ * Name shown wherever people identify this scout, written however you want it — spaces, capitalization, and acronyms are kept as typed, and two scouts may share one. It does not change the scout's skill name, which stays its identity, so renaming a scout keeps its schedule, run history, notes, memory, and links. At most 200 characters; blank means the scout has no name of its own and is labelled from its skill name instead.
* @maxLength 200
*/
display_name?: string;
@@ -81226,10 +81226,15 @@ export namespace Schemas {
*/
export interface ScannerScoutCreate {
/**
- * Unique scout name, containing only lowercase letters, numbers, and hyphens. The `signals-scout-` prefix is optional.
+ * Name shown wherever people identify this scout, written however you want it — spaces, capitalization, and acronyms are kept as typed, and two scouts may share one. It does not change the scout's skill name, which stays its identity, so renaming a scout keeps its schedule, run history, notes, memory, and links. At most 200 characters; blank means the scout has no name of its own and is labelled from its skill name instead.
+ * @maxLength 200
+ */
+ display_name?: string;
+ /**
+ * Optional skill name for the scout — its permanent identifier, containing only lowercase letters, numbers, and hyphens. Omit it and one is generated from `display_name` (`My APM scout` becomes `my-apm-scout`), with a numeric suffix when that name is taken. Pass it to pick the identifier yourself, or to keep a client written before display names working unchanged. The `signals-scout-` prefix is optional.
* @maxLength 64
*/
- name: string;
+ name?: string;
/**
* Short description of the signal or behavior this scout investigates.
* @maxLength 1024
@@ -82686,6 +82691,11 @@ export namespace Schemas {
* @nullable
*/
run_cron_schedule?: string | null;
+ /**
+ * Name shown wherever people identify this scout, written however you want it — spaces, capitalization, and acronyms are kept as typed, and two scouts may share one. It does not change the scout's skill name, which stays its identity, so renaming a scout keeps its schedule, run history, notes, memory, and links. At most 200 characters; blank means the scout has no name of its own and is labelled from its skill name instead.
+ * @maxLength 200
+ */
+ display_name?: string;
/**
* The skill to register a config for. Any valid skill name works — the config row is what makes a skill a scout. The skill must already exist on this project — author it via the skills store first.
* @maxLength 200
@@ -82698,10 +82708,15 @@ export namespace Schemas {
*/
export interface SignalScoutCreate {
/**
- * Unique scout name, containing only lowercase letters, numbers, and hyphens. The `signals-scout-` prefix is optional.
+ * Name shown wherever people identify this scout, written however you want it — spaces, capitalization, and acronyms are kept as typed, and two scouts may share one. It does not change the scout's skill name, which stays its identity, so renaming a scout keeps its schedule, run history, notes, memory, and links. At most 200 characters; blank means the scout has no name of its own and is labelled from its skill name instead.
+ * @maxLength 200
+ */
+ display_name?: string;
+ /**
+ * Optional skill name for the scout — its permanent identifier, containing only lowercase letters, numbers, and hyphens. Omit it and one is generated from `display_name` (`My APM scout` becomes `my-apm-scout`), with a numeric suffix when that name is taken. Pass it to pick the identifier yourself, or to keep a client written before display names working unchanged. The `signals-scout-` prefix is optional.
* @maxLength 64
*/
- name: string;
+ name?: string;
/**
* Short description of the signal or behavior this scout investigates.
* @maxLength 1024
@@ -105779,6 +105794,11 @@ export namespace Schemas {
};
export type SignalsScoutConfigListParams = {
+ /**
+ * Case-insensitive substring filter over a scout's display name and its skill name. A scout matches on either, so a person who knows the label and a caller who knows the identifier both find it. Omit for the whole fleet.
+ * @minLength 1
+ */
+ search?: string;
/**
* Comma-separated tags, e.g. `revenue,on-call`. Returns the scouts carrying at least one of them. Values are normalized the same way stored tags are, so `On Call` matches `on-call`. Omit for the whole fleet.
* @minLength 1
diff --git a/services/mcp/src/generated/signals/api.ts b/services/mcp/src/generated/signals/api.ts
index d8be26e30a2a..9fbb58408cc4 100644
--- a/services/mcp/src/generated/signals/api.ts
+++ b/services/mcp/src/generated/signals/api.ts
@@ -533,7 +533,7 @@ export const SignalsReportsBulkStateCreateBody = () => zod.object({
})
/**
- * Create a scout skill and its runnable config atomically. Any valid skill name works — the config row is what makes the skill a scout. The skill always receives the report-channel tools. The optional config controls schedule, enablement, dry-run posture, network access, and typed destinations such as Slack. Repeating the same definition is safe and applies any supplied config fields; reusing its name for a different definition returns 409.
+ * Create a scout skill and its runnable config atomically. Give it a `display_name` — the label people read, kept exactly as written — and the scout's permanent skill name is generated from it, with a numeric suffix when that name is taken, so two scouts may share a label without sharing an identity. Pass `name` instead to pick that identifier yourself; any valid skill name works, since the config row is what makes a skill a scout. The skill always receives the report-channel tools. The optional config controls schedule, enablement, dry-run posture, network access, and typed destinations such as Slack. Repeating the same definition is safe and applies any supplied config fields; reusing an explicit `name` for a different definition returns 409.
* @summary Create a scout
*/
export const SignalsScoutCreateParams = () => zod.object({
@@ -544,6 +544,8 @@ export const SignalsScoutCreateParams = () => zod.object({
),
})
+export const signalsScoutCreateBodyDisplayNameMax = 200
+
export const signalsScoutCreateBodyNameMax = 64
export const signalsScoutCreateBodyDescriptionMax = 1024
@@ -582,11 +584,19 @@ export const signalsScoutCreateBodyConfigOneRunCronScheduleMax = 100
export const SignalsScoutCreateBody = () => zod
.object({
+ display_name: zod
+ .string()
+ .max(signalsScoutCreateBodyDisplayNameMax)
+ .optional()
+ .describe(
+ "Name shown wherever people identify this scout, written however you want it — spaces, capitalization, and acronyms are kept as typed, and two scouts may share one. It does not change the scout's skill name, which stays its identity, so renaming a scout keeps its schedule, run history, notes, memory, and links. At most 200 characters; blank means the scout has no name of its own and is labelled from its skill name instead."
+ ),
name: zod
.string()
.max(signalsScoutCreateBodyNameMax)
+ .optional()
.describe(
- 'Unique scout name, containing only lowercase letters, numbers, and hyphens. The `signals-scout-` prefix is optional.'
+ 'Optional skill name for the scout — its permanent identifier, containing only lowercase letters, numbers, and hyphens. Omit it and one is generated from `display_name` (`My APM scout` becomes `my-apm-scout`), with a numeric suffix when that name is taken. Pass it to pick the identifier yourself, or to keep a client written before display names working unchanged. The `signals-scout-` prefix is optional.'
),
description: zod
.string()
@@ -773,7 +783,7 @@ export const SignalsScoutCreateBody = () => zod
.describe('Create a runnable custom scout and its config in one atomic request.')
/**
- * List the per-(team, skill) scout configs for this project. Each row includes its schedule (rolling `run_interval_minutes`, or a project-local `run_cron_schedule` when set), `enabled`, `emit` posture, and `tags`. A freshly authored scout skill appears here once its config is registered, either explicitly via create or by the coordinator's next tick. Pass `tags` to narrow the fleet to the scouts carrying at least one of the given labels.
+ * List the per-(team, skill) scout configs for this project. Each row includes its `display_name` (the label people read), its `skill_name` (the permanent identifier), its schedule (rolling `run_interval_minutes`, or a project-local `run_cron_schedule` when set), `enabled`, `emit` posture, and `tags`. A freshly authored scout skill appears here once its config is registered, either explicitly via create or by the coordinator's next tick. Pass `tags` to narrow the fleet to the scouts carrying at least one of the given labels, and `search` to narrow it to the scouts matching a substring of either name.
* @summary List scout configs
*/
export const SignalsScoutConfigListParams = () => zod.object({
@@ -785,6 +795,13 @@ export const SignalsScoutConfigListParams = () => zod.object({
})
export const SignalsScoutConfigListQueryParams = () => zod.object({
+ search: zod
+ .string()
+ .min(1)
+ .optional()
+ .describe(
+ "Case-insensitive substring filter over a scout's display name and its skill name. A scout matches on either, so a person who knows the label and a caller who knows the identifier both find it. Omit for the whole fleet."
+ ),
tags: zod
.string()
.min(1)
@@ -833,6 +850,8 @@ export const signalsScoutConfigCreateBodyOutputDestinationsOneSlackOneUsersMax =
export const signalsScoutConfigCreateBodyOutputDestinationsOneSlackOneThreadReportsDefault = true
export const signalsScoutConfigCreateBodyRunCronScheduleMax = 100
+export const signalsScoutConfigCreateBodyDisplayNameMax = 200
+
export const signalsScoutConfigCreateBodySkillNameMax = 200
export const SignalsScoutConfigCreateBody = () => zod
@@ -973,6 +992,13 @@ export const SignalsScoutConfigCreateBody = () => zod
.describe(
"Optional five-field cron expression, e.g. '30 9 \* \* \*' (daily at 09:30), '0 9,17 \* \* \*' (twice daily), or '0 9 \* \* 1-5' (weekday mornings). Evaluated in the project timezone. Takes precedence over `run_interval_minutes`; occurrences must be at least 30 minutes apart."
),
+ display_name: zod
+ .string()
+ .max(signalsScoutConfigCreateBodyDisplayNameMax)
+ .optional()
+ .describe(
+ "Name shown wherever people identify this scout, written however you want it — spaces, capitalization, and acronyms are kept as typed, and two scouts may share one. It does not change the scout's skill name, which stays its identity, so renaming a scout keeps its schedule, run history, notes, memory, and links. At most 200 characters; blank means the scout has no name of its own and is labelled from its skill name instead."
+ ),
skill_name: zod
.string()
.max(signalsScoutConfigCreateBodySkillNameMax)
@@ -1031,7 +1057,9 @@ export const SignalsScoutConfigUpdateBody = () => zod
.string()
.max(signalsScoutConfigUpdateBodyDisplayNameMax)
.optional()
- .describe('Name shown in the UI. Does not change the skill name. Leave blank to use the default name.'),
+ .describe(
+ "Name shown wherever people identify this scout, written however you want it — spaces, capitalization, and acronyms are kept as typed, and two scouts may share one. It does not change the scout's skill name, which stays its identity, so renaming a scout keeps its schedule, run history, notes, memory, and links. At most 200 characters; blank means the scout has no name of its own and is labelled from its skill name instead."
+ ),
enabled: zod
.boolean()
.optional()
diff --git a/services/mcp/src/tools/generated/signals.ts b/services/mcp/src/tools/generated/signals.ts
index 652b77702dd1..dc58fc32ec4a 100644
--- a/services/mcp/src/tools/generated/signals.ts
+++ b/services/mcp/src/tools/generated/signals.ts
@@ -638,6 +638,9 @@ const scoutConfigCreate = (): ToolBase<ReturnType<typeof ScoutConfigCreateSchema
if (params.run_cron_schedule !== undefined) {
body['run_cron_schedule'] = params.run_cron_schedule
}
+ if (params.display_name !== undefined) {
+ body['display_name'] = params.display_name
+ }
if (params.skill_name !== undefined) {
body['skill_name'] = params.skill_name
}
@@ -685,6 +688,7 @@ const scoutConfigList = (): ToolBase<
method: 'GET',
path: `/api/projects/${encodeURIComponent(String(projectId))}/signals/scout/configs/`,
query: {
+ search: params.search,
tags: params.tags,
},
})
@@ -793,6 +797,9 @@ const scoutCreate = (): ToolBase<ReturnType<typeof ScoutCreateSchema>, Schemas.S
handler: async (context: Context, params: z.infer<ReturnType<typeof ScoutCreateSchema>>) => {
const projectId = await context.stateManager.getProjectId()
const body: Record<string, unknown> = {}
+ if (params.display_name !== undefined) {
+ body['display_name'] = params.display_name
+ }
if (params.name !== undefined) {
body['name'] = params.name
}
@@ -1437,6 +1444,9 @@ const signalsScoutConfigCreate = (): ToolBase<
if (params.run_cron_schedule !== undefined) {
body['run_cron_schedule'] = params.run_cron_schedule
}
+ if (params.display_name !== undefined) {
+ body['display_name'] = params.display_name
+ }
if (params.skill_name !== undefined) {
body['skill_name'] = params.skill_name
}
@@ -1484,6 +1494,7 @@ const signalsScoutConfigList = (): ToolBase<
method: 'GET',
path: `/api/projects/${encodeURIComponent(String(projectId))}/signals/scout/configs/`,
query: {
+ search: params.search,
tags: params.tags,
},
})
diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/scout-config-create.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/scout-config-create.json
index 8104547aa8cd..7a231a7f3538 100644
--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/scout-config-create.json
+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/scout-config-create.json
@@ -6,6 +6,11 @@
"description": "Exempt this scout from the inactivity pause, which otherwise switches off a scout that goes a fortnight without surfacing anything anyone engages with. Set it on watchdog scouts whose value is staying quiet. Defaults to false.",
"type": "boolean"
},
+ "display_name": {
+ "description": "Name shown wherever people identify this scout, written however you want it — spaces, capitalization, and acronyms are kept as typed, and two scouts may share one. It does not change the scout's skill name, which stays its identity, so renaming a scout keeps its schedule, run history, notes, memory, and links. At most 200 characters; blank means the scout has no name of its own and is labelled from its skill name instead.",
+ "maxLength": 200,
+ "type": "string"
+ },
"emit": {
"description": "Whether the scout writes findings to the inbox. False = dry-run: it runs and logs but emits nothing. Defaults to true.",
"type": "boolean"
diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/scout-config-list.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/scout-config-list.json
index 2515168be9a1..f5cdfa3a97ff 100644
--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/scout-config-list.json
+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/scout-config-list.json
@@ -1,6 +1,11 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
+ "search": {
+ "description": "Case-insensitive substring filter over a scout's display name and its skill name. A scout matches on either, so a person who knows the label and a caller who knows the identifier both find it. Omit for the whole fleet.",
+ "minLength": 1,
+ "type": "string"
+ },
"tags": {
"description": "Comma-separated tags, e.g. `revenue,on-call`. Returns the scouts carrying at least one of them. Values are normalized the same way stored tags are, so `On Call` matches `on-call`. Omit for the whole fleet.",
"minLength": 1,
diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/scout-config-update.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/scout-config-update.json
index ce8ad00a1bea..062749823898 100644
--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/scout-config-update.json
+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/scout-config-update.json
@@ -6,7 +6,7 @@
"type": "boolean"
},
"display_name": {
- "description": "Name shown in the UI. Does not change the skill name. Leave blank to use the default name.",
+ "description": "Name shown wherever people identify this scout, written however you want it — spaces, capitalization, and acronyms are kept as typed, and two scouts may share one. It does not change the scout's skill name, which stays its identity, so renaming a scout keeps its schedule, run history, notes, memory, and links. At most 200 characters; blank means the scout has no name of its own and is labelled from its skill name instead.",
"maxLength": 200,
"type": "string"
},
diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/scout-create.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/scout-create.json
index 11f814b9421c..34222566bbff 100644
--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/scout-create.json
+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/scout-create.json
@@ -190,6 +190,11 @@
"maxLength": 1024,
"type": "string"
},
+ "display_name": {
+ "description": "Name shown wherever people identify this scout, written however you want it — spaces, capitalization, and acronyms are kept as typed, and two scouts may share one. It does not change the scout's skill name, which stays its identity, so renaming a scout keeps its schedule, run history, notes, memory, and links. At most 200 characters; blank means the scout has no name of its own and is labelled from its skill name instead.",
+ "maxLength": 200,
+ "type": "string"
+ },
"files": {
"description": "Optional reference files bundled with the scout prompt.",
"items": {
@@ -216,11 +221,11 @@
"type": "array"
},
"name": {
- "description": "Unique scout name, containing only lowercase letters, numbers, and hyphens. The `signals-scout-` prefix is optional.",
+ "description": "Optional skill name for the scout — its permanent identifier, containing only lowercase letters, numbers, and hyphens. Omit it and one is generated from `display_name` (`My APM scout` becomes `my-apm-scout`), with a numeric suffix when that name is taken. Pass it to pick the identifier yourself, or to keep a client written before display names working unchanged. The `signals-scout-` prefix is optional.",
"maxLength": 64,
"type": "string"
}
},
- "required": ["name", "description", "body"],
+ "required": ["description", "body"],
"type": "object"
}
diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/signals-scout-config-create.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/signals-scout-config-create.json
index 8104547aa8cd..7a231a7f3538 100644
--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/signals-scout-config-create.json
+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/signals-scout-config-create.json
@@ -6,6 +6,11 @@
"description": "Exempt this scout from the inactivity pause, which otherwise switches off a scout that goes a fortnight without surfacing anything anyone engages with. Set it on watchdog scouts whose value is staying quiet. Defaults to false.",
"type": "boolean"
},
+ "display_name": {
+ "description": "Name shown wherever people identify this scout, written however you want it — spaces, capitalization, and acronyms are kept as typed, and two scouts may share one. It does not change the scout's skill name, which stays its identity, so renaming a scout keeps its schedule, run history, notes, memory, and links. At most 200 characters; blank means the scout has no name of its own and is labelled from its skill name instead.",
+ "maxLength": 200,
+ "type": "string"
+ },
"emit": {
"description": "Whether the scout writes findings to the inbox. False = dry-run: it runs and logs but emits nothing. Defaults to true.",
"type": "boolean"
diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/signals-scout-config-list.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/signals-scout-config-list.json
index 2515168be9a1..f5cdfa3a97ff 100644
--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/signals-scout-config-list.json
+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/signals-scout-config-list.json
@@ -1,6 +1,11 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
+ "search": {
+ "description": "Case-insensitive substring filter over a scout's display name and its skill name. A scout matches on either, so a person who knows the label and a caller who knows the identifier both find it. Omit for the whole fleet.",
+ "minLength": 1,
+ "type": "string"
+ },
"tags": {
"description": "Comma-separated tags, e.g. `revenue,on-call`. Returns the scouts carrying at least one of them. Values are normalized the same way stored tags are, so `On Call` matches `on-call`. Omit for the whole fleet.",
"minLength": 1,
diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/signals-scout-config-update.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/signals-scout-config-update.json
index ce8ad00a1bea..062749823898 100644
--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/signals-scout-config-update.json
+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/signals-scout-config-update.json
@@ -6,7 +6,7 @@
"type": "boolean"
},
"display_name": {
- "description": "Name shown in the UI. Does not change the skill name. Leave blank to use the default name.",
+ "description": "Name shown wherever people identify this scout, written however you want it — spaces, capitalization, and acronyms are kept as typed, and two scouts may share one. It does not change the scout's skill name, which stays its identity, so renaming a scout keeps its schedule, run history, notes, memory, and links. At most 200 characters; blank means the scout has no name of its own and is labelled from its skill name instead.",
"maxLength": 200,
"type": "string"
},