Upgrade Azure.AI.OpenAI to v2.1.0, add RoadmapCrew & AgentTeamFramework#345
Upgrade Azure.AI.OpenAI to v2.1.0, add RoadmapCrew & AgentTeamFramework#345JustAGhosT merged 35 commits intomainfrom
Conversation
--- updated-dependencies: - dependency-name: WolverineFx dependency-version: 5.17.0 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
--- updated-dependencies: - dependency-name: Npgsql dependency-version: 10.0.1 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
…upport - Added README.md for the Audit Logging Component detailing features, installation, configuration, and usage. - Implemented EfCoreAuditEventRepository for handling audit events using Entity Framework Core. - Enhanced AuditEventRepository to support asynchronous operations and improved error handling. - Added health check endpoints for monitoring the audit logging system. - Introduced Dependency Injection extensions for enterprise connectors and OneLake integration. - Updated feature flag management to use interfaces for better abstraction. - Refactored various repositories to improve error handling and ensure proper disposal of resources. - Removed unnecessary compile items from project files in the MetacognitiveLayer.
…gure MCP servers - Create docs/ecosystem-repo-profiles.md with detailed profiles for all 28 repos across phoenixvc and JustAGhosT orgs (tech stack, AI patterns, CM layers, orchestration assessment) - Update docs/ecosystem-repos-and-issues.md with corrected scores (PhoenixRooivalk 4.0, ChaufHER 3.5, HouseOfVeritas 4.1, content_creation/OmniPost 4.2, twinesandstraps 2.5), marketing names, tiered priorities (1a/1b/1c/1d/2/3), and cross-references to CM #288-#310 - Add .mcp.json with GitHub and Fetch MCP servers for project-level AI tool access - Update .claude/settings.json with ecosystem-related permissions Supports: #288, #305, #309, #310 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ment Project-level servers (.mcp.json): - Azure MCP Server (microsoft/mcp) for CosmosDB, Key Vault, Storage, AKS - Qdrant MCP Server for vector DB operations (FoundationLayer) - Terraform MCP Server for IaC validation and planning - NuGet MCP Server for .NET package management and vulnerability scanning - Sequential Thinking for structured problem decomposition (ReasoningLayer) - Context7 for up-to-date library documentation in prompts - Memory for knowledge graph persistence (MetacognitiveLayer) - Playwright for browser automation testing (UILayer) - Existing: GitHub and Fetch servers retained Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…d build fixes Resolve 10 merge conflicts from tenp branch integration: - AuditLogging: accept tenp's extracted types (enums, models, exceptions, interfaces) while excluding CognitiveMesh-namespaced files from compilation to avoid namespace conflicts with existing FoundationLayer.AuditLogging code - EnterpriseConnectors: extract IFeatureFlagManager interface, add DI extensions - OneLakeIntegration: refactor to depend on IFeatureFlagManager interface, add DI extensions - AuditEventRepository: add CancellationToken support with legacy interface adapters - ReasoningLayer.csproj: exclude AgencyRouter sub-project from compilation (name conflict with AgencyLayer/AgencyRouter), add DefaultItemExcludes for nested obj/bin directories to prevent duplicate assembly attributes from sub-project builds Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ventionBinder Bumps System.CommandLine from 2.0.0-beta4.22272.1 to 2.0.3 Bumps System.CommandLine.NamingConventionBinder from 2.0.0-beta4.22272.1 to 2.0.0-beta5.25306.1 --- updated-dependencies: - dependency-name: System.CommandLine dependency-version: 2.0.3 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: microsoft - dependency-name: System.CommandLine.NamingConventionBinder dependency-version: 2.0.0-beta5.25306.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: microsoft ... Signed-off-by: dependabot[bot] <support@github.com>
Use global:: prefix to resolve FoundationLayer.EnterpriseConnectors from the global namespace, avoiding ambiguous resolution when the file's own namespace (CognitiveMesh.FoundationLayer.EnterpriseConnectors) causes the compiler to look up CognitiveMesh.FoundationLayer instead. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Bumps Azure.AI.OpenAI from 1.0.0-beta.14 to 2.1.0 --- updated-dependencies: - dependency-name: Azure.AI.OpenAI dependency-version: 2.1.0 dependency-type: direct:production update-type: version-update:semver-major dependency-group: azure ... Signed-off-by: dependabot[bot] <support@github.com>
Bumps Microsoft.Data.Sqlite from 9.0.6 to 10.0.3 Bumps System.CommandLine from 2.0.0-beta4.22272.1 to 2.0.3 Bumps System.CommandLine.NamingConventionBinder from 2.0.0-beta4.22272.1 to 2.0.0-beta5.25306.1 --- updated-dependencies: - dependency-name: Microsoft.Data.Sqlite dependency-version: 10.0.3 dependency-type: direct:production update-type: version-update:semver-major dependency-group: microsoft - dependency-name: System.CommandLine dependency-version: 2.0.3 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: microsoft - dependency-name: System.CommandLine.NamingConventionBinder dependency-version: 2.0.0-beta5.25306.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: microsoft ... Signed-off-by: dependabot[bot] <support@github.com>
--- updated-dependencies: - dependency-name: MediatR dependency-version: 14.1.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
--- updated-dependencies: - dependency-name: Polly dependency-version: 8.6.6 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
WS1: AgentTeamEngineBase (thread-safe init, declarative DefineAgents), AgentPipelineExecutor (serialize→execute→deserialize), IAgentTeamPort, AgentDefinitionRecord, AgentJsonDefaults — with 34 unit tests. WS2: IPromptRegistryPort + PromptTemplate + YamlPromptRegistryAdapter for YAML-based prompt management (ADR-002). Extracted 6 RoadmapCrew prompts to *.prompt.yaml files. Added YamlDotNet 16.3.0. WS3: IAgentLLMPort (hexagonal LLM port), LLMBackedSpecializedAgentAdapter (bridges ISpecializedAgentPort to LLM), DeterministicAgentPortAdapter and RecordingAgentPortDecorator for LLM-free testing. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…to dev # Conflicts: # Directory.Packages.props
# Conflicts: # Directory.Packages.props
# Conflicts: # Directory.Packages.props
# Conflicts: # src/UILayer/web/package.json
…into dev # Conflicts: # src/UILayer/web/package.json
…o' into dev # Conflicts: # src/UILayer/web/package.json
…o dev # Conflicts: # src/UILayer/web/package.json
Migrate all LLM call sites from Azure.AI.OpenAI beta (v1.0.0-beta.14) to v2.1.0 stable API across 10+ files in ReasoningLayer, MetacognitiveLayer, FoundationLayer, and AgencyLayer. Key changes: - OpenAIClient → AzureOpenAIClient + ChatClient via GetChatClient() - ChatCompletionsOptions → ChatCompletionOptions with separate message list - ChatRequestSystemMessage → SystemChatMessage (OpenAI.Chat namespace) - response.Value.Choices[0].Message.Content → completion.Value.Content[0].Text - MaxTokens → MaxOutputTokenCount Also fixes System.CommandLine 2.0.3 breaking changes in MeshSimRuntime (SetAction, Parse().InvokeAsync, collection initializers). Adds RoadmapCrew agent team with 6 specialized agents, 23 unit tests, and AgentTeamFramework integration. Build: 0 errors, 0 warnings. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
There was a problem hiding this comment.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
SummarySummary
CoverageCognitiveMesh.Shared - 30.9%
|
| await _initLock.WaitAsync(cancellationToken).ConfigureAwait(false); | ||
| try | ||
| { | ||
| if (_initialized) |
Check warning
Code scanning / CodeQL
Constant condition Warning
Copilot Autofix
AI 25 days ago
Copilot could not generate an autofix suggestion
Copilot could not generate an autofix suggestion for this alert. Try pushing a new commit or if the problem persists contact support.
| catch (Exception ex) | ||
| { | ||
| stopwatch.Stop(); | ||
| _logger.LogError(ex, "Agent {AgentId} failed on task {TaskId}", agentId, task.TaskId); | ||
|
|
||
| return new SpecializedTaskResult | ||
| { | ||
| TaskId = task.TaskId, | ||
| AgentId = agentId, | ||
| Success = false, | ||
| ErrorMessage = ex.Message, | ||
| Duration = stopwatch.Elapsed | ||
| }; | ||
| } |
Check notice
Code scanning / CodeQL
Generic catch clause Note
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 25 days ago
In general, the fix is to replace the generic catch (Exception ex) with more specific catch clauses for the exception types that are expected and can be meaningfully turned into a SpecializedTaskResult, and allow other exceptions to propagate. At minimum, we should avoid trapping exceptions that indicate a serious application/environment failure.
The best targeted fix, without changing external functionality more than necessary, is:
- Keep the existing
catch (OperationCanceledException)as-is and continue rethrowing it. - Add one or more specific catch blocks for common, recoverable failures that can occur during the LLM call (for example,
TimeoutExceptionandTaskCanceledExceptionwhen the LLM port times out or cancels internally). - Replace the generic
catch (Exception ex)with acatchwhose pattern excludes critical exceptions (such asOutOfMemoryException,StackOverflowException,ThreadAbortException) using C#’s exception filters. Since we cannot change behavior outside this file nor know the full exception set from_llmPort, we will keep the logging and result-generation behavior for the non-critical exceptions, but ensure that truly fatal ones are not swallowed.
Concretely, in ExecuteTaskAsync:
- Replace
catch (Exception ex)with separate specific catches forTimeoutExceptionandTaskCanceledException, which both log and return aSpecializedTaskResultdescribing the failure. - Add a final filtered catch:
catch (Exception ex) when (ex is not OutOfMemoryException && ex is not StackOverflowException && ex is not ThreadAbortException)that retains the current behavior for all remaining non-fatal exceptions. - No new imports are required because
TimeoutException,TaskCanceledException, and the fatal exception types are all inSystem.
This keeps the public contract (method still returns SpecializedTaskResult on most errors) while avoiding a purely generic catch and improving robustness for catastrophic failures.
| @@ -114,9 +114,39 @@ | ||
| { | ||
| throw; | ||
| } | ||
| catch (Exception ex) | ||
| catch (TimeoutException ex) | ||
| { | ||
| stopwatch.Stop(); | ||
| _logger.LogError(ex, "Agent {AgentId} timed out on task {TaskId}", agentId, task.TaskId); | ||
|
|
||
| return new SpecializedTaskResult | ||
| { | ||
| TaskId = task.TaskId, | ||
| AgentId = agentId, | ||
| Success = false, | ||
| ErrorMessage = ex.Message, | ||
| Duration = stopwatch.Elapsed | ||
| }; | ||
| } | ||
| catch (TaskCanceledException ex) | ||
| { | ||
| stopwatch.Stop(); | ||
| _logger.LogError(ex, "Agent {AgentId} task {TaskId} was canceled", agentId, task.TaskId); | ||
|
|
||
| return new SpecializedTaskResult | ||
| { | ||
| TaskId = task.TaskId, | ||
| AgentId = agentId, | ||
| Success = false, | ||
| ErrorMessage = ex.Message, | ||
| Duration = stopwatch.Elapsed | ||
| }; | ||
| } | ||
| catch (Exception ex) when (ex is not OutOfMemoryException | ||
| && ex is not StackOverflowException | ||
| && ex is not ThreadAbortException) | ||
| { | ||
| stopwatch.Stop(); | ||
| _logger.LogError(ex, "Agent {AgentId} failed on task {TaskId}", agentId, task.TaskId); | ||
|
|
||
| return new SpecializedTaskResult |
| foreach (var required in task.RequiredCapabilities) | ||
| { | ||
| if (agent.Capabilities.Contains(required, StringComparer.OrdinalIgnoreCase) || | ||
| agent.Domains.Contains(required, StringComparer.OrdinalIgnoreCase)) | ||
| { | ||
| score++; | ||
| } | ||
| } |
Check notice
Code scanning / CodeQL
Missed opportunity to use Where Note
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 25 days ago
In general, to fix this kind of issue, you replace a loop that conditionally processes elements (if (predicate(item)) { ... }) with an explicit filter using Where (or another LINQ method), then iterate or aggregate over the filtered sequence. This expresses the intent more clearly and removes the inner conditional or continue.
In this specific case, the inner loop:
var score = 0;
foreach (var required in task.RequiredCapabilities)
{
if (agent.Capabilities.Contains(required, StringComparer.OrdinalIgnoreCase) ||
agent.Domains.Contains(required, StringComparer.OrdinalIgnoreCase))
{
score++;
}
}is effectively “count how many required items satisfy the predicate.” The most direct LINQ equivalent is:
var score = task.RequiredCapabilities.Count(required =>
agent.Capabilities.Contains(required, StringComparer.OrdinalIgnoreCase) ||
agent.Domains.Contains(required, StringComparer.OrdinalIgnoreCase));This both eliminates the inner foreach and uses an explicit predicate, satisfying the analyzer’s recommendation without changing logic. To implement this, we only need to modify the body of FindBestAgentAsync in src/AgencyLayer/AgentTeamFramework/Adapters/LLMBackedSpecializedAgentAdapter.cs at the region around lines 139–158. LINQ extension methods like Count live in System.Linq; we are not shown the using directives beyond lines 1–5, and none of them include System.Linq. Because we cannot edit unseen parts of the file, we should use the fully qualified method name System.Linq.Enumerable.Count(...) to avoid adding a new using. No other methods, imports, or definitions are required.
| @@ -141,15 +141,11 @@ | ||
|
|
||
| foreach (var agent in _agents.Values) | ||
| { | ||
| var score = 0; | ||
| foreach (var required in task.RequiredCapabilities) | ||
| { | ||
| if (agent.Capabilities.Contains(required, StringComparer.OrdinalIgnoreCase) || | ||
| agent.Domains.Contains(required, StringComparer.OrdinalIgnoreCase)) | ||
| { | ||
| score++; | ||
| } | ||
| } | ||
| var score = System.Linq.Enumerable.Count( | ||
| task.RequiredCapabilities, | ||
| required => | ||
| agent.Capabilities.Contains(required, StringComparer.OrdinalIgnoreCase) || | ||
| agent.Domains.Contains(required, StringComparer.OrdinalIgnoreCase)); | ||
|
|
||
| if (score > bestScore) | ||
| { |
| var dirName = Path.GetFileName(dir); | ||
| if (dirName.Contains(teamId, StringComparison.OrdinalIgnoreCase)) | ||
| { | ||
| var promptsPath = Path.Combine(dir, "Prompts"); |
Check notice
Code scanning / CodeQL
Call to 'System.IO.Path.Combine' may silently drop its earlier arguments Note
Copilot Autofix
AI 25 days ago
Copilot could not generate an autofix suggestion
Copilot could not generate an autofix suggestion for this alert. Try pushing a new commit or if the problem persists contact support.
| } | ||
|
|
||
| // Convention 2: Direct Prompts subdirectory | ||
| var directPath = Path.Combine(_basePath, "Prompts"); |
Check notice
Code scanning / CodeQL
Call to 'System.IO.Path.Combine' may silently drop its earlier arguments Note
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 25 days ago
In general, to avoid Path.Combine silently discarding earlier components when a later component is absolute, replace Path.Combine with Path.Join where you are simply concatenating path segments and do not want absolute segments to override earlier ones.
For this specific case, change the construction of directPath on line 161 from Path.Combine(_basePath, "Prompts") to Path.Join(_basePath, "Prompts"). Path.Join is available in System.IO in modern .NET, requires no extra imports beyond what already exists indirectly, and preserves earlier segments even if a later one is absolute. This change keeps the intended functionality (building {basePath}/Prompts) while eliminating the potential for silent dropping of _basePath if "Prompts" were ever changed to an absolute path.
Only the line defining directPath in FindPromptsDirectory needs modification; no additional methods or definitions are required.
| @@ -158,7 +158,7 @@ | ||
| } | ||
|
|
||
| // Convention 2: Direct Prompts subdirectory | ||
| var directPath = Path.Combine(_basePath, "Prompts"); | ||
| var directPath = Path.Join(_basePath, "Prompts"); | ||
| if (Directory.Exists(directPath)) | ||
| return directPath; | ||
|
|
Summary
Key API migration patterns (Azure.AI.OpenAI v2)
OpenAIClient→AzureOpenAIClient+ChatClientviaGetChatClient(deployment)ChatCompletionsOptions→ChatCompletionOptionswith separate message collectionChatRequestSystemMessage/UserMessage→SystemChatMessage/UserChatMessage(fromOpenAI.Chat)response.Value.Choices[0].Message.Content→completion.Value.Content[0].TextMaxTokens→MaxOutputTokenCountTest plan
dotnet build CognitiveMesh.sln— 0 errors, 0 warningsdotnet test CognitiveMesh.sln— verify all existing + new tests pass🤖 Generated with Claude Code