feat: implement auto-scaffolding for project workflow files in bare repos
ci / check (macos-latest) (push) Canceled after 0s
ci / check (ubuntu-latest) (push) Canceled after 0s
ci / check (windows-latest) (push) Canceled after 0s

This commit is contained in:
asepharyana
2026-09-11 18:52:50 +07:00
parent 44bb4bebf1
commit 7d77408a41
9 changed files with 441 additions and 9 deletions
+5 -3
View File
@@ -74,15 +74,17 @@ test('/changes is undefined for a turn that wrote nothing', () =>
expect(session.lastTurnSummary()).toBeUndefined();
}));
test('system prompt is memoized until a volatile part changes', () => {
test('system prompt is memoized until a volatile part changes', async () => {
const session = new Session({
model: new MockLanguageModelV4({ doStream: async () => stream(text('ok')) }),
askApproval: noop,
});
// private API is exercised through the public turn loop; assert the cache counts.
for (let i = 0; i < 3; i++) void session.estimatedTokens();
// force a miss then a few hits via send
void drain(session);
// force a miss then a few hits via send. Awaited: the turn loop must run to
// completion before the stats are read (the auto-scaffold adds an async step
// at the top of send, so a fire-and-forget drain races the first prompt build).
await drain(session);
const stats = session.promptCacheStats();
expect(stats.misses).toBeGreaterThanOrEqual(1);
expect(stats.hits).toBeGreaterThanOrEqual(0);