Compare commits

...

2 Commits

Author SHA1 Message Date
-Puter
fd4dde1e5d fix matchmaking session startup forwarding 2026-07-17 19:56:57 +05:30
-Puter
aa3bfa9251 merge matchmaking gateway error handling 2026-07-17 19:36:17 +05:30
2 changed files with 7 additions and 0 deletions

View File

@@ -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/);

View File

@@ -388,6 +388,7 @@ async function callMatchmakingA2a(body: Record<string, unknown>, 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;