feat(stability): unify readiness and recovery
CI - Build & Test / Backend (.NET) (push) Successful in 45s
CI - Build & Test / Backend integration (PostgreSQL/Toxiproxy) (push) Failing after 1m0s
CI - Build & Test / Frontend (Vue/TS) (push) Successful in 2m49s
CI - Build & Test / Security Check (push) Successful in 7s
CI - Build & Test / Deploy Nexus (push) Has been skipped
CI - Build & Test / Backend (.NET) (push) Successful in 45s
CI - Build & Test / Backend integration (PostgreSQL/Toxiproxy) (push) Failing after 1m0s
CI - Build & Test / Frontend (Vue/TS) (push) Successful in 2m49s
CI - Build & Test / Security Check (push) Successful in 7s
CI - Build & Test / Deploy Nexus (push) Has been skipped
This commit is contained in:
@@ -5,6 +5,7 @@ using System.Diagnostics;
|
||||
using System.Security.Claims;
|
||||
using Nexus.Api.DTOs;
|
||||
using Nexus.Api.Integrations;
|
||||
using Nexus.Api.Http;
|
||||
using Nexus.Api.Repositories;
|
||||
using Nexus.Api.Services;
|
||||
|
||||
@@ -160,9 +161,15 @@ public class AgentsController(
|
||||
public async Task<IResult> SaveConfigFile(string id, string fileName, [FromBody] SaveConfigRequest request, CancellationToken ct)
|
||||
{
|
||||
if (request.Content is null)
|
||||
return Results.BadRequest(new { error = "Content is required." });
|
||||
return Results.ValidationProblem(new Dictionary<string, string[]>
|
||||
{
|
||||
["content"] = ["Content is required."]
|
||||
});
|
||||
if (string.IsNullOrWhiteSpace(request.ExpectedHash))
|
||||
return Results.BadRequest(new { error = "ExpectedHash is required." });
|
||||
return Results.ValidationProblem(new Dictionary<string, string[]>
|
||||
{
|
||||
["expectedHash"] = ["ExpectedHash is required."]
|
||||
});
|
||||
|
||||
try
|
||||
{
|
||||
@@ -170,7 +177,10 @@ public class AgentsController(
|
||||
var idempotencyKey = Request.Headers["Idempotency-Key"].FirstOrDefault()?.Trim();
|
||||
if (string.IsNullOrWhiteSpace(idempotencyKey))
|
||||
{
|
||||
return Results.BadRequest(new { error = "Idempotency-Key header is required." });
|
||||
return Results.ValidationProblem(new Dictionary<string, string[]>
|
||||
{
|
||||
["Idempotency-Key"] = ["Idempotency-Key header is required."]
|
||||
});
|
||||
}
|
||||
|
||||
var invocation = OpenClawInvocationContext.Create(
|
||||
@@ -204,15 +214,15 @@ public class AgentsController(
|
||||
}
|
||||
catch (OpenClawAgentConfigurationConflictException ex)
|
||||
{
|
||||
return Results.Json(
|
||||
new
|
||||
return NexusHttpResults.Problem(
|
||||
StatusCodes.Status409Conflict,
|
||||
ex.Message,
|
||||
NexusProblemCodes.Conflict,
|
||||
extensions: new Dictionary<string, object?>
|
||||
{
|
||||
code = ex.Code,
|
||||
message = ex.Message,
|
||||
ex.ExpectedHash,
|
||||
ex.CurrentHash
|
||||
},
|
||||
statusCode: StatusCodes.Status409Conflict);
|
||||
["expectedHash"] = ex.ExpectedHash,
|
||||
["currentHash"] = ex.CurrentHash
|
||||
});
|
||||
}
|
||||
catch (OpenClawAgentConfigurationValidationException ex)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user