Skip to content

Linger is An Open-Source Personal Agent That Runs Fully on Your PC. We aim to break Big Tech’s grip on AI by bringing powerful local AI to everyday computers through efficient model–harness co-design, so everyone can run their own.

fix(agent): do not name the Runtime when the Agent Service cannot start a Run

xiaoke12345678ed89522dbfa4
diff --git a/apps/node-services/src/agent/executor/run-loop.ts b/apps/node-services/src/agent/executor/run-loop.ts
index 61f668ac..bca60791 100644
--- a/apps/node-services/src/agent/executor/run-loop.ts
+++ b/apps/node-services/src/agent/executor/run-loop.ts
@@ -2021,7 +2021,12 @@ const classifiedRunFailure = (
: error instanceof StreamingAgentRunLimitError
? "response_too_large"
: "unclassified",
- runtimeType,
+ // A start the Agent Service refused never reached the Runtime, so
+ // naming it would point the user at the wrong component.
+ error instanceof ProviderRunStartError &&
+ !(error instanceof ProviderRunAdmissionUnavailableError)
+ ? undefined
+ : runtimeType,
);
const runFailure = (
diff --git a/apps/node-services/tests/agent/executor/run-loop.test.ts b/apps/node-services/tests/agent/executor/run-loop.test.ts
index 506f05b1..018b946d 100644
--- a/apps/node-services/tests/agent/executor/run-loop.test.ts
+++ b/apps/node-services/tests/agent/executor/run-loop.test.ts
@@ -2497,6 +2497,29 @@ describe("RunLoop", () => {
harness.state.close();
});
+ it("does not blame the Runtime for a Run the Agent Service could not start", async () => {
+ const harness = createHarness();
+ harness.provider.startErrors.push(
+ new ProviderRunStartError("definitely_not_started", "first failure"),
+ new ProviderRunStartError("definitely_not_started", "second failure"),
+ );
+ const runId = enqueue(harness.state, message("initial"));
+
+ harness.execution.start();
+ await vi.waitFor(() =>
+ expect(harness.state.getLocalRun(runId)?.status).toBe("failed"),
+ );
+ const terminal = harness.state.getLocalRun(runId)?.terminal;
+ expect(terminal).toMatchObject({
+ type: "failed",
+ failure: { code: "unclassified" },
+ });
+ expect(terminal?.type === "failed" && terminal.failure).not.toHaveProperty(
+ "runtime_type",
+ );
+ harness.state.close();
+ });
+
it("publishes a classified cold-start failure without checkpointing an empty session or retrying", async () => {
const publisher = new RecordingRuntimeStatusPublisher();
const harness = createHarness(undefined, undefined, publisher, {