Skip to content

Help wanted (native Windows): delivery sqlite JSON round-trip writes invalid/wrong output on windows-latest #184

Description

@fujibee

Looking for a contributor with a native Windows + Git Bash environment 🙏

We've made the Codex bridge and the in-memory sqlite captures work on Windows (#179, #180), and quarantined the watcher/bridge process-gap tests (#182). What's left is a cluster of delivery.sh failures that only reproduce on native Windows / windows-latest and need someone who can run and debug there — the maintainers don't have a Windows box.

These are real bugs, not test fragility: the delivery set JSON round-trip (readfile() → sqlite json_set/json_objectwritefile()) produces invalid JSON or wrong values on Windows, even after the CRLF-in-captured-output fix (#180). They are currently red on the non-required windows-latest (full, experimental) leg (not skipped — we want them visible until fixed).

Symptoms (failing tests on windows-latest, all green on Linux/macOS)

A. Invalid JSON written by delivery set (the file fails json_valid / python json.load):

  • delivery set monitor: round-trips multibyte (UTF-8) settings without a short-write reject (test_delivery.bats)
  • delivery set monitor: existing settings with single-quoted hook commands stays valid JSON (#134)
  • hook on: is idempotent (test_hook.bats — json.load throws → count empty)

B. Wrong agmsg-entry count or extracted value (idempotency check sees ≠1 entry, or json_extract returns the wrong scalar — suspected: the stored hook command path is in a different form, e.g. C:\… vs /c/…, so the instr(command, <skill-dir>) match in agmsg_entries misses):

  • delivery set monitor: idempotent / delivery set both: idempotent across repeats
  • delivery: monitor is idempotent for SessionEnd entry
  • delivery set monitor: preserves unrelated settings
  • delivery set turn (copilot): writes .github/hooks/agmsg.json with version + Stop entry
  • delivery set monitor (copilot): does NOT delete an existing turn hook
  • delivery set turn (copilot): idempotent across repeats

C. Large-settings (E2BIG) round-trip (extracted first/last entry or array length wrong, or set off exits non-zero):

  • delivery set monitor: handles a large settings.local.json without E2BIG (#95)
  • delivery set both: handles a large settings.local.json across strip+add+prune (#95)
  • delivery set off: idempotent strip on a large settings.local.json (#95)

(Related but possibly separate: install: actas-claim runs in a fresh shell with no inherited envactas-claim.sh exits non-zero under env -i on Windows. Likely a PATH/env issue.)

Suspected root causes (need on-Windows confirmation)

  1. CRLF inside the file content / JSON values. #180 stripped CR from captured command output, but if a CR rides into the settings blob through readfile()/writefile() (or the input file has CRLF), the resulting JSON string can contain a raw \r, which is invalid JSON. Check the bytes of the file delivery set monitor writes on Windows (xxd/od -c).
  2. Path form in stored hook commands. agmsg_entries/strip match agmsg-owned entries via instr(command, '<skill-dir>'). If the command is stored with a Windows path (C:\Users\…, via cygpath in sql_readfile_path) while the matcher uses the Git Bash form (/c/Users/…), the match misses → wrong count.

How to reproduce

  1. Windows + Git for Windows (Git Bash) + sqlite3 on PATH (e.g. choco install sqlite).
  2. git clone + ./install.sh --cmd agmsg into a temp HOME.
  3. bats tests/test_delivery.bats — or the focused tests above. They pass on Linux/macOS, fail on Git Bash.
  4. Inspect the written .claude/settings.local.json / .github/hooks/agmsg.json bytes and the commandWindows/command values.

Already fixed (context)

Happy to pair / review PRs. Comment here if you can help! 🐙

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions