test(live): retain original public metadata for AD reconciliation

This commit is contained in:
Agent Workbench Dev
2026-11-06 12:47:16 +08:00
parent 9c60c11135
commit ed78f02c03
2 changed files with 9 additions and 2 deletions
+6
View File
@@ -39,6 +39,12 @@ export function attempts() {
try { const row = db.prepare('SELECT value FROM metadata WHERE key=?').get('modelAttempts'); return row ? JSON.parse(row.value) : []; }
finally { db.close(); }
}
export function publicMetadata(dataRoot) {
const db = new DatabaseSync(path.join(dataRoot, 'workbench.sqlite'), { readOnly: true });
try { return Object.fromEntries(['config','modelRegistry','modelAttempts','modelNetworkDiagnostics'].map(key => {
const row = db.prepare('SELECT value FROM metadata WHERE key=?').get(key); return [key, row ? JSON.parse(row.value) : null];
})); } finally { db.close(); }
}
export async function client() {
const dispatcher = new Agent({ connect: { autoSelectFamily: true, timeout: 5000 } }); let token;
const api = async (route, input, timeout = 30000) => {