Skip to content

SkillIndexEnrichmentService fails silently — trigger phrase cache always empty #592

Description

@Aaronontheweb

Problem

SkillIndexEnrichmentService is supposed to produce rich per-skill trigger phrases via an LLM sidecar call at daemon startup: 5–15 word descriptions in user language that help the agent match a task to a relevant skill. Without enrichment, the compressed skill index falls back to the first 60 characters of each skill's description (src/Netclaw.Actors/Skills/SkillRegistry.cs:191-193), which is often too terse for the model to reason over.

Evidence it never runs successfully:

  • ~/.netclaw/cache/skill-index/ directory is empty — zero cached trigger phrases.
  • Daemon log has no "Skill index enrichment complete" messages anywhere in recent logs.
  • Sidecar failures inside TryGenerateBatchAsync log only at _logger.LogDebug level (src/Netclaw.Daemon/Services/SkillIndexEnrichmentService.cs:155,161), so any failure is invisible unless logging is set to Debug.
  • _clientProvider is null also returns silently without logging (line 123).

Impact

The agent operates on truncated descriptions rather than purpose-written trigger phrases. This likely contributes to observed grounding failures — e.g. a 20-turn session on C# terminal-library work where the agent guessed skill_load("dotnet"), failed, then picked aspire-development-workflow from the error list. A properly enriched skill index would have surfaced akka-best-practices / csharp-coding-standards / etc. (once those are also loaded via the marketplace fix).

Fix

  1. Raise failure logging to LogWarning — a silent degradation to truncated descriptions should be visible to operators.
  2. Log explicitly when _clientProvider is null at startup so DI-wiring regressions are caught.
  3. Verify IChatClientProvider is actually registered in DI by the time SkillIndexEnrichmentService.StartAsync runs.
  4. Add a diagnostic status field or netclaw doctor check that reports the enrichment state (cached / in-progress / failed / never-ran).
  5. Investigate whether the 30-second timeout at SidecarTimeout is too tight for batches of ~60 skills — if so, batch in chunks.

Related

Discovered while investigating netclaw stats Skills loaded: 0 under milestone 0.12. Once the marketplace-path fix lands, the skill count grows from ~62 to ~95, making enrichment reliability more critical.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions