Plumb ctx through classifier and Ollama HTTP path

OllamaClient.Generate/GenerateText/call now take ctx and build the HTTP
request via NewRequestWithContext, so an in-flight LLM call is aborted
when the parent context is cancelled (Ctrl-C). Classifier.Classify and
its tier helpers take ctx too. ProcessFunc gets a ctx parameter so the
poller can forward its cancellable context down to classification.

Explainer.summarize manages its own 60s context since reaction-driven
flow has no parent ctx to inherit.
This commit is contained in:
prosolis
2026-05-22 18:55:43 -07:00
parent c9318d7bb0
commit 69967b25c6
5 changed files with 36 additions and 20 deletions

View File

@@ -95,8 +95,8 @@ func main() {
slog.Info("post queue started")
// Build the pipeline callback: classify → enqueue
processItem := func(item *ingestion.FeedItem) {
result, err := cls.Classify(item)
processItem := func(ctx context.Context, item *ingestion.FeedItem) {
result, err := cls.Classify(ctx, item)
if err != nil {
slog.Error("classification failed, will retry next cycle",
"guid", item.GUID,