titan-agent 5.6.3 → 5.6.4

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.
@@ -2296,18 +2296,25 @@ data: ${JSON.stringify(structured)}
2296
2296
  res.status(isValidationError ? 400 : 500).json({ error: e.message });
2297
2297
  }
2298
2298
  });
2299
- app.get("/api/models", async (_req, res) => {
2299
+ app.get("/api/models", async (req, res) => {
2300
2300
  const cfg = loadConfig();
2301
- const models = await discoverAllModels();
2301
+ const forceRefresh = req.query.refresh === "1" || req.query.refresh === "true";
2302
+ const models = await discoverAllModels(forceRefresh);
2302
2303
  const grouped = {};
2304
+ const keyConfigured = {};
2303
2305
  for (const m of models) {
2304
2306
  if (!grouped[m.provider]) grouped[m.provider] = [];
2305
2307
  grouped[m.provider].push(m.id);
2308
+ if (!(m.provider in keyConfigured)) keyConfigured[m.provider] = m.keyConfigured;
2306
2309
  }
2307
2310
  res.json({
2308
2311
  ...grouped,
2309
2312
  current: cfg.agent.model,
2310
- aliases: getModelAliases()
2313
+ aliases: getModelAliases(),
2314
+ _meta: {
2315
+ keyConfigured,
2316
+ cacheRefreshed: forceRefresh
2317
+ }
2311
2318
  });
2312
2319
  });
2313
2320
  app.get("/api/providers/status", async (_req, res) => {