Skip to content

fix: add _models/.cache/ to gitignore and HF cache comment#64

Open
vlordier wants to merge 6 commits intoLiquid4All:mainfrom
vlordier:fix/gitignore-cache-comment
Open

fix: add _models/.cache/ to gitignore and HF cache comment#64
vlordier wants to merge 6 commits intoLiquid4All:mainfrom
vlordier:fix/gitignore-cache-comment

Conversation

@vlordier
Copy link
Copy Markdown

@vlordier vlordier commented Mar 6, 2026

Summary

Address Copilot AI review comments from PR #54:

  • Add _models/.cache/ to .gitignore to prevent accidental cache commits
  • Add comment about HuggingFace cache location (HF_HOME, HF_HUB_CACHE, XDG_CACHE_HOME)

Changes

  • 2 files changed, 5 insertions(+)

Testing

  • No code changes, just configuration/doc updates

vlordier added 5 commits March 6, 2026 21:46
- Tool Result Compression: smart summarization for large tool outputs
  (directory listings, search results, JSON data)
- Request Deduplication: 500ms debounce on send button to prevent
  duplicate requests from rapid clicks
- Config Hot Reload: poll config file for changes, reload without
  restart, show toast notification
- Error Boundary: timeout wrapper (120s) around tool execution,
  graceful error messages instead of crashing agent loop
- Add 13 tests for settings.rs (AppSettings, SamplingConfig, config hot reload)
- Add 12 tests for chat.rs compression functions (truncate, compress directory, search, JSON)
- Total tests: 392 (up from 365)
- Coverage: 42.5% (up from 39.5%)
- Add ModelStatus tests (serialization, healthy/unhealthy states)
- Add SamplingOverrides serialization tests
- Add InferenceClient tests for:
  - LM Studio URL construction and model selection
  - Tool call format (NativeJson vs Pythonic)
  - Fallback chain exhaustion (AllModelsUnavailable)
  - is_retriable for various HTTP status codes
  - Error repair from malformed tool calls
- Total tests: 417 (up from 392)
- Add tests for data_dir(), cache_dir(), resolve_db_path()
- Add rotate_log_file() tests (creates rotated copies, handles missing files)
- Add filter_by_enabled_servers() tests (filters correctly, handles missing/invalid config)
- Add resolve_vision_model() tests (returns None without config)
- Add filter_tools_by_allowlist() test (doesn't panic without config)
- Add load_override_file() tests (parses config, returns empty for missing)
- Total tests: 430 (up from 417)
- Coverage: 43.3% (up from 42.5%)
Address Copilot AI review comments from PR Liquid4All#54:
- Add _models/.cache/ to .gitignore to prevent accidental cache commits
- Add comment about HuggingFace cache location (HF_HOME, HF_HUB_CACHE, XDG_CACHE_HOME)
Copilot AI review requested due to automatic review settings March 6, 2026 22:16
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR is described as a small fix to prevent HuggingFace cache artifacts from being committed and to document HF cache env vars, but the diff also introduces substantial new frontend UI/state and Rust/Tauri backend behavior (settings store, config hot-reload polling, inference client/type updates, and new tests).

Changes:

  • Add _models/.cache/ to the example app’s .gitignore and document HuggingFace cache env vars in config.yaml.
  • Add new frontend settings/config-watch plumbing (Zustand store, UI toast, message input debouncing) and large global stylesheet.
  • Add/modify Rust/Tauri commands and inference client/types, plus new/updated tests.

Reviewed changes

Copilot reviewed 9 out of 11 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
src/styles.css Adds a large global stylesheet including new UI elements and animations.
src/stores/settingsStore.ts Introduces a Zustand settings store with config hot-reload polling.
src/components/Chat/MessageInput.tsx Adds debounced send behavior and an input toolbar.
src/App.tsx Adds a config-reload toast and starts/stops config watching.
src-tauri/src/lib.rs Adds/updates app setup logic and a substantial set of unit tests.
src-tauri/src/inference/types.rs Adds/updates shared inference request/response types and tests.
src-tauri/src/inference/client.rs Adds/updates inference client logic (streaming, repair, status) and tests.
src-tauri/src/commands/settings.rs Adds config hot-reload check logic and settings-related commands/tests.
examples/localcowork/_models/config.yaml Adds documentation about HuggingFace cache defaults/env vars.
examples/localcowork/.gitignore Ignores _models/.cache/ in the example project.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +11 to +17
import type {
McpServerStatus,
ModelsOverview,
PermissionGrant,
SamplingConfig,
} from "../types";

Copy link

Copilot AI Mar 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file imports types from ../types, but there is no src/types.ts or src/types/ in this package, so the import will fail to resolve. Either add the missing types module or update the import path to the correct location (e.g., the existing types under examples/localcowork/src/types if that's intended).

Suggested change
import type {
McpServerStatus,
ModelsOverview,
PermissionGrant,
SamplingConfig,
} from "../types";
// Local type definitions for entities returned from the backend.
// These are intentionally permissive to avoid coupling this UI layer
// to a specific backend type shape while keeping types resolvable.
interface McpServerStatus {
[key: string]: unknown;
}
interface ModelsOverview {
[key: string]: unknown;
}
interface PermissionGrant {
[key: string]: unknown;
}
interface SamplingConfig {
[key: string]: unknown;
}

Copilot uses AI. Check for mistakes.
Comment thread src/styles.css
Comment on lines +3356 to +3365
.python-env-name {
font-weight: 600;
color: var(--color-text-primary);
font-size: 14px;
}

.python-env-status {
font-size: 12px;
color: var(--color-text-secondary);
}
Copy link

Copilot AI Mar 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These rules reference CSS variables --color-text-primary / --color-text-secondary, but those variables are not defined in :root (only --color-text, --color-text-muted, etc.). This makes the color declarations invalid and can lead to unexpected inherited colors. Replace with existing variables or define the missing variables in :root.

Copilot uses AI. Check for mistakes.
Comment thread src/styles.css
Comment on lines +1049 to +1057
@keyframes pulse {
0%,
100% {
opacity: 0.6;
}
50% {
opacity: 0.3;
}
}
Copy link

Copilot AI Mar 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@keyframes pulse is defined twice in this file. The later definition will override the earlier one, so elements relying on the first pulse animation will silently change behavior. Rename one of the animations (e.g., pulseDots vs pulseOpacity) or consolidate into a single definition.

Copilot uses AI. Check for mistakes.
Comment thread src-tauri/src/lib.rs
let root = resolve_project_root();
assert!(root.is_absolute());
}

Copy link

Copilot AI Mar 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test is missing the #[test] attribute, so it will never run and won't catch regressions. Add #[test] above the function.

Suggested change
#[test]

Copilot uses AI. Check for mistakes.
Comment thread src-tauri/src/lib.rs
Comment on lines +721 to +724
fn test_resolve_db_path_returns_sqlite_path() {
let path = resolve_db_path();
assert!(path.starts_with('/')); // Should be absolute path
assert!(path.ends_with(".db"));
Copy link

Copilot AI Mar 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test asserts the resolved DB path starts with '/', which will fail on Windows. Use Path::new(&path).is_absolute() (or similar) instead of checking the leading character.

Copilot uses AI. Check for mistakes.
Comment on lines +484 to +496
let modified_secs = modified
.duration_since(SystemTime::UNIX_EPOCH)
.map_err(|e| format!("Time error: {}", e))?
.as_secs();

let last_modified = CONFIG_LAST_MODIFIED.load(Ordering::SeqCst);

if modified_secs > last_modified {
CONFIG_LAST_MODIFIED.store(modified_secs, Ordering::SeqCst);
Ok(true)
} else {
Ok(false)
}
Copy link

Copilot AI Mar 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check_config_reload will return true on the first call whenever the config file exists (since CONFIG_LAST_MODIFIED starts at 0). That will trigger an unnecessary reload/toast the first time the watcher runs. Consider treating the first observation as the baseline (store modified_secs and return false), or initialize CONFIG_LAST_MODIFIED during app startup.

Copilot uses AI. Check for mistakes.
_models/*.gguf
_models/*.bin
_models/*.safetensors
_models/.cache/
Copy link

Copilot AI Mar 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR description says this is only a .gitignore update and a comment about the HuggingFace cache, but this PR also includes substantial frontend and Rust/Tauri code changes (new UI, config watcher, inference changes, etc.). Please update the PR description/title to match the actual scope, or split these changes into separate PRs so review risk is manageable.

Copilot uses AI. Check for mistakes.
Comment on lines +142 to +143
if (interval) {
clearInterval(interval);
Copy link

Copilot AI Mar 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

stopConfigWatch references interval, but only configWatchInterval is in scope. This will throw at runtime / fail type-checking and will prevent the polling interval from being cleared. Use the configWatchInterval value from get() (and clear that), then set it to null.

Suggested change
if (interval) {
clearInterval(interval);
if (configWatchInterval) {
clearInterval(configWatchInterval);

Copilot uses AI. Check for mistakes.
refactor: document HuggingFace cache env var in environment configuration
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants