mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-12 21:53:00 -06:00
refactor(llama-cpp): clarify terminal cleanup contract
This commit is contained in:
@@ -937,7 +937,7 @@ describe("llama.cpp inference provider", () => {
|
||||
expect(mocks.llamaDispose).toHaveBeenCalledOnce();
|
||||
});
|
||||
|
||||
it("keeps a failed best-effort cleanup as one disposal attempt", async () => {
|
||||
it("keeps a failed cleanup terminal", async () => {
|
||||
await collectTestEvents();
|
||||
mocks.contextDispose.mockRejectedValueOnce(new Error("context cleanup failed"));
|
||||
|
||||
|
||||
@@ -307,8 +307,9 @@ function disposeLlamaCppInferenceRuntime(state: LlamaCppInferenceRuntimeState):
|
||||
return state.disposePromise;
|
||||
}
|
||||
state.lifecycle = "closing";
|
||||
// Plugin services stop once, and node-llama-cpp disposers mark themselves
|
||||
// disposed before awaiting cleanup. The first disposal attempt is authoritative.
|
||||
// node-llama-cpp disposers are one-shot and child cleanup releases the
|
||||
// parent's disposal guard. Do not force parent cleanup after a child rejects:
|
||||
// the retained guard can make that parent disposer wait forever.
|
||||
state.disposePromise = serialize(state, async () => {
|
||||
await disposeLoadedModel(state);
|
||||
if (state.llamaInstance) {
|
||||
|
||||
Reference in New Issue
Block a user