fix: exec approvals parsing + boot-md changelog

This commit is contained in:
Peter Steinberger
2026-01-18 16:07:41 +00:00
parent d06d440086
commit ffcf3263c1
3 changed files with 8 additions and 35 deletions

View File

@@ -185,9 +185,7 @@ export function registerExecApprovalsCli(program: Command) {
}
allowlistEntries.push({ pattern: trimmed, lastUsedAt: Date.now() });
agent.allowlist = allowlistEntries;
file.agents = file.agents
? { ...file.agents, [agentKey]: agent }
: { [agentKey]: agent };
file.agents = { ...file.agents, [agentKey]: agent };
const next = await saveSnapshot(opts, nodeId, file, snapshot.hash);
const payload = opts.json ? JSON.stringify(next) : JSON.stringify(next, null, 2);
defaultRuntime.log(payload);
@@ -231,13 +229,11 @@ export function registerExecApprovalsCli(program: Command) {
agent.allowlist = nextEntries;
}
if (isEmptyAgent(agent)) {
const agents = file.agents ? { ...file.agents } : {};
const agents = { ...file.agents };
delete agents[agentKey];
file.agents = Object.keys(agents).length > 0 ? agents : undefined;
} else {
file.agents = file.agents
? { ...file.agents, [agentKey]: agent }
: { [agentKey]: agent };
file.agents = { ...file.agents, [agentKey]: agent };
}
const next = await saveSnapshot(opts, nodeId, file, snapshot.hash);
const payload = opts.json ? JSON.stringify(next) : JSON.stringify(next, null, 2);