fix: handle secrets skip gracefully in auto mode without crashing (#352)
Fixes #296 Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
2f15affeb5
commit
d4312c60ec
2 changed files with 21 additions and 13 deletions
|
|
@ -286,12 +286,12 @@ export async function showSecretsSummary(
|
|||
|
||||
const existingSet = new Set(existingKeys);
|
||||
|
||||
await (ctx.ui.custom as Function)((tui: any, theme: Theme, _kb: any, done: () => void) => {
|
||||
await ctx.ui.custom((tui: any, theme: Theme, _kb: any, done: (r: null) => void) => {
|
||||
let cachedLines: string[] | undefined;
|
||||
|
||||
function handleInput(_data: string) {
|
||||
// Any key dismisses
|
||||
done();
|
||||
// Any key dismisses — pass null to satisfy the typed done() callback
|
||||
done(null);
|
||||
}
|
||||
|
||||
function render(width: number): string[] {
|
||||
|
|
|
|||
|
|
@ -506,14 +506,18 @@ export async function startAuto(
|
|||
const manifestStatus = await getManifestStatus(base, mid);
|
||||
if (manifestStatus && manifestStatus.pending.length > 0) {
|
||||
const result = await collectSecretsFromManifest(base, mid, ctx);
|
||||
ctx.ui.notify(
|
||||
`Secrets collected: ${result.applied.length} applied, ${result.skipped.length} skipped, ${result.existingSkipped.length} already set.`,
|
||||
"info",
|
||||
);
|
||||
if (result && result.applied && result.skipped && result.existingSkipped) {
|
||||
ctx.ui.notify(
|
||||
`Secrets collected: ${result.applied.length} applied, ${result.skipped.length} skipped, ${result.existingSkipped.length} already set.`,
|
||||
"info",
|
||||
);
|
||||
} else {
|
||||
ctx.ui.notify("Secrets collection skipped.", "info");
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
ctx.ui.notify(
|
||||
`Secrets collection error: ${err instanceof Error ? err.message : String(err)}`,
|
||||
`Secrets collection error: ${err instanceof Error ? err.message : String(err)}. Continuing with next task.`,
|
||||
"warning",
|
||||
);
|
||||
}
|
||||
|
|
@ -1304,14 +1308,18 @@ async function dispatchNextUnit(
|
|||
const manifestStatus = await getManifestStatus(basePath, mid);
|
||||
if (manifestStatus && manifestStatus.pending.length > 0) {
|
||||
const result = await collectSecretsFromManifest(basePath, mid, ctx);
|
||||
ctx.ui.notify(
|
||||
`Secrets collected: ${result.applied.length} applied, ${result.skipped.length} skipped, ${result.existingSkipped.length} already set.`,
|
||||
"info",
|
||||
);
|
||||
if (result && result.applied && result.skipped && result.existingSkipped) {
|
||||
ctx.ui.notify(
|
||||
`Secrets collected: ${result.applied.length} applied, ${result.skipped.length} skipped, ${result.existingSkipped.length} already set.`,
|
||||
"info",
|
||||
);
|
||||
} else {
|
||||
ctx.ui.notify("Secrets collection skipped.", "info");
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
ctx.ui.notify(
|
||||
`Secrets collection error: ${err instanceof Error ? err.message : String(err)}`,
|
||||
`Secrets collection error: ${err instanceof Error ? err.message : String(err)}. Continuing with next task.`,
|
||||
"warning",
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue