Skip to content

Commit 4722baf

Browse files
basiclinesCopilot
andcommitted
feat: offer manual passes in all modes, not just interactive
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 72c8969 commit 4722baf

1 file changed

Lines changed: 43 additions & 45 deletions

File tree

scripts/compile.ts

Lines changed: 43 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -974,57 +974,55 @@ your final message like this:
974974
log("");
975975
}
976976

977-
// 11. Multi-pass loop (interactive mode only — autopilot is handled by the SDK)
978-
if (!autopilot) {
979-
while (!aborted && process.stdin.isTTY) {
980-
const wantMore = await confirmPass();
981-
if (!wantMore) break;
982-
983-
passNumber++;
984-
currentPhase = "Starting";
985-
metrics.errors = [];
986-
987-
log(`\n${chalk.cyan("●")} Pass ${passNumber} — sending improvement prompt...\n`);
988-
989-
await session.send({
990-
prompt: [
991-
"Do another pass over the compilation output.",
992-
"Re-read the original spec files and the compile prompt at " +
993-
`\`${relative(SPECS_DIR, promptPath)}\` to check what you may have missed.`,
994-
"",
995-
"Remember: DEPTH OVER BREADTH. A few components working perfectly",
996-
"(with interactive demo) is better than many half-working ones.",
997-
"",
998-
"Focus on:",
999-
"- The interactive demo (`--interactive`) — it MUST work as a full-screen playground",
1000-
"- Components already implemented: polish, fix bugs, ensure full interactivity",
1001-
"- Tests that are failing or missing",
1002-
"- Add the NEXT component (fully: implementation + tests + demo wiring)",
1003-
"- Token usage correctness",
1004-
"After fixing, run the tests and verify `--interactive` works, then report results.",
1005-
].join("\n"),
1006-
});
977+
// 11. Multi-pass loop — user can always trigger additional passes
978+
while (!aborted && process.stdin.isTTY) {
979+
const wantMore = await confirmPass();
980+
if (!wantMore) break;
981+
982+
passNumber++;
983+
currentPhase = "Starting";
984+
metrics.errors = [];
985+
986+
log(`\n${chalk.cyan("●")} Pass ${passNumber} — sending improvement prompt...\n`);
987+
988+
await session.send({
989+
prompt: [
990+
"Do another pass over the compilation output.",
991+
"Re-read the original spec files and the compile prompt at " +
992+
`\`${relative(SPECS_DIR, promptPath)}\` to check what you may have missed.`,
993+
"",
994+
"Remember: DEPTH OVER BREADTH. A few components working perfectly",
995+
"(with interactive demo) is better than many half-working ones.",
996+
"",
997+
"Focus on:",
998+
"- The interactive demo (`--interactive`) — it MUST work as a full-screen playground",
999+
"- Components already implemented: polish, fix bugs, ensure full interactivity",
1000+
"- Tests that are failing or missing",
1001+
"- Add the NEXT component (fully: implementation + tests + demo wiring)",
1002+
"- Token usage correctness",
1003+
"After fixing, run the tests and verify `--interactive` works, then report results.",
1004+
].join("\n"),
1005+
});
10071006

1008-
await waitForIdle();
1007+
await waitForIdle();
10091008

1010-
if (!verbose && currentPhase !== "Starting") {
1011-
log(` ${chalk.green("✓")} ${currentPhase}`);
1012-
}
1009+
if (!verbose && currentPhase !== "Starting") {
1010+
log(` ${chalk.green("✓")} ${currentPhase}`);
1011+
}
10131012

1014-
if (metrics.lastAssistantMessage) {
1015-
const rendered = marked(metrics.lastAssistantMessage.trim()) as string;
1016-
log(`\n${boxen(rendered.trimEnd(), { padding: 1, dimBorder: true, title: "Agent summary", titleAlignment: "left" })}`);
1017-
}
1013+
if (metrics.lastAssistantMessage) {
1014+
const rendered = marked(metrics.lastAssistantMessage.trim()) as string;
1015+
log(`\n${boxen(rendered.trimEnd(), { padding: 1, dimBorder: true, title: "Agent summary", titleAlignment: "left" })}`);
1016+
}
10181017

1019-
printSummary(target, config, metrics, outDir, noLock, passNumber);
1018+
printSummary(target, config, metrics, outDir, noLock, passNumber);
10201019

1021-
if (metrics.errors.length > 0) {
1022-
log(chalk.yellow("⚠ Pass completed with errors:"));
1023-
for (const err of metrics.errors) {
1024-
log(` ${chalk.red("•")} ${err}`);
1025-
}
1026-
log("");
1020+
if (metrics.errors.length > 0) {
1021+
log(chalk.yellow("⚠ Pass completed with errors:"));
1022+
for (const err of metrics.errors) {
1023+
log(` ${chalk.red("•")} ${err}`);
10271024
}
1025+
log("");
10281026
}
10291027
}
10301028

0 commit comments

Comments
 (0)