fix(brain): enforce mutual exclusivity and clarify brain_ingest schema

- Return error when both path and content are supplied simultaneously
- Improve tool description to clearly state the two valid call forms
- Add per-field descriptions so LLMs understand what each parameter requires

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Mathias Bergqvist
2026-04-22 23:03:03 +02:00
parent a6dce972d6
commit 2ae6bfe81e
2 changed files with 12 additions and 5 deletions

View File

@@ -78,6 +78,9 @@ func (s *Skill) ingest(ctx context.Context, args json.RawMessage) (json.RawMessa
if s.cfg.IngestSvcURL == "" {
return nil, fmt.Errorf("brain_ingest: INGEST_SVC_URL not configured")
}
if a.Path != "" && a.Content != "" {
return nil, fmt.Errorf("path and content+source are mutually exclusive: provide one or the other")
}
if a.Path != "" {
return s.postTo(ctx, s.cfg.IngestSvcURL+"/ingest-path", map[string]any{
"path": a.Path,