Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

MergeSettings: an append annotation inside an overlay-only object is emitted raw into settings.json

Open Beginner friendly
#2,307 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 6 days

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
86/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
bun, json, typescript
Domain
backend

Research direction

Read LifeOS/install/LIFEOS/TOOLS/MergeSettings.ts around lines 170–177, then run the clean-tree repro from the issue and inspect out.json. Check how overlay-only objects are handled and compare the result with the stated expected output. Done means nested merge annotations are consumed and the output contains the expected array.

Written by the indexing model from the issue text.

Description

Version
LifeOS 7.40.4; repro on main @ 5e2f2e8

What is broken
mergeSettings consumes { "__merge": "append", "values": [...] } only when it meets the annotation at a key the system layer also has, or at the top level of an overlay-only key. When the overlay adds an object the system layer does not have at all, the function falls through to cloneJsonValue(user), which copies the object verbatim, so any annotation nested inside it reaches settings.json unconsumed. Claude Code then rejects the field, e.g. autoMode.allow: Expected array, but received object, and the rules in it are not applied. The file header promises "Merge annotations are consumed and never emitted in the output." The --check mode compares against the same merge, so it reports no differences.

Where (file:line)
LifeOS/install/LIFEOS/TOOLS/MergeSettings.ts:177 (return cloneJsonValue(user);), reached from the overlay-only branch at :170 with system === undefined.

Repro on a clean tree

mkdir -p /tmp/ms-repro && cd /tmp/ms-repro
echo '{"permissions":{"allow":["Read"]}}' > system.json
echo '{"autoMode":{"allow":{"__merge":"append","values":["rule one"]}}}' > user.json
HOME=/tmp/ms-repro bun <lifeos-checkout>/LifeOS/install/LIFEOS/TOOLS/MergeSettings.ts \
  --system system.json --user user.json --output out.json
jq -c .autoMode out.json

Negative control
On unpatched main @ 5e2f2e8 the merge exits 0 ("Merged 1 system keys + 1 user overlays") and out.json contains {"allow":{"__merge":"append","values":["rule one"]}}, an object where Claude Code requires an array. Expected: {"allow":["rule one"]}.

A stock install does not hit this through autoMode, because the shipped settings.system.json defines autoMode. It is hit by any overlay-only section that carries an annotation, e.g. a settings.system.json that omits autoMode while SettingsBackport writes an append annotation for autoMode.allow into the overlay.

Suggested fix
Recurse into overlay-only objects so nested annotations are consumed. Tested against the repro above: output becomes {"allow":["rule one"]}.

@@ -172,6 +172,10 @@
     return merged;
   }
 
+  if (system === undefined && isObjectRecord(user)) {
+    return mergeSettings({}, user);
+  }
+
   return cloneJsonValue(user);
 }

Before submitting

  • I searched open and closed issues for this defect.
  • The repro runs against a clean tree of the version above, not against my modified install.
  • I removed personal data from the pasted output.
Dominant language
TypeScript
Stars
19.3k
Forks
2.5k
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from danielmiessler/LifeOS

All issues in danielmiessler/LifeOS

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.