Skip to content

fix: suppress CS0618 for AddZipkinExporter and add Ollama training handlers#498

Merged
JerrettDavis merged 2 commits intomainfrom
feat/telemetry-and-ollama-training
Apr 27, 2026
Merged

fix: suppress CS0618 for AddZipkinExporter and add Ollama training handlers#498
JerrettDavis merged 2 commits intomainfrom
feat/telemetry-and-ollama-training

Conversation

@JerrettDavis
Copy link
Copy Markdown
Owner

Summary

Two fixes after PR #497 landed on main:

  1. Telemetry (CS0618): Wrap AddZipkinExporter call site in src/JD.AI.Telemetry/Extensions/TelemetryServiceExtensions.cs with #pragma warning disable/restore CS0618 so the project compiles cleanly under TreatWarningsAsErrors.

  2. Ollama Training: Add --ollama-generate <count> and --ollama-validate CLI handlers in tools/JD.AI.Workflows.Training/Program.cs, plus OLLAMA_HOST environment variable plumbing forwarded to OllamaClient.

Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com

JerrettDavis and others added 2 commits April 26, 2026 18:43
OpenTelemetry.Exporter.Zipkin 1.15.3 marks AddZipkinExporter as
[Obsolete], which the compiler promotes to CS0618 error under
TreatWarningsAsErrors. The project already dropped the Zipkin package
version NU1902 in PR #497 but the call site pragma was never committed.

Wrap the single call site with #pragma warning disable/restore CS0618
so CI compiles cleanly while backward-compat "zipkin" config support
is maintained until a full OTLP migration is done.

Failing file: src/JD.AI.Telemetry/Extensions/TelemetryServiceExtensions.cs
Error:        CS0618 @ line 101 (GitHub main)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
… Program.cs

The train-model workflow fails at "Train ML.NET model" (step 9) with a
FileNotFoundException on ollama_training_data.jsonl.

Root cause: Program.cs had no handler for --ollama-generate or
--ollama-validate. The "Synthesize training examples" step passes
`--ollama-generate 150 --output src/.../intent_classifier.zip` but
Program.cs silently ignored the unknown flag and fell through to the
built-in seed-corpus path, writing to /tmp/intent_training_data.csv
instead of the expected src/JD.AI.Workflows/Models/ollama_training_data.jsonl.
When "Train ML.NET model" then ran `--data ollama_training_data.jsonl`,
the file didn't exist → FileNotFoundException → exit non-zero.

Fix:
- Add --ollama-generate <count> handler: calls AiTrainingDataSynthesizer
  .GenerateAsync(count), writes results to ollama_training_data.jsonl in
  the same directory as --output, then exits 0.
- Add --ollama-validate handler: reads --data file, calls ValidateAsync,
  writes disagreement count to validate_summary.txt, then exits 0.
- Both handlers read OLLAMA_HOST env var (set by CI) for the Ollama URL.
- Update AiTrainingDataSynthesizer constructor to accept ollamaHost param
  and forward it to OllamaClient.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@JerrettDavis JerrettDavis merged commit 820994c into main Apr 27, 2026
@JerrettDavis JerrettDavis deleted the feat/telemetry-and-ollama-training branch April 27, 2026 00:17
@github-actions
Copy link
Copy Markdown
Contributor

⚠️ Deprecation Warning: The deny-licenses option is deprecated for possible removal in the next major release. For more information, see issue 997.

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@JerrettDavis JerrettDavis restored the feat/telemetry-and-ollama-training branch April 27, 2026 00:17
@JerrettDavis JerrettDavis deleted the feat/telemetry-and-ollama-training branch April 27, 2026 00:17
@github-actions
Copy link
Copy Markdown
Contributor

Code Coverage


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant