agmsgd fails to start: install-manifest.json writes `files` as a string with SQLite 3.54

Open Beginner friendly
#1,933 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
91/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
shell, sqlite
Domain
cli

Research direction

Read the manifest construction around line 302 in scripts/lib/install-manifest.sh and compare it with the JSON subquery wrappers mentioned in scripts/lib/hooks-json.sh, scripts/api.sh, scripts/join.sh, scripts/remote.sh, scripts/reset.sh, and uninstall.sh. Confirm how SQLite 3.54 handles the scalar subquery, then rerun the installer and check that run/install-manifest.json stores files as an array and agmsgd starts successfully.

Written by the indexing model from the issue text.

Description

On agmsg 1.7.1, agmsg delivery agmsgd reports "did not become ready in time" and
agmsg daemon status shows stopped (intent is on; reason: none: executor unavailable).
Running the launcher in the foreground shows the real error:

file:///C:/Users/<user>/.agents/skills/agmsg/scripts/daemon/agmsgd:143
  const selfEntry = manifest.files.find((f) => f.path === selfPath);
                                   ^
TypeError: manifest.files.find is not a function
    at verifyInstallGeneration (.../scripts/daemon/agmsgd:143:36)
    at main (.../scripts/daemon/agmsgd:223:16)

run/install-manifest.json contains "files":"[{\"path\":...}]", so files is a JSON
string rather than an array.

Cause

scripts/lib/install-manifest.sh (around line 302) builds the manifest with:

'files', (SELECT json_group_array(json_object('path', path, 'digest', digest))
            FROM (SELECT path, digest FROM files ORDER BY path))

A scalar subquery does not carry the JSON subtype of json_group_array across the
subquery boundary, so json_object embeds the value as text. With SQLite 3.54.1 (I have
not checked which older versions behaved differently):

$ sqlite3 :memory: "CREATE TABLE f(p); INSERT INTO f VALUES('a');
  SELECT json_object('files',(SELECT json_group_array(p) FROM f));
  SELECT json_object('files',json((SELECT json_group_array(p) FROM f)));"
{"files":"[\"a\"]"}
{"files":["a"]}

Every other use of this pattern in the codebase already wraps the subquery in json(...)
(scripts/lib/hooks-json.sh, scripts/api.sh, scripts/join.sh, scripts/remote.sh,
scripts/reset.sh, uninstall.sh). install-manifest.sh is the only one that doesn't.

Fix

-        'files', (SELECT json_group_array(json_object('path', path, 'digest', digest))
-                    FROM (SELECT path, digest FROM files ORDER BY path))
+        'files', json((SELECT json_group_array(json_object('path', path, 'digest', digest))
+                    FROM (SELECT path, digest FROM files ORDER BY path)))

With this change applied locally and the installer rerun, the manifest's files is an
array (262 entries), and agmsg delivery agmsgd succeeds with agmsgd running.

Side notes

  • The surfaced reason, "executor unavailable", points away from the crash.
  • agmsg doctor, which the skill text recommends, prints "'doctor' is reserved and is
    not available in this version yet."

Environment

  • agmsg 1.7.1 (Claude Code plugin install, bootstrapped with install.sh --cmd agmsg)
  • Windows 11 Pro 10.0.26300, Git Bash
  • sqlite3 3.54.1 2026-10-16 (winget SQLite.SQLite)
  • Node.js v24.14.1
Dominant language
Shell
Stars
1.5k
Forks
156
Avg merge
16h 32m
Merged PRs (30d)
213

Getting set up

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 fujibee/agmsg

All issues in fujibee/agmsg

Similar issues

More Shell/Bash issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.