From 5c69d1f7fa3dde14ba7a59da350ff16e86a62923 Mon Sep 17 00:00:00 2001 From: Danny Avila Date: Tue, 21 Apr 2026 13:19:35 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=A9=B9=20fix:=20define=20appConfig=20in?= =?UTF-8?q?=20Responses=20API=20createResponse?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit responses.js referenced `appConfig` on lines 381 / 396 without ever declaring it, so `createResponse` threw `ReferenceError: appConfig is not defined` the moment it entered the skills-capability block. The existing `recordCollectedUsage` unit tests silently stopped running (try/catch swallowed the error into `logger.error`), so CI showed 6 assertions failing with "Expected calls: 1, Received: 0" — the function never reached the recorder. Mirror initialize.js: seed `appConfig = req.config` at the top of the try block, before the `enabledCapabilities` Set it feeds into. The two later `appConfig: req.config` call-sites keep the direct reference — only the lexical reads needed a binding. This failure already exists on origin/feat/agent-skills (the same 6 tests fail there with the same stack) but blocks our branch too since we're rebased on top, so fix it here and cherry-pick back if needed. --- api/server/controllers/agents/responses.js | 1 + 1 file changed, 1 insertion(+) diff --git a/api/server/controllers/agents/responses.js b/api/server/controllers/agents/responses.js index bbf6cd7a3e..051c7ad48b 100644 --- a/api/server/controllers/agents/responses.js +++ b/api/server/controllers/agents/responses.js @@ -377,6 +377,7 @@ const createResponse = async (req, res) => { getSkillByName: db.getSkillByName, }; + const appConfig = req.config; const enabledCapabilities = new Set( appConfig?.endpoints?.[EModelEndpoint.agents]?.capabilities, );