Skip to content

Add Polly support and expand timeouts and ecnhancements#5

Merged
techbuzzz merged 16 commits into
mainfrom
develop
Jun 26, 2026
Merged

Add Polly support and expand timeouts and ecnhancements#5
techbuzzz merged 16 commits into
mainfrom
develop

Conversation

@techbuzzz

Copy link
Copy Markdown
Owner

Description

This PR bundles the last 5 commits on develop (covering v10.2.0v10.3.0) into a single release candidate for main. It delivers the resilience, caching, DI, and provider-quality work landed on develop and consolidates the changelog entries:

  • Polly v8 resilience for HTTP providersMicrosoft.Extensions.Http.Resilience integration, ResilienceOptions, IDeliberaResiliencePipelineProvider, named pipelines (Delibera.Local / Delibera.Cloud / Delibera.Default), DI helpers (AddDeliberaResilience, AddDeliberaResiliencePipeline, AddDeliberaHttpClient), and migration of OllamaProvider, YandexGptProvider, and McpClientAdapter to the new DI-aware constructors. Hand-rolled retry loops removed in favour of named pipelines.
  • LRU cache, deduplication, token counting, Operator improvements — better CompressionCache eviction, smarter DeduplicationCompressor, allocation-aware TokenCounter, parallel Operator request dispatch via Parallel.ForEachAsync bounded by MaxDegreeOfParallelism.
  • DI refactor + OllamaProvider enhancements — new DependencyInjection/CouncilOptions, rewritten ServiceCollectionExtensions, renamed DIExampleDependencyInjectionExample, expanded Ollama streaming/embedding surface and updated appsettings.json keys.
  • Provider availability check refactor — cleaner failure semantics in ProviderFactory, with ChatClientLLMProvider / EmbeddingGeneratorProvider honouring the new contract.
  • Debate execution options handlingDebateExecutionOptions record bundles ILogger + response language + parallelism; threaded through IDebateStrategyWithOptions so StandardDebate / CritiqueDebate / ConsensusDebate opt in without breaking custom strategies.

23+ files touched in Delibera.Core, console examples, and the xUnit test project (9 new resilience tests + 7 new final-verdict tests). Package version bumped 10.2.0 → 10.3.0.

Full detail is in CHANGELOG.md (## [10.2.2]).

Related Issues

None — batched release PR for developmain.

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 💥 Breaking change (fix or feature that changes existing behaviour)
  • 📚 Documentation update
  • 🧹 Refactor / chore

(Polly resilience + Operator parallelism are new features; the remaining work is refactor and docs. ExecutionLogLevel rename in 10.2.0 is source-breaking but already shipped on develop.)

Checklist

  • My code follows the project's coding standards (see CONTRIBUTING.md)
  • The solution builds with 0 errors and 0 warnings (dotnet build --configuration Release)
  • I have added/updated XML documentation for public APIs
  • I have updated relevant documentation (README.md, QuickStart.md)
  • I have tested my changes (examples run as expected)

Additional Notes

Commits included (develop since 2add198):

f60d2d8 Add Polly v8 resilience integration for HTTP providers
eedd69a Improve LRU cache, deduplication, token counting, Operator
9596208 Refactor DI example, enhance OllamaProvider, update config
0255a01 Refactor provider availability check for clarity
2add198 Refactor debate execution options handling

Suggested merge strategy: merge commit (no rebase/squash) so the per-topic history remains intact for future bisects.

Suggested PR title:

Release v10.3.0 — Polly v8 resilience, LRU/dedup improvements, DI refactor

Suggested reviewers / labels: area: resilience, area: di, area: providers, release.

Pre-merge verification (please run locally):

dotnet build --configuration Release
dotnet test  --configuration Release
dotnet run --project src/Delibera.ConsoleApp -- --resilience
dotnet run --project src/Delibera.ConsoleApp -- --operator

techbuzzz and others added 14 commits June 16, 2026 10:31
… C# 15 (#1)

* feat: add Operator (MCP tools) micro-agent role

Introduce a new Operator role — a lightweight micro-agent that connects the
council to MCP (Model Context Protocol) servers and exposes their tools
(web search, filesystem, Notion, PostgreSQL, debate history, etc.) to debate
participants.

- Participants delegate tasks at any moment via the [[OPERATOR: task]] marker
- Operator uses its own cheaper LLM to plan tool calls, execute MCP tools and
  interpret results, optionally reusing the council's compression strategy
- Wired through all debate strategies (Standard/Critique/Consensus),
  CouncilExecutor, CouncilBuilder and DI options (Delibera:Operator)
- DI-initializable; supports stdio and HTTP MCP transports
- Per-round Operator interactions rendered in the final Markdown report
- Adds ModelContextProtocol package, console --operator flag, example & docs

* feat: upgrade to .NET 10 / C# 15, high-perf optimizations & MCP tools example

- Bump LangVersion to preview (C# 15) in both projects
- Update Microsoft.SourceLink.GitHub to 10.0.300 (other deps already at latest .NET 10 versions)
- Perf: SIMD-vectorized CosineSimilarity (ReadOnlySpan<float> + Vector<float>)
- Perf: TokenCounter ReadOnlySpan<char> overload (alloc-free word counting)
- Perf: CompressionCache.ComputeKey uses ArrayPool<T> + stackalloc SHA-256
- Add OperatorMcpToolsExample (browser via @playwright/mcp, Marp presentations) + --operator-mcp flag
- Fix nullable warning in Program.cs
- Add Russian docs: docs/NET10-Upgrade-RU.md

* docs: Add English version of .NET 10 upgrade documentation

* docs: Update README and QuickStart with Operator role documentation

---------

Co-authored-by: techbuzzz <victor.buzin@users.noreply.github.com>
Co-authored-by: Delibera Agent <agent@delibera.local>
…tor) [v10.1.1] (#2)

Add first-class interop with the standard Microsoft.Extensions.AI v10.7.0
abstractions while preserving the existing public API (additive only).

- Delibera.Core: add Microsoft.Extensions.AI 10.7.0; bump 10.1.0 -> 10.1.1
- ChatClientLLMProvider: ILLMProvider implemented over IChatClient (+ streaming)
- EmbeddingGeneratorProvider: IEmbeddingProvider over IEmbeddingGenerator
- MicrosoftAIExtensions: AsLLMProvider/AsEmbeddingProvider/AsChatClient bridges
  + WithMiddleware (logging + function invocation)
- ILLMProvider: additive default ChatStreamAsync (non-breaking)
- OllamaProvider: expose native AsChatClient()/AsEmbeddingGenerator()
- ProviderFactory.CreateFromChatClient + DI AddDeliberaChatClient/EmbeddingGenerator
- ConsoleApp: --msai example
- tests: new Delibera.Core.Tests (20 tests, fakes; no live network)
- docs: README/README-RU/QuickStart/CHANGELOG + solution file
Refactored expression-bodied members to full block-bodied methods for improved consistency and maintainability. Updated method/property implementations, reordered some fields, and enhanced property clarity. Restored or moved obsolete/compatibility methods. Improved disposal patterns in factories and clarified null/empty handling. No changes to core business logic; focus is on code style and API consistency.
Major overhaul of README.md for clarity and completeness:
- Expanded intro, features, and quick start with prerequisites
- Improved code samples and formatting throughout
- Added detailed sections for DI, Microsoft.Extensions.AI interop, context compression, RAG, Operator, and output files
- Provided a more comprehensive appsettings.json example
- Updated NuGet dependencies table and all repo links
- README.md no longer included in NuGet package in .csproj
- Numerous minor language, formatting, and consistency fixes
Added icon.png as the NuGet package icon via <PackageIcon> and ensured README.md is packed with the package for better documentation.
Introduce top-level crash guard and color-coded log streaming in Program.cs. Add OnLog and OnError events to CouncilExecutor and ICouncilExecutor for real-time observability. Refactor error handling to use new events. Update AskAllAsync to disambiguate responses by role and display name. Improve console output formatting and banner.
- Integrate Microsoft.Extensions.Logging throughout debate pipeline; add WithLogger, DI logger injection, and ICouncilExecutor.Logger
- Enforce response language via WithResponseLanguage and config; inject strict directive into all prompts
- Support parallel Operator requests per round, bounded by MaxDegreeOfParallelism (builder/config)
- Introduce DebateExecutionOptions to bundle logger, language, and parallelism for strategies
- Rename LogLevel to ExecutionLogLevel to avoid naming clash; add mapping to Microsoft log levels
- Update DI, configuration, README, and CHANGELOG for new features
- Minor refactoring and improved comments throughout
…sertions

- Restore DebateScenario, StandardDebate, CritiqueDebate, ConsensusDebate and CouncilBuilder
  to the pre-merge (v10.2.0) content; the merge commit had duplicated code blocks and garbled
  CollectResponsesAsync, breaking the build.
- Re-add the FluentAssertions package reference to the test project (lost during the merge),
  required by the YandexGptProvider tests brought in from main.
- Verified: dotnet build -> 0 errors, 0 warnings; dotnet test -> 31/31 passed.
Standardize and refactor how debate execution options (response language, parallelism, logging) are passed and honored across the council framework. All debate strategies and their implementations now consistently support overloads with DebateExecutionOptions, enabling per-execution configuration. CouncilBuilder and CouncilExecutor thread these options through the debate lifecycle. Code style and formatting are unified, and minor cleanups applied. No breaking API changes; internal extensibility is improved.
Simplifies control flow by continuing to the next provider if unavailable, reducing nesting and making model listing logic clearer.
- Move DI example to `DependencyInjectionExample.cs` and update references.
- Add `.editorconfig` to suppress IDE1006 for all-caps acronyms (e.g., LLM).
- Enhance `OllamaProvider` with explicit connection modes, static factory methods, and improved retry logic.
- Add explicit local/cloud Ollama creation methods to `ProviderFactory`.
- Simplify `Dispose` pattern in providers.
- Refactor `CouncilMember.Role` property and YandexGPT legacy request serialization.
- Use lowercase variable for summarization system prompt.
- Remove redundant log storage in `Program.cs` and apply code style improvements.
- Update `appsettings.json` to use a cloud-based chairman model.
- Simplify `RagProviderFactory` by removing async disposal.
- Replaced CompressionCache LRU with lock-free dict + linked list, batch eviction, and lock for LRU updates
- DeduplicationCompressor: switched fallback to Jaccard word overlap, batch embedding deduplication, added WordSet struct
- TokenCounter: added LRU memoization for short string estimates
- Operator: cached tool catalog, parallel tool calls, static planner prompt, shared JSON options, and refactoring for clarity and performance
- Integrate Microsoft.Extensions.Http.Resilience (Polly v8) for all HTTP-backed providers (Ollama, YandexGPT, MCP)
- Add ResilienceOptions config section and DI registration for named pipelines (Delibera.Local, Delibera.Cloud, Delibera.Default)
- Introduce IDeliberaResiliencePipelineProvider and AddDeliberaResilience/AddDeliberaResiliencePipeline DI helpers
- Refactor providers to use IHttpClientFactory and Polly pipelines; remove hand-rolled retry loops
- Add ResilientHttpClientExtensions.SendAsync for pipeline-based retries
- Update CouncilOptions, README, CHANGELOG, and bump version to 10.2.2
- Add ResilienceExample demo and unit tests for resilience wiring
- Ensure full backward compatibility for legacy and non-DI consumers
@techbuzzz techbuzzz self-assigned this Jun 26, 2026
@techbuzzz techbuzzz merged commit 2c50937 into main Jun 26, 2026
1 check passed
@techbuzzz techbuzzz deleted the develop branch June 26, 2026 19:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant