free-coding-models 0.5.54 โ 0.5.55
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Changelog v0.5.55 - 2026-07-25
|
|
2
|
+
|
|
3
|
+
### Fixed
|
|
4
|
+
- ๐ณ **Docker "Tool mode save failed" โ clear root cause + actionable fix** ([#119](https://github.com/vava-nessa/free-coding-models/issues/119)) โ when the `fcm-data` volume was created with files owned by a different UID (older images, host bind-mounts), `chmod -R 777` had no effect because Linux checks file ownership, not mode bits. Two-layer fix:
|
|
5
|
+
1. `src/core/config.js` โ `saveConfig()` now detects `EACCES` / `EPERM` and surfaces a friendly hint via the new exported `formatPermissionHint()` function. The hint explains *why* `chmod` is the wrong tool and gives the exact `docker compose down && docker volume rm <vol> && docker compose up` fix.
|
|
6
|
+
2. `docker-entrypoint.sh` โ proactive ownership check at container startup. If a config file is owned by a different UID than the running `fcm` user, the entrypoint logs a loud `โ ๏ธ WARNING` block *before* the first save attempt fails with a confusing error.
|
|
7
|
+
|
|
8
|
+
### Closed (upstream, no FCM-side fix possible)
|
|
9
|
+
- ๐ **Caveman CLI install fails on Node 26** ([#101](https://github.com/vava-nessa/free-coding-models/issues/101)) โ this is upstream in `@juliusbrussee/caveman-code`. `better-sqlite3 v11.10.0` doesn't compile against Node.js v26 (V8 API churn: `GetPrototype` โ `GetPrototypeV2`, etc.). FCM surfaces the npm error verbatim but cannot fix caveman-code's deps. Workaround: use Node v22 or v24 (both LTS, both supported by `better-sqlite3@11`).
|
|
10
|
+
|
|
11
|
+
### Maintenance
|
|
12
|
+
- ๐งช **+6 new unit tests** for `formatPermissionHint()` (`test/config-permission-hint.test.js`) โ covers empty string for non-permission errors, EACCES/EPERM detection, Docker volume mention, "chmod is not the fix" wording, multi-line output.
|
|
13
|
+
|
|
14
|
+
### Pre-flight checks
|
|
15
|
+
- 590/590 tests pass (`pnpm test`)
|
|
16
|
+
- `vite build` succeeds
|
|
17
|
+
- All three surfaces (CLI, web dashboard, Docker) compatible
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "free-coding-models",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.55",
|
|
4
4
|
"description": "Find the fastest coding LLM models in seconds โ ping free models from multiple providers, pick the best one for OpenCode, Cursor, or any AI coding assistant.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"nvidia",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
],
|
|
54
54
|
"scripts": {
|
|
55
55
|
"start": "node bin/free-coding-models.js",
|
|
56
|
-
"test": "node --test test/test.js test/fcm-agent-core.test.js test/patch-openclaw.test.js test/provider-metadata.test.js",
|
|
56
|
+
"test": "node --test test/test.js test/fcm-agent-core.test.js test/patch-openclaw.test.js test/provider-metadata.test.js test/config-permission-hint.test.js",
|
|
57
57
|
"prepack": "npm run build:web",
|
|
58
58
|
"dev": "node scripts/dev-web.mjs",
|
|
59
59
|
"dev:web": "node scripts/dev-web.mjs",
|
package/src/core/config.js
CHANGED
|
@@ -760,7 +760,16 @@ export function saveConfig(config, options = {}) {
|
|
|
760
760
|
// ๐ Write failed - explicit error instead of silent failure
|
|
761
761
|
let errorMsg = `Failed to write config: ${writeError.message}`
|
|
762
762
|
try { unlinkSync(tempPath) } catch { /* ignore temp cleanup failures */ }
|
|
763
|
-
|
|
763
|
+
|
|
764
|
+
// ๐ Detect permission errors and surface a Docker-specific hint. This
|
|
765
|
+
// ๐ happens when a volume was created with files owned by another UID
|
|
766
|
+
// ๐ (e.g. older images running as root, or a host bind-mount where the
|
|
767
|
+
// ๐ directory is owned by a different user). chmod 777 does NOT fix this
|
|
768
|
+
// ๐ because Linux checks file ownership, not mode bits, for write access.
|
|
769
|
+
if (writeError?.code === 'EACCES' || writeError?.code === 'EPERM') {
|
|
770
|
+
errorMsg += formatPermissionHint(writeError)
|
|
771
|
+
}
|
|
772
|
+
|
|
764
773
|
// ๐ Try to restore from backup if we have one
|
|
765
774
|
if (backupCreated) {
|
|
766
775
|
try {
|
|
@@ -775,6 +784,37 @@ export function saveConfig(config, options = {}) {
|
|
|
775
784
|
}
|
|
776
785
|
}
|
|
777
786
|
|
|
787
|
+
/**
|
|
788
|
+
* ๐ formatPermissionHint โ build a friendly hint for the most common Docker
|
|
789
|
+
* ๐ permission failure (config file owned by a different UID than the running
|
|
790
|
+
* ๐ process). Returns an empty string for non-permission errors.
|
|
791
|
+
*
|
|
792
|
+
* ๐ Common symptom (issue #119): "Tool mode save failed" in the web dashboard
|
|
793
|
+
* ๐ even after `chmod -R 777`, because chmod doesn't change ownership.
|
|
794
|
+
*/
|
|
795
|
+
export function formatPermissionHint(writeError) {
|
|
796
|
+
// ๐ Only emit the hint for actual permission errors โ silently no-op for
|
|
797
|
+
// ๐ anything else so the caller can safely concatenate the result.
|
|
798
|
+
if (writeError?.code !== 'EACCES' && writeError?.code !== 'EPERM') return ''
|
|
799
|
+
const lines = []
|
|
800
|
+
lines.push('')
|
|
801
|
+
lines.push(' ๐ก This is almost always a file-ownership issue, not a chmod issue.')
|
|
802
|
+
lines.push(' The config file is owned by a different user than the one running FCM.')
|
|
803
|
+
try {
|
|
804
|
+
const stat = statSync(CONFIG_PATH)
|
|
805
|
+
lines.push(` File owner UID: ${stat.uid}, current process UID: ${process.getuid?.() ?? 'n/a'}`)
|
|
806
|
+
} catch { /* stat may also fail */ }
|
|
807
|
+
lines.push('')
|
|
808
|
+
lines.push(' Fix in Docker:')
|
|
809
|
+
lines.push(' docker compose down')
|
|
810
|
+
lines.push(' docker volume rm <project>_fcm-data # or the volume name from `docker volume ls`')
|
|
811
|
+
lines.push(' docker compose up # recreates the volume with the right UID')
|
|
812
|
+
lines.push('')
|
|
813
|
+
lines.push(' Fix on host (bind mount):')
|
|
814
|
+
lines.push(' sudo chown $(id -u):$(id -g) ~/.free-coding-models.json')
|
|
815
|
+
return '\n' + lines.join('\n')
|
|
816
|
+
}
|
|
817
|
+
|
|
778
818
|
/**
|
|
779
819
|
* ๐ createBackup: Creates a timestamped backup of the current config file.
|
|
780
820
|
* ๐ Keeps only the 5 most recent backups to avoid disk space issues.
|