openclaw: auto-recall query keeps host markers ([media attached: <path>], inter-session and external-content wrappers), so image-only turns recall on a file path
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
- 82/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- typescript
Direzione di ricerca
Inizia da extractRecallQuery() e dall’helper adiacente stripRuntimeEnvelope() in hindsight-integrations/openclaw/src/index.ts, poi segui la selezione della query nell’handler before_prompt_build. Controlla le funzioni esportate con gli esempi di contenuti multimediali, tra sessioni e di contenuti esterni presenti nell’issue. Il lavoro è terminato quando i turni composti solo da contenuti multimediali non producono query di testo e gli altri marcatori vengono rimossi o ridotti al loro testo interno.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Bug Description
The OpenClaw integration builds the auto-recall query with extractRecallQuery(). That function strips sender metadata envelopes, the runtime envelope and inline timestamp prefixes, but not the other markers OpenClaw puts into the user message:
[media attached: /local/path/file.jpg (image/jpeg) | /local/path/file.jpg], and the[media attached N/M: …]/[media attached: N files]forms, added for every inbound photo, document or voice note;[Inter-session message] sourceSession=… sourceTool=…, added when one session sends a message to another;<<<EXTERNAL_UNTRUSTED_CONTENT id="…">>> … <<<END_EXTERNAL_UNTRUSTED_CONTENT …>>>, the wrapper around web, email and webhook content.
isEphemeralOperationalText() does not classify these either, so they go to /recall as the query, cut to recallMaxQueryChars (800 by default).
On a busy personal assistant over one week, 15% of all auto-recall queries started with a [media attached: <absolute local path> line, and about 4% more started with an inter-session or external-content wrapper. For an image-only message the whole query is a file path, so the injected memories are effectively random. With a caption, the path takes a large part of the 800-character budget and dilutes both the embedding and the keyword terms.
Those numbers were measured on 1.2.0, which built the query from the assembled prompt. 1.2.1 switched to currentUserMessage (#6515), but that does not remove the media marker: on OpenClaw 2026.11.8, currentUserMessage is the recorded user turn, and the host prepends the media note to that turn as well. The cleaning functions are byte-identical between 1.2.0 and main.
Steps to Reproduce
- OpenClaw 2026.11.x with
@vectorize-io/hindsight-openclaw,autoRecall: true. - Send the agent a photo without a caption on any channel that supports media.
- Check the query the API receives (server INFO log
Starting recall for query: …), or call the exported functions directly:
import { extractRecallQuery, isEphemeralOperationalText } from "@vectorize-io/hindsight-openclaw";
const q = extractRecallQuery("[media attached: /home/user/.openclaw/media/inbound/abc.jpg (image/jpeg) | /home/user/.openclaw/media/inbound/abc.jpg]", undefined);
console.log(q, isEphemeralOperationalText(q)); // the full marker line, false
The same happens with "[Inter-session message] sourceSession=agent:main:other sourceTool=sessions_send\nStatus report" and with a text wrapped in <<<EXTERNAL_UNTRUSTED_CONTENT …>>> markers.
Expected Behavior
- Media markers are removed from the query. An image-only turn has no text query and skips recall, or recalls on the caption only.
- Inter-session and external-content wrappers are reduced to their inner text, or the turn is treated as operational, the same way the runtime envelope is handled.
Actual Behavior
The marker lines are sent verbatim as the recall query, including absolute local file paths.
Version
- Hindsight API 1.3.0
@vectorize-io/hindsight-openclaw1.2.0 when measured; the cleaning functions are unchanged in 1.2.3 (= main at c828c7e)- OpenClaw 2026.11.8
LLM Provider
Not relevant (client-side query construction).
Suspected code location
hindsight-integrations/openclaw/src/index.ts: extractRecallQuery() (line 1122), stripMetadataEnvelopes() (line 1041), stripRuntimeEnvelope() (line 1101), isEphemeralOperationalText() (line 1656), and the query selection in the before_prompt_build handler (lines 2907-2911). A small stripHostMarkers() step next to stripRuntimeEnvelope() would cover it.
Parity: the Hermes integration got recall_query_strip_patterns in #6886. A built-in strip for these three OpenClaw markers, or the same configurable option, would bring the OpenClaw integration in line. The retain transcript probably carries the same markers; that is a separate question and not part of this report.
- Lingua principale
- Python
- Stelle
- 45.2k
- Fork
- 5.9k
- Merge medio
- 5h 46m
- PR unite (30g)
- 389
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di vectorize-io/hindsight
-
integration:coding-agents
Difficoltà 2/5 1-3 ore Idoneità per principianti 73/100
vectorize-io/hindsight#7028 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
integration:openclaw
Difficoltà 2/5 1-3 ore Idoneità per principianti 79/100
vectorize-io/hindsight#7023 ·
I maintainer di solito rispondono entro 1 giorno
-
integration:hermes
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
vectorize-io/hindsight#7002 ·
I maintainer di solito rispondono entro 1 giorno
-
core
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
vectorize-io/hindsight#6986 ·
I maintainer di solito rispondono entro 1 giorno
-
core
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
vectorize-io/hindsight#6978 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di vectorize-io/hindsight
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
fedora-infra/anitya#2272 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
unitaryfoundation/mitiq#3205 ·
I maintainer di solito rispondono entro 6 giorni
-
[Bug]: Index worker test drops empty Git config values on WindowsForse già presa @xiaoyesoso l’ha presa oggi. Apertatriage/confirmed
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
agentscope-ai/agentscope#4377 · 2 commenti ·
I maintainer di solito rispondono entro 2 giorni
-
area/config comp/agent P2 type/perf
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
NousResearch/hermes-agent#161039 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
astral-sh/ty-pre-commit#46 ·