fix(brain): pass type and domain fields to ingestion write endpoint

The write handler was building a hand-rolled map that dropped the type
and domain fields from writeArgs. Pass the struct directly so all fields
reach the ingestion server. Strengthen the test to assert the request
body contains the type field.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Mathias Bergqvist
2026-04-17 20:38:38 +02:00
parent 275ba43df5
commit e610e253ef
2 changed files with 5 additions and 4 deletions

View File

@@ -56,10 +56,7 @@ func (s *Skill) write(ctx context.Context, args json.RawMessage) (json.RawMessag
if a.Content == "" {
return nil, fmt.Errorf("content is required")
}
return s.post(ctx, "/write", map[string]string{
"content": a.Content,
"filename": a.Filename,
})
return s.post(ctx, "/write", a)
}
func (s *Skill) post(ctx context.Context, path string, body any) (json.RawMessage, error) {