A second externalize_group pass re-externalizes an already externalized source read and shrinks its recorded size and digest
I maintainer di solito rispondono entro 1 giorno
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 25/100
Direzione di ricerca
Read openviking/session/tool_output_externalizer.py, especially externalize_group, _rewrite_source_read_tool_output, and hydrate_for_extraction, then inspect the regression test described in the issue. Reproduce the second-pass rewrite and verify the original size and digest remain intact and hydration retrieves the full referenced output. PR #7420 is already open against this issue.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
A second externalize_group pass re-externalizes an already externalized source read
Bug Description
A session externalizes tool output twice for the same messages: Session.add_messages_async calls externalize_group when messages are added, and the commit path calls it again over build_turns(self._messages) for Turn-wide retention. ToolOutputExternalizer.externalize_group (openviking/session/tool_output_externalizer.py:313) runs _rewrite_source_read_tool_output() before checking the already-externalized guard (if part.tool_output_ref and part.tool_output_truncated: continue).
For an openviking_tool_result_read part, the first pass replaces the full read output with a preview and records the real size and digest in tool_output_original_chars / tool_output_sha256. On the second pass part.tool_output is already that preview, so _rewrite_source_read_tool_output (tool_output_externalizer.py:185) renders a preview of the preview and overwrites those fields:
tool_output_original_charsbecomes the preview length instead of the full read size (this also shrinksgroup_original_chars, which recomputes from the same field);tool_output_sha256becomes the digest of the preview, not of the referenced content.
hydrate_for_extraction uses tool_output_original_chars as the read limit for source reads (tool_output_externalizer.py:139-148), so memory extraction is hydrated with only the first preview-sized slice of the original tool output while the stub digest claims to match it.
Steps to Reproduce
- Add an assistant Turn containing an
openviking_tool_result_readpart whosetool_outputis a long tool result (e.g. 20,000 characters). - Call
externalize_grouponce (message add path) and then again over the same messages (commit path). - Inspect
tool_output_original_charsandtool_output_sha256, then hydrate the part.
Expected Behavior
The second pass leaves the part unchanged: the original size and digest still describe the full referenced tool output.
Actual Behavior
The second pass rewrites the preview; tool_output_original_chars equals the preview length and tool_output_sha256 is the preview digest, so hydration reads back only the preview-sized slice.
Environment
- OS: Windows 11
- OpenViking version/commit: main @
95d96162
Additional Context
Fix submitted as PR #7420: the already-externalized guard runs before any rewrite, and the source-read rewrite is a no-op when tool_output_source_ref already points at the same reference (which also covers short reads where the first pass leaves truncated false). The regression test fails on unmodified main.
- Lingua principale
- Python
- Stelle
- 41.8k
- Fork
- 3.4k
- Merge medio
- 19h 29m
- PR unite (30g)
- 500
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
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 volcengine/OpenViking
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
volcengine/OpenViking#7485 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
volcengine/OpenViking#7210 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
volcengine/OpenViking#7205 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
[Bug]: Retrieval rerank fallback statistics stay zero after provider failureForse già presa @97Three l’ha presa 8 giorni fa. Apertabug kernel
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
volcengine/OpenViking#7014 ·
I maintainer di solito rispondono entro 1 giorno
-
[Bug]: memory.prefetch_search_topn is inert above 5 (call site omits limit), plus two docstrings state the wrong defaultsForse già presa @peterzhang987723 l’ha presa 8 giorni fa. Apertakernel
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
volcengine/OpenViking#6923 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di volcengine/OpenViking
Issue simili
-
fuzz fuzz-unconfirmed
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
Switch to ruffAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
Qiskit/qiskit-aer#2533 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
etesync/etesync-dav#376 ·