Passive captures on Windows store accented characters as U+FFFD

Aperta Adatta ai principianti
#2,204 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
74/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
bash, shell
Ambito
tooling

Direzione di ricerca

Entrambi gli script hook sono denominati: inizia con plugin/claude-code/scripts/subagent-stop.sh, dove il body viene costruito con jq -c e inviato tramite curl -d, quindi controlla user-prompt-submit.sh per lo stesso schema. Riproduci prima la perdita di codifica con il comando curl su una riga segnalato, usando il curl di Git anziché quello di System32 per confermare che la code page sia la causa. Fatto significa che il testo accentato sopravvive al round trip con jq -ac o --data-binary @-, applicato a entrambi gli script e testato da una shell Git for Windows.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

status:needs-review type:bug
Existing Issue Search
  • I searched existing issues and will add evidence to a canonical tracker when applicable.
📝 Observed Consequence

On Windows, passive memories coming from subagents lose every non-ASCII character. Spanish accents end up as � (U+FFFD), and things like → become ?. In my store this hit about 150 observations since I updated the plugin, basically every passive capture that had an accent in it. The original text isn't in the DB anymore. I had to rebuild it from the subagent transcripts.

🔄 Steps to Reproduce
  1. On Windows with Git for Windows, use Claude Code with the engram plugin.
  2. Run a subagent whose final message ends with a ## Key Learnings block that has accents, for example 1. la sesión de prueba añade tildes y eñes.
  3. Look at the new passive observation with mem_search or in the DB.

You can also see it without engram:

curl -s -o /dev/null --max-time 1 -w '%{url_effective}\n' "http://127.0.0.1:9/sesión"

With Git's curl (/mingw64/bin/curl) this prints sesi�n. With C:\Windows\System32\curl.exe it prints sesión.

✅ Expected Behavior

The learning is stored with the same text the subagent wrote.

❌ Actual Behavior

It's stored as la sesi�n de prueba a�ade tildes y e�es.

Operating System

Windows

Release Version (Report Context)

3.6.0 (Claude Code plugin 0.1.14)

Agent / Client

Claude Code

📋 Relevant Logs

💡 Additional Context

I think the problem is in plugin/claude-code/scripts/subagent-stop.sh. It builds the body with jq -c and sends it with curl -d "$BODY". In the hook environment the first curl on the PATH is Git's (8.16.0), and its curl -V features don't include Unicode, so it reads its arguments in the ANSI code page (1252 here). The UTF-8 bytes go out as cp1252, and the server replaces the invalid bytes with U+FFFD.

Changing jq -c to jq -ac fixed it for me, since everything then goes as \uXXXX and the code page stops mattering. Sending the body on stdin with --data-binary @- should work too.

user-prompt-submit.sh sends prompts with the same -d "{...}" pattern, so it probably has the same problem. I couldn't confirm it because I haven't had prompts captured lately.

Lingua principale
Go
Stelle
7.1k
Fork
729
Merge medio
10h 12m
PR unite (30g)
272

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Gentleman-Programming/engram

Tutte le issue di Gentleman-Programming/engram

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.