diff --git a/scripts/course-matchmaking-routes.test.ts b/scripts/course-matchmaking-routes.test.ts index 5252db2..e59e359 100644 --- a/scripts/course-matchmaking-routes.test.ts +++ b/scripts/course-matchmaking-routes.test.ts @@ -33,6 +33,12 @@ try { assert.ok(calls[0]?.url.endsWith("/a2a/tasks")); assert.equal(calls[0]?.headers.get("authorization"), config.a2aAllowedKey ? `Bearer ${config.a2aAllowedKey}` : null); + calls.length = 0; + const sessionStartResponse = await app.request("http://backend.test/matchmaking/a2a", { method: "POST", headers: { "content-type": "application/json" }, body: JSON.stringify({ action: "session_start", params: { page: "job-matching" } }) }); + assert.equal(sessionStartResponse.status, 200); + assert.equal(calls[0]?.body.action, "session_start"); + assert.equal(calls[0]?.body.session_start, true); + const forbiddenResponse = await app.request("http://backend.test/matchmaking/a2a", { method: "POST", headers: { "content-type": "application/json" }, body: JSON.stringify({ action: "force_forbidden" }) }); assert.equal(forbiddenResponse.status, 502); assert.match(await forbiddenResponse.text(), /matchmaking service authentication failed/); diff --git a/src/routes/services.ts b/src/routes/services.ts index 65ffafc..f0f69fa 100644 --- a/src/routes/services.ts +++ b/src/routes/services.ts @@ -388,6 +388,7 @@ async function callMatchmakingA2a(body: Record, userId: string) ...body, action: action === "get_feed" ? "get_scout_feed" : action, user_id: getString(body.user_id) ?? userId, + session_start: action === "session_start" || body.session_start === true, }; const startedAt = Date.now(); let res: Response;