fix(pi): keep active runs alive during background sleep

This commit is contained in:
2026-08-25 20:56:17 +08:00
parent 92f4c91088
commit 621ebb1781
22 changed files with 1061 additions and 68 deletions

View File

@@ -5,7 +5,7 @@ import { getProviderService } from './providers/provider-service';
export type WorksSquareRuntimeContext = {
codingProducts?: {
sleep(): Promise<unknown>;
sleep(reason: 'auth_cleanup'): Promise<unknown>;
};
imageWorkspace?: {
closeEventSessions?(options?: {
@@ -31,7 +31,7 @@ async function runManagedWorksSquareRuntimeCleanup(
accessToken,
tolerateRemoteFailure,
}))(),
(async () => await ctx.codingProducts?.sleep())(),
(async () => await ctx.codingProducts?.sleep('auth_cleanup'))(),
(async () => {
const deleted = await getProviderService().deleteAccountApiKey(
NIANCODE_USER_MODEL_ACCOUNT_ID,