-
Notifications
You must be signed in to change notification settings - Fork 2
Config hot reload #29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
38376f4
f471203
3dbd5ed
df3e955
f71cb8b
6ee86eb
725a878
865955e
bdf7f7d
bad3021
f28361f
410fd58
37527bd
ce411d0
e3d696e
16aed1b
a8832fa
1296e46
8cfe611
980c331
62a8131
01133dd
846a84c
f2c7ec9
6ae1251
2a73925
d162131
e034c11
0801364
37aa350
8791c01
55efe53
c3f32a0
7990520
d43386f
b9dad32
19fb0f3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| { | ||
| "nodeModules": "sha256-m7hL9Uzqk+oa2/FtgkzEPgi+m/VZP1SvjpgYHNjiS1c=" | ||
| "nodeModules": "sha256-83nrKWOCUJhSHqtSApFuXxggEwO86rIWhy5d2vtfz4Y=" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| import fs from "fs/promises" | ||
|
|
||
| export async function createBackup(filepath: string): Promise<string> { | ||
| const timestamp = new Date().toISOString().replace(/[:.]/g, "-") | ||
| const backupPath = `${filepath}.bak-${timestamp}` | ||
|
|
||
| if (await Bun.file(filepath).exists()) { | ||
| await fs.copyFile(filepath, backupPath) | ||
| } | ||
|
|
||
| return backupPath | ||
| } | ||
|
|
||
| export async function restoreBackup(backupPath: string, targetPath: string): Promise<void> { | ||
| await fs.copyFile(backupPath, targetPath) | ||
| await fs.unlink(backupPath) | ||
| } | ||
|
Comment on lines
+1
to
+17
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Clarify/create-backup contract when source file does not exist
Two options to make this safer:
Either way, making this explicit will avoid surprising restore failures when there was no original config file. 🤖 Prompt for AI Agents |
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Per‑agent permission merging may unintentionally drop built‑in defaults
In the per‑agent loop,
item.permissionis recomputed as:This has a couple of side effects:
general/plan) that already haveagentPermission/planPermission(which includedoom_loop/external_directorydefaults), adding anycfg.agent.<name>entry without apermissionblock still re‑merges fromcfg.permissiononly, effectively discarding those built‑in defaults.plan, a per‑agentpermissionoverride also ignores the stricterplanPermissionbaseline and instead uses only global + per‑agent config as the base.If you want per‑agent permissions to extend the current agent baseline, a safer pattern would be along the lines of:
and only fall back to
cfg.permissionwhen no agent baseline exists.Minor:
disableis not destructured fromvalue, sodisable: falsewould end up insideitem.optionsviaextra. If you don’t wantdisableto appear inoptions, consider destructuring it alongside the other known fields.🤖 Prompt for AI Agents