chore: update plan automation and chat status UI
This commit is contained in:
@@ -268,6 +268,11 @@ export function buildPlanBranchName(workId: string, id: number) {
|
||||
return `${prefix}/plan-${id}-${token}`;
|
||||
}
|
||||
|
||||
export function shouldUseLocalMainPlanMode(automationType: unknown) {
|
||||
const env = getEnv();
|
||||
return Boolean(env.PLAN_LOCAL_MAIN_MODE) && normalizePlanAutomationType(automationType) !== 'auto_worker';
|
||||
}
|
||||
|
||||
export function mapPlanRow(
|
||||
row: Record<string, unknown>,
|
||||
options?: PlanRowOptions,
|
||||
@@ -2399,7 +2404,6 @@ export async function listPlanIssueSummaries(planItemIds: number[]) {
|
||||
|
||||
export async function claimNextPlanForBranch(workerId: string) {
|
||||
await ensurePlanTable();
|
||||
const env = getEnv();
|
||||
|
||||
return db.transaction(async (trx) => {
|
||||
const row = await trx(PLAN_TABLE)
|
||||
@@ -2417,7 +2421,9 @@ export async function claimNextPlanForBranch(workerId: string) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const assignedBranch = env.PLAN_LOCAL_MAIN_MODE ? env.PLAN_MAIN_BRANCH : buildPlanBranchName(String(row.work_id), Number(row.id));
|
||||
const assignedBranch = shouldUseLocalMainPlanMode(row.automation_type)
|
||||
? String(getEnv().PLAN_MAIN_BRANCH)
|
||||
: buildPlanBranchName(String(row.work_id), Number(row.id));
|
||||
const rows = await trx(PLAN_TABLE)
|
||||
.where({ id: row.id })
|
||||
.update({
|
||||
|
||||
Reference in New Issue
Block a user