feat(doctor,shell): ollama host-service suggestion + hub-update hint (0.80.0)
Some checks failed
Security / Security check (push) Failing after 2s
Some checks failed
Security / Security check (push) Failing after 2s
Doctor: when the system AI uses an Ollama endpoint that no declared host service covers (host:port match, /v1 suffix stripped), the services panel says so in one sentence with a one-click 'declare as host service' via the new DeclareService RPC — and states honestly that it takes effect after a daemon restart (the restart button sits on the same page). Pure suggestOllamaServiceEndpoint pins every branch. Shell: one slim, dismissible banner after connecting when the release manifest offers a newer hub version; dismissal is persisted per version so each release hints exactly once (pure shouldShowUpdateHint + a widget test through the fake hub). Deliberately manifest-based — Studio and hub versions are independent counters, so a direct comparison would be wrong; unreleased dev skew stays with the per-page classified states. The probe stays inert under the test probe override: its timeout timer leaked into hub_banner_test (the hermeticity class again). Signed-off-by: flemming-it <stefan.a.flemming@googlemail.com>
This commit is contained in:
parent
351c5a82bc
commit
14f824b8ef
13 changed files with 703 additions and 135 deletions
|
|
@ -1221,6 +1221,42 @@ class HubService {
|
|||
}
|
||||
|
||||
/// Composite "doctor" snapshot. One round-trip per piece, run
|
||||
/// Declare a host service in the operator config. Returns true
|
||||
/// when a daemon restart is required for it to take effect
|
||||
/// (always, today — services are read at start).
|
||||
Future<bool> declareService({
|
||||
required String name,
|
||||
required String endpoint,
|
||||
String healthPath = '',
|
||||
List<String> tags = const [],
|
||||
}) => _client.declareService(
|
||||
name: name,
|
||||
endpoint: endpoint,
|
||||
healthPath: healthPath,
|
||||
tags: tags,
|
||||
);
|
||||
|
||||
/// Lightweight update probe for the shell's one-time hint:
|
||||
/// null when the manifest is unreachable / no update / any
|
||||
/// error — the hint simply stays away then.
|
||||
Future<UpdateStatus?> checkHubUpdate() async {
|
||||
try {
|
||||
final r = await _client.checkUpdate().timeout(
|
||||
const Duration(seconds: 3),
|
||||
);
|
||||
if (!r.updateAvailable) return null;
|
||||
return UpdateStatus(
|
||||
channel: r.channel,
|
||||
localVersion: r.localVersion,
|
||||
latestVersion: r.latestVersion,
|
||||
updateAvailable: r.updateAvailable,
|
||||
manifestReachable: r.manifestReachable,
|
||||
);
|
||||
} catch (_) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/// Version string of the RUNNING hub (from CheckUpdate's
|
||||
/// local_version — a local RPC field; the manifest fetch result
|
||||
/// is ignored). Empty when the hub is unreachable. Used by
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue