Skip to content

Commit 4b1fc01

Browse files
committed
refactor(local-ai): clarify managed model probe
1 parent ccd64bb commit 4b1fc01

4 files changed

Lines changed: 15 additions & 5 deletions

File tree

‎src/OpenClaw.Connection/LocalAi/LlamaServerClient.cs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ private static bool PathsEqual(string left, string right)
134134

135135
internal interface ILlamaServerClient : IDisposable
136136
{
137-
Task<LlamaServerRouterProbeResult> ProbeRouterAsync(
137+
Task<LlamaServerRouterProbeResult> ProbeManagedModelAsync(
138138
Uri endpoint,
139139
string modelAlias,
140140
string expectedModelPath,
@@ -164,7 +164,7 @@ internal LlamaServerClient(HttpMessageHandler handler)
164164
};
165165
}
166166

167-
public async Task<LlamaServerRouterProbeResult> ProbeRouterAsync(
167+
public async Task<LlamaServerRouterProbeResult> ProbeManagedModelAsync(
168168
Uri endpoint,
169169
string modelAlias,
170170
string expectedModelPath,

‎src/OpenClaw.Connection/LocalAi/LlamaServerInferenceClient.cs‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ public sealed record LlamaServerInferenceVerification(
1212

1313
public interface ILlamaServerInferenceClient : IDisposable
1414
{
15+
/// <summary>
16+
/// Sends one bounded OpenAI-compatible request to the managed endpoint, intentionally triggering
17+
/// lazy model loading during setup. Verifies the response plus token and timing evidence without
18+
/// returning or logging prompt or response content.
19+
/// </summary>
1520
Task<LlamaServerInferenceVerification> VerifyAsync(
1621
Uri endpoint,
1722
string modelAlias,
@@ -45,6 +50,11 @@ internal LlamaServerInferenceClient(HttpMessageHandler handler)
4550
};
4651
}
4752

53+
/// <summary>
54+
/// Sends one bounded OpenAI-compatible request to the managed endpoint, intentionally triggering
55+
/// lazy model loading during setup. Verifies the response plus token and timing evidence without
56+
/// returning or logging prompt or response content.
57+
/// </summary>
4858
public async Task<LlamaServerInferenceVerification> VerifyAsync(
4959
Uri endpoint,
5060
string modelAlias,

‎src/OpenClaw.Connection/LocalAi/LlamaServerRuntimeService.cs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ private async Task<LocalAiRuntimeSnapshot> EnsureStartedCoreAsync(CancellationTo
240240
}
241241
if (ownership.Endpoint is not null)
242242
{
243-
LlamaServerRouterProbeResult probe = await _client.ProbeRouterAsync(
243+
LlamaServerRouterProbeResult probe = await _client.ProbeManagedModelAsync(
244244
ownership.Endpoint,
245245
install.Manifest.ModelAlias,
246246
install.ModelPath,
@@ -340,7 +340,7 @@ private async Task<LocalAiRuntimeSnapshot> RefreshCoreAsync(CancellationToken ca
340340
if (ownership.Endpoint is null)
341341
return Publish(LocalAiRuntimeState.Starting, LocalAiOwnership.CompanionManaged, "The local AI router has not opened its endpoint yet.", _managedProcess.ProcessId, _managedProcess.StartedAtUtc);
342342

343-
LlamaServerRouterProbeResult probe = await _client.ProbeRouterAsync(
343+
LlamaServerRouterProbeResult probe = await _client.ProbeManagedModelAsync(
344344
ownership.Endpoint,
345345
install.Manifest.ModelAlias,
346346
install.ModelPath,

‎tests/OpenClaw.Connection.Tests/LocalAiPortLifecycleTests.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ private sealed class FakeClient(List<string> events) : ILlamaServerClient
443443
{
444444
public List<int> ProbedPorts { get; } = [];
445445

446-
public Task<LlamaServerRouterProbeResult> ProbeRouterAsync(
446+
public Task<LlamaServerRouterProbeResult> ProbeManagedModelAsync(
447447
Uri endpoint,
448448
string modelAlias,
449449
string expectedModelPath,

0 commit comments

Comments
 (0)