fix: remove one machine's addresses and paths from the shipped defaults
The plugin was developed against an Ollama on a private LAN address, and that address had reached places that ship: - the `config` parameter description the MODEL reads on every request; - the commented example in `cordis.patch.yml`, the layer every profile applies; - `scripts/smoke.mjs` and `scripts/measure.mjs` endpoint defaults; - both measure scripts' default workspace, which was an absolute local path and named a private repository; - README examples and test fixtures. All of them now use `http://127.0.0.1:11434`, which is Ollama's documented default and belongs to no particular machine — kept rather than emptied because `validateSettings` requires an http(s) URL, so an empty default would turn every call into INVALID_SETTINGS until someone configured it. Test fixtures use 192.0.2.10 instead: TEST-NET-1 is reserved for documentation and cannot point at a host anybody runs. The `focus` and `config` examples are generic, and the workspace defaults are the working directory. Two script bugs surfaced once the defaults stopped pointing at a live box, and are fixed here. `measure.mjs` built its own configuration literal, which was ten fields short of the schema — harmless while nothing validated it, and a refused call the moment `execute` began checking the section it was handed; it now resolves its configuration through the plugin's own `Config`, so it cannot drift again. It also crashed on a failed search (`first.index.scanned` of a result that has no index) instead of reporting the endpoint it could not reach, which is now the ordinary case. `scope-measure.mjs` divided by a scope that does not exist in any workspace without focus markers, and now says so. Also corrects `cordis.patch.yml`'s description of what the row registers: in 0.1.7 the exported `Config` is the settings registration, not a namespace on `ctx.settings`.
This commit is contained in:
1 parent
7261d46ee2
commit
a48e05585e
7 files changed
+93
-48
No files matched your search
+5
-3
@@ -42,8 +42,10 @@ test('Config fills every field from an empty input, so apply can rely on default
|
||||
})
|
||||
|
||||
test('Config keeps an explicit value and fills the rest', () => {
|
||||
const resolved = resolve({ embeddingApiBase: 'http://10.50.1.2:11434', embeddingConcurrency: 8 })
|
||||
assert.equal(resolved.embeddingApiBase, 'http://10.50.1.2:11434')
|
||||
// A TEST-NET-1 address (RFC 5737): reserved for documentation, so a fixture
|
||||
// can never point at a host anybody actually runs.
|
||||
const resolved = resolve({ embeddingApiBase: 'http://192.0.2.10:11434', embeddingConcurrency: 8 })
|
||||
assert.equal(resolved.embeddingApiBase, 'http://192.0.2.10:11434')
|
||||
assert.equal(resolved.embeddingConcurrency, 8)
|
||||
assert.equal(resolved.embeddingBatchSize, 16)
|
||||
assert.equal(resolved.embeddingTimeoutMs, 30_000)
|
||||
@@ -135,7 +137,7 @@ test('validateSettings rejects an endpoint that is not a URL', () => {
|
||||
// so it is the protocol check that actually catches the common mistake.
|
||||
assert.throws(() => validateSettings(settingsWith({ embeddingApiBase: 'localhost:11434' })), /must be http or https/)
|
||||
assert.throws(() => validateSettings(settingsWith({ embeddingApiBase: '' })), /not a URL/)
|
||||
assert.doesNotThrow(() => validateSettings(settingsWith({ embeddingApiBase: 'http://10.50.1.2:11434' })))
|
||||
assert.doesNotThrow(() => validateSettings(settingsWith({ embeddingApiBase: 'http://192.0.2.10:11434' })))
|
||||
})
|
||||
|
||||
test('validateSettings rejects a non-http protocol', () => {
|
||||
|
||||
Reference in new issue
Block a user