Marqueur de version + fix bench JSON

- config/main : LOKI_VERSION (git sha), exposé via /api/health et /api/version ;
  affiché dans la barre du haut. Permet de vérifier que l'image déployée est
  bien à jour (cause fréquente de 'les nouveautés n'apparaissent pas').
- Dockerfile : ARG/ENV LOKI_VERSION ; workflow : build-arg = github.sha.
- bench : corrige un bug de précédence d'opérateur dans l'épreuve JSON
  (le tuple de retour était malformé quand l'extraction était partielle).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SVay7z3y7q2gEe54ByAE6N
This commit is contained in:
Claude committed 2026-07-07 16:44:19 +00:00
1 parent 803b28a39a
commit f7cdd254a1
6 files changed
+42 -2

No files matched your search

+9
View File
@@ -41,6 +41,15 @@ export async function getSystemStats(): Promise<SystemStats> {
return res.json();
}
export async function getVersion(): Promise<string> {
try {
const res = await fetch("/api/version");
return (await res.json()).version ?? "?";
} catch {
return "?";
}
}
export interface LoadedModel {
name: string;
on_gpu: boolean;
+16 -1
View File
@@ -1,4 +1,6 @@
import { useEffect, useState } from "react";
import { useStore } from "../store/useStore";
import { getVersion } from "../api/client";
import { ChevronDown, LokiMark } from "./Icon";
import { ModelSelector } from "./ModelSelector";
@@ -7,13 +9,26 @@ export function TopBar() {
const status = useStore((s) => s.status);
const stats = useStore((s) => s.systemStats);
const connected = status?.connected ?? false;
const [version, setVersion] = useState("");
useEffect(() => {
getVersion().then(setVersion);
}, []);
return (
<div className="flex h-[54px] flex-none items-center gap-3.5 border-b-[3px] border-line bg-bar px-4">
<div className="flex items-center gap-2.5">
<LokiMark />
<div className="font-pixel text-[14px] text-white">LOKI</div>
<div className="text-[13px] leading-none text-on-dark-2">agent local</div>
<div
className="text-[13px] leading-none text-on-dark-2"
title={version ? `build ${version}` : undefined}
>
agent local
{version && version !== "dev" && (
<span className="ml-1.5 text-on-dark-3">· {version.slice(0, 7)}</span>
)}
</div>
</div>
<div className="h-6 w-[3px] bg-chrome-3" />