fix: address all differential review feedback

1. Reduced repeat_penalty to 1.15 to avoid degrading normal generation.
2. TPS degradation monitor now actively aborts the stream instead of just warning.
3. Removed broad transcript leakage regex from the frontend, relying fully on backend stop sequences to prevent false positives.
4. Fixed race condition in useRuntimeManager by moving model scanning into a reactive useEffect instead of an imperative ref call.
5. Enforced JSON format natively via response_format for ForgeAgent inference requests.
This commit is contained in:
Evandro Fonseca Junior committed 2026-04-03 23:16:41 -03:00
1 parent 943bf6321f
commit 36b80bc0a8
6 files changed
+273 -73

No files matched your search

@@ -175,9 +175,6 @@ export function useRuntimeManager() {
if (active) {
setDraftState((current) => reconcileDraftState(current, next));
setLoading(false);
// Auto-scan models on startup so the sidebar shows all available models
const modelsDir = next.config.models_dir ?? "";
scanModelsRef.current?.(modelsDir).catch(() => undefined);
}
})
.catch(() => {
@@ -196,6 +193,14 @@ export function useRuntimeManager() {
};
}, [refresh]);
// Auto-scan models when the configured directory changes
useEffect(() => {
const modelsDir = draftState.liveSnapshot.config.models_dir;
if (modelsDir) {
scanModels(modelsDir).catch(() => undefined);
}
}, [draftState.liveSnapshot.config.models_dir, scanModels]);
const openDraft = useCallback(() => {
setDraftState((current) => {
const draftConfig = current.isDirty ? current.draftConfig : cloneConfig(current.savedBaseline);
@@ -320,8 +325,6 @@ export function useRuntimeManager() {
[],
);
const scanModelsRef = useRef<(dir: string | null) => Promise<void>>();
// Phase 4: Model scanning for validation
const scanModels = useCallback(async (dirPath: string | null) => {
const resolvedDir = dirPath ?? "";
@@ -378,8 +381,6 @@ export function useRuntimeManager() {
}
}, []);
scanModelsRef.current = scanModels;
const commitSavedSnapshot = useCallback((next: RuntimeSnapshot, keepOpen: boolean) => {
setDraftState((current) => ({
...current,