feat: 添加共享 Kiro 超时模块并更新相关文件以使用统一的页面加载超时预算

This commit is contained in:
QLHazyCoder
2026-05-19 00:09:20 +08:00
parent 6c664ca5bc
commit e197d1e726
9 changed files with 195 additions and 29 deletions
@@ -57,3 +57,12 @@ test('startBuilderIdDeviceLogin registers Builder ID client and returns login bo
assert.equal(result.interval, 7);
assert.equal(result.region, 'us-east-1');
});
test('kiro register runner uses a shared 3-minute page-load timeout budget', () => {
const source = fs.readFileSync('background/kiro/register-runner.js', 'utf8');
assert.match(source, /DEFAULT_KIRO_PAGE_LOAD_TIMEOUT_MS/);
assert.match(source, /createTimeoutBudget/);
assert.match(source, /resolveTimeoutBudget/);
assert.match(source, /timeoutBudget\.getRemainingMs\(1000\)/);
assert.match(source, /onRetryableError: buildKiroRetryRecovery\(tabId, \{\s*\.\.\.options,\s*timeoutBudget,/);
});