fix: default exec approvals to main agent (#1417) (thanks @czekaj)
This commit is contained in:
@@ -18,6 +18,7 @@ Docs: https://docs.clawd.bot
|
|||||||
- Doctor: warn when gateway.mode is unset with configure/config guidance.
|
- Doctor: warn when gateway.mode is unset with configure/config guidance.
|
||||||
- macOS: include Textual syntax highlighting resources in packaged app to prevent chat crashes. (#1362)
|
- macOS: include Textual syntax highlighting resources in packaged app to prevent chat crashes. (#1362)
|
||||||
- Cron: cap reminder context history to 10 messages and honor `contextMessages`. (#1103) Thanks @mkbehr.
|
- Cron: cap reminder context history to 10 messages and honor `contextMessages`. (#1103) Thanks @mkbehr.
|
||||||
|
- Exec approvals: treat main as the default agent + migrate legacy default allowlists. (#1417) Thanks @czekaj.
|
||||||
- UI: refresh debug panel on route-driven tab changes. (#1373) Thanks @yazinsai.
|
- UI: refresh debug panel on route-driven tab changes. (#1373) Thanks @yazinsai.
|
||||||
|
|
||||||
## 2026.1.21
|
## 2026.1.21
|
||||||
|
|||||||
@@ -91,7 +91,10 @@ function normalizeAllowlistPattern(value: string | undefined): string | null {
|
|||||||
return trimmed ? trimmed.toLowerCase() : null;
|
return trimmed ? trimmed.toLowerCase() : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
function mergeLegacyAgent(current: ExecApprovalsAgent, legacy: ExecApprovalsAgent): ExecApprovalsAgent {
|
function mergeLegacyAgent(
|
||||||
|
current: ExecApprovalsAgent,
|
||||||
|
legacy: ExecApprovalsAgent,
|
||||||
|
): ExecApprovalsAgent {
|
||||||
const allowlist: ExecAllowlistEntry[] = [];
|
const allowlist: ExecAllowlistEntry[] = [];
|
||||||
const seen = new Set<string>();
|
const seen = new Set<string>();
|
||||||
const pushEntry = (entry: ExecAllowlistEntry) => {
|
const pushEntry = (entry: ExecAllowlistEntry) => {
|
||||||
@@ -120,13 +123,11 @@ function ensureDir(filePath: string) {
|
|||||||
export function normalizeExecApprovals(file: ExecApprovalsFile): ExecApprovalsFile {
|
export function normalizeExecApprovals(file: ExecApprovalsFile): ExecApprovalsFile {
|
||||||
const socketPath = file.socket?.path?.trim();
|
const socketPath = file.socket?.path?.trim();
|
||||||
const token = file.socket?.token?.trim();
|
const token = file.socket?.token?.trim();
|
||||||
const agents = { ...(file.agents ?? {}) };
|
const agents = { ...file.agents };
|
||||||
const legacyDefault = agents.default;
|
const legacyDefault = agents.default;
|
||||||
if (legacyDefault) {
|
if (legacyDefault) {
|
||||||
const main = agents[DEFAULT_AGENT_ID];
|
const main = agents[DEFAULT_AGENT_ID];
|
||||||
agents[DEFAULT_AGENT_ID] = main
|
agents[DEFAULT_AGENT_ID] = main ? mergeLegacyAgent(main, legacyDefault) : legacyDefault;
|
||||||
? mergeLegacyAgent(main, legacyDefault)
|
|
||||||
: legacyDefault;
|
|
||||||
delete agents.default;
|
delete agents.default;
|
||||||
}
|
}
|
||||||
const normalized: ExecApprovalsFile = {
|
const normalized: ExecApprovalsFile = {
|
||||||
|
|||||||
Reference in New Issue
Block a user