mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-11-27 20:09:10 +01:00
fix(hermes): keep native account probes on their harness
Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
1 parent
1030fd6d3b
commit
0b47626131
2 files changed
+35
No files matched your search
@@ -511,6 +511,33 @@ describe("agent test-environment route", () => {
|
||||
}
|
||||
});
|
||||
|
||||
it("keeps native Hermes account qualification pending without probing another harness", async () => {
|
||||
mockManagedRuntime("subscription");
|
||||
const { registerServerAdapter, getServerAdapter, unregisterServerAdapter } = await import("../adapters/index.js");
|
||||
const previous = getServerAdapter("paperclip_runner");
|
||||
unregisterServerAdapter("paperclip_runner");
|
||||
registerServerAdapter({ ...externalAdapter, type: "paperclip_runner" });
|
||||
testEnvironmentSpy.mockResolvedValue({ adapterType: "paperclip_runner", status: "warn",
|
||||
checks: [{ code: "acpx_candidate_qualification_only", level: "warn", message: "Pinned runtime verified; Hermes remains pending." }],
|
||||
testedAt: new Date(0).toISOString() });
|
||||
try {
|
||||
const app = await createApp();
|
||||
const res = await request(app)
|
||||
.post("/api/companies/company-1/adapters/paperclip_runner/test-environment")
|
||||
.send({ adapterConfig: { provider: "acpx", acpxAgent: "hermes", model: "hermes-qualification-fixture" },
|
||||
aiConnection: { provider: "anthropic", method: "subscription", mode: "responsible_user" } });
|
||||
expect(res.status).toBe(200);
|
||||
expect(res.body.status).toBe("warn");
|
||||
expect(res.body.checks.map((check: { code: string }) => check.code)).toContain("hermes_connection_qualification_required");
|
||||
expect(testEnvironmentSpy).toHaveBeenCalledTimes(1);
|
||||
expect(mockValidateAiApiKey).not.toHaveBeenCalled();
|
||||
expect(mockMarkAuthenticationFailed).not.toHaveBeenCalled();
|
||||
} finally {
|
||||
unregisterServerAdapter("paperclip_runner");
|
||||
if (previous) registerServerAdapter(previous);
|
||||
}
|
||||
});
|
||||
|
||||
it("passes one-shot provider credentials only to the probe, never persistence normalization", async () => {
|
||||
const app = await createApp();
|
||||
const res = await request(app)
|
||||
|
||||
@@ -3500,6 +3500,14 @@ export function agentRoutes(
|
||||
}
|
||||
return result;
|
||||
}
|
||||
if (adapterType === "paperclip_runner" && context.config.provider === "acpx" && context.config.acpxAgent === "hermes") {
|
||||
// Hermes consumes the managed account through its native runtime. A
|
||||
// different provider CLI cannot prove that projection or its model access.
|
||||
result.status = "warn";
|
||||
result.checks.push({ code: "hermes_connection_qualification_required", level: "warn",
|
||||
message: "The Hermes runtime is verified. This account and model still need an operator-controlled qualification run." });
|
||||
return result;
|
||||
}
|
||||
if (!result.checks.some(check => check.code.includes("hello_probe"))) {
|
||||
const providerAdapter = context.config.managedAiRouting ? aiRoutingHarness(adapterType, context.config.provider, context.config.acpxAgent) : { anthropic: "claude_local", openai: "codex_local", openrouter: "opencode_local", xai: "grok_local", google: "gemini_local" }[binding.provider];
|
||||
const probe = await requireServerAdapter(providerAdapter).testEnvironment({ ...context, adapterType: providerAdapter, config: { ...context.config, engine: "cli" } });
|
||||
|
||||
Reference in new issue
Block a user