fix(secrets): align ref contracts and non-interactive ref persistence

This commit is contained in:
joshavant
2026-02-25 19:36:32 -06:00
committed by Peter Steinberger
parent 86622ebea9
commit 8944b75e16
11 changed files with 680 additions and 340 deletions

View File

@@ -65,6 +65,31 @@ describe("config secret refs schema", () => {
expect(result.ok).toBe(true);
});
it('accepts file refs with id "value" for raw mode providers', () => {
const result = validateConfigObjectRaw({
secrets: {
providers: {
rawfile: {
source: "file",
path: "~/.openclaw/token.txt",
mode: "raw",
},
},
},
models: {
providers: {
openai: {
baseUrl: "https://api.openai.com/v1",
apiKey: { source: "file", provider: "rawfile", id: "value" },
models: [{ id: "gpt-5", name: "gpt-5" }],
},
},
},
});
expect(result.ok).toBe(true);
});
it("rejects invalid secret ref id", () => {
const result = validateConfigObjectRaw({
models: {