Merge pull request 'fix(sweep): route-pending-comments לוקח חברות מ-CEO_AGENT_IDS ולא מ-companies.list (legal-ai#1280)' (#25) from fix/legal-ai-1280-sweep-company-ids into main
All checks were successful
INV-INT9 issue.status write-ownership / int9-guard (push) Successful in 3s
All checks were successful
INV-INT9 issue.status write-ownership / int9-guard (push) Successful in 3s
This commit was merged in pull request #25.
This commit is contained in:
@@ -1243,27 +1243,17 @@ const plugin = definePlugin({
|
||||
// double-routed. Runs every 2 minutes (manifest schedule).
|
||||
ctx.jobs.register("route-pending-comments", async (_job) => {
|
||||
await runJobHandler("route-pending-comments", ctx.logger, async () => {
|
||||
// כשל-מהיר: דחיית-scope (legal-ai issue #637) אינה "שגיאה
|
||||
// פר-issue" שאפשר להתעלם ממנה — היא אומרת שה-run **כולו** לא
|
||||
// יכול לעבוד. לזרוק מיד במקום לבלוע ולהמשיך ללולאה על 2
|
||||
// חברות × 200 issues שכולן ייכשלו זהה. שגיאה אחרת (ולא scope)
|
||||
// נשארת warn+continue — זו העמידות האמיתית פר-issue.
|
||||
let companies: Awaited<ReturnType<typeof ctx.companies.list>>;
|
||||
try {
|
||||
companies = await ctx.companies.list();
|
||||
} catch (err) {
|
||||
if (isCompanyScopeDenied(err)) {
|
||||
throw new CompanyScopeUnavailableError(
|
||||
"route-pending-comments",
|
||||
"companies.list",
|
||||
{ cause: err },
|
||||
);
|
||||
}
|
||||
ctx.logger.warn("route-pending-comments: companies.list failed", {
|
||||
error: String(err),
|
||||
});
|
||||
return;
|
||||
}
|
||||
// רשימת החברות נלקחת ממפת ה-CEO ולא מ-`ctx.companies.list()` (legal-ai
|
||||
// #1280): הקריאה הזו דורשת scope של instance, וה-host דוחה אותה
|
||||
// באקראי בג'וב מתוזמן (invalidInvocationScope, ~21% מהריצות מ-10.11).
|
||||
// הלולאה ממילא מדלגת על חברה בלי CEO ממופה, ולכן הרשימה זהה
|
||||
// (אותו דפוס כמו `knownCompanyIds` ב-`resolveApiBase`).
|
||||
//
|
||||
// כשל-מהיר נשאר ב-`issues.list`: דחיית-scope (legal-ai issue #637)
|
||||
// אינה "שגיאה פר-issue" שאפשר להתעלם ממנה — היא אומרת שה-run
|
||||
// **כולו** לא יכול לעבוד. שגיאה אחרת (ולא scope) נשארת
|
||||
// warn+continue — זו העמידות האמיתית פר-issue.
|
||||
const companies = Object.keys(CEO_AGENT_IDS).map((id) => ({ id }));
|
||||
|
||||
for (const company of companies) {
|
||||
const ceoAgentId = CEO_AGENT_IDS[company.id];
|
||||
|
||||
Reference in New Issue
Block a user