Settings panel shows 'Not Set' and can't save when project config has an object-form reference (/config/overlay 400: Expected ConfigV2.Reference.Local)
Component
VS Code extension
Description
Any object-form entry under reference in a project kilo.json / kilo.jsonc breaks the VS Code Settings panel for that workspace:
- every field shows Not Set;
- the Indexing pane is missing;
- saving fails with "Couldn't save settings: Settings changed or expired. Reload before saving." Reloading the window or restarting doesn't help.
Sessions still work, and the reference itself is honoured (kilo debug agent code shows the external_directory grant). Only the Settings panel is affected. The same machine and global config work in a project without reference.
Server-side cause. GET /config/overlay returns 400 for any object-form reference:
Expected ConfigV2.Reference.Git, got {"path":"/tmp"}
at ["project"]["reference"]["a"]
Expected ConfigV2.Reference.Local, got {"path":"/tmp"}
at ["project"]["reference"]["a"]
The server's own OpenAPI schema (/doc) defines ConfigV2ReferenceLocal as { path (required), description?, hidden? }, so {"path":"/tmp"} should match it. With the same config, GET /config and GET /agent return 200.
Results by config (kilo serve, 7.8.27):
kilo.json |
/config/overlay |
|---|---|
{"reference":{}} |
200 |
{"reference":{"a":"/tmp"}} (string form) |
200 |
{"reference":{"a":{"path":"/tmp"}}} |
400 |
{"reference":{"a":{"path":"/tmp","description":"d"}}} |
400 |
{"reference":{"a":{"type":"local","path":"/tmp"}}} |
400 |
{"reference":{"a":{"repository":"https://github.com/x/y"}}} |
400 |
{"references":{"a":{"path":"/tmp"}}} |
400 |
Ruled out: we found the trigger by bisecting a real project config. Comments, permission rules, relative vs absolute paths, description and a second .kilo/kilo.jsonc layer make no difference; one bare entry is enough. The workaround is to remove reference, or use the string form, which loses descriptions.
Possibly related: #15451 (the Settings UI doesn't show values from overlay or managed config). The upstream issue anomalyco/opencode#48809 (non-empty references crashed agent list) is a different symptom and doesn't reproduce on 7.8.27.
Plugins
none beyond the defaults (@kilocode/kilo-indexing, @kilocode/plugin-atomic-chat)
Kilo version
VS Code extension 7.8.27 (also seen on 7.8.18); CLI 7.8.27
Steps to reproduce
In VS Code:
- Create an empty folder containing a
kilo.jsonwith{"reference":{"a":{"path":"/tmp"}}}. - Open the folder in VS Code and open Kilo > Settings.
- Fields show "Not Set" and there is no Indexing pane. Change any value and click Save: "Couldn't save settings: Settings changed or expired."
- Change the file to
{"reference":{"a":"/tmp"}}, or removereference, then reload. Settings loads and saves normally.
Server only:
mkdir -p /tmp/refrepro && cd /tmp/refrepro
printf '{"reference":{"a":{"path":"/tmp"}}}' > kilo.json
kilo serve --port 47811 &
curl -s "http://127.0.0.1:47811/config/overlay?directory=$PWD" # 400, error above
Operating System
macOS 27.0.1 (arm64)
Terminal
VS Code integrated terminal
I'd like to work on this. The bisect table in the issue is useful: string-form references pass /config/overlay but every object form returns 400 with 'Expected ConfigV2.Reference.Local', even though the OpenAPI schema says {path} should match, so I'll start by reproducing with kilo serve and finding where the overlay response schema is built and why it rejects the object form while /config accepts it. The fix will go in that schema or its decode step, and I'll add a regression test that requests the overlay for a project config containing {reference:{a:{path:'/tmp'}}} and the git-repository form and expects 200. I'll follow the contributing guide's AI-assistance rules: I will run and review the change myself and can explain the diff.