feat: ship agent-first mission control v0.2.57
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
using Nexus.Api.Data;
|
||||
using Nexus.Api.Integrations;
|
||||
using Nexus.Api.Services;
|
||||
|
||||
namespace Nexus.Api.Routing;
|
||||
|
||||
@@ -12,24 +12,30 @@ public sealed record RoutingTarget(
|
||||
string Detail);
|
||||
|
||||
public sealed class ModelRoutingService(
|
||||
IAgentRuntime runtime)
|
||||
IOpenClawControlService openClaw)
|
||||
{
|
||||
public async Task<IReadOnlyCollection<RoutingTarget>> GetStatusAsync(
|
||||
CancellationToken cancellationToken)
|
||||
{
|
||||
var runtimeStatus = await runtime.GetStatusAsync(cancellationToken);
|
||||
var response = await openClaw.GetModelsAsync(cancellationToken);
|
||||
if (response.Items.Count == 0)
|
||||
return Array.Empty<RoutingTarget>();
|
||||
|
||||
return
|
||||
[
|
||||
new(1, "OpenClaw", "deepseek/deepseek-v4-flash", "Programmer agent",
|
||||
runtimeStatus.Status,
|
||||
"Routed through OpenClaw policy"),
|
||||
new(2, "OpenClaw", "deepseek/deepseek-v4-pro", "Reviewer agent",
|
||||
runtimeStatus.Status,
|
||||
"Routed through OpenClaw policy"),
|
||||
new(3, "OpenClaw", "openai/gpt-5.3-chat-latest", "Iris orchestrator",
|
||||
runtimeStatus.Status,
|
||||
"Routed through OpenClaw policy")
|
||||
];
|
||||
return response.Items
|
||||
.OrderByDescending(model =>
|
||||
string.Equals(model.Provider, "openai", StringComparison.OrdinalIgnoreCase))
|
||||
.ThenBy(model => model.Name, StringComparer.OrdinalIgnoreCase)
|
||||
.Select((model, index) => new RoutingTarget(
|
||||
index + 1,
|
||||
$"OpenClaw / {model.Provider}",
|
||||
model.Id,
|
||||
string.Equals(model.Provider, "openai", StringComparison.OrdinalIgnoreCase)
|
||||
? "Primary agent runtime"
|
||||
: "Configured Gateway fallback",
|
||||
model.Available ? OperationalStatus.Online : OperationalStatus.Degraded,
|
||||
model.Available
|
||||
? "Configured and resolved by OpenClaw"
|
||||
: model.Reason ?? "Configured in OpenClaw, currently unavailable"))
|
||||
.ToArray();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user