[Bug]: OpenCode v2 skips an assistant message that gains text after an earlier capture
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 72/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- node.js, typescript
- Domain
- backend
Research direction
Start in the OpenCode v2 plugin's context capture entry point, where the cursor map is persisted as the last message ID of the snapshot; that persisted cursor is what slices the second snapshot. Reproduce with two fixtures — a snapshot whose trailing assistant message is empty, then the same IDs with text, captured with a fresh in-memory cursor map — and check the events handed to the session manager. Done means the second capture emits the assistant message and its text without resending the user message, with the cursor kept at the newest event-producing message.
Written by the indexing model from the issue text.
Description
Issue Origin
Reproduced locally through the OpenCode v2 context capture entry point with fixture snapshots.
Bug Description
The OpenCode v2 capture cursor is persisted at the last message ID in the context snapshot, even if that message did not emit any capture events. When a trailing assistant message gains visible text under the same ID after the first snapshot, the later capture skips it.
Steps to Reproduce
- Capture an OpenCode v2 context snapshot with a user message followed by an assistant message whose content is still empty.
- Capture the snapshot again with the same message IDs and text in the assistant message. A second capture may use a fresh in-memory cursor map to exercise the persisted cursor.
- Check the events passed to the session manager.
Expected Behavior
The second capture emits the assistant message and its text, without resending the user message.
Actual Behavior
The second capture emits no events. The first capture saved the ID of the empty assistant message, so the second snapshot is sliced after that ID.
OpenViking Version
Current main at 39db38ac3c7f726f87b7f08e5488739ff6c24313, OpenCode plugin 0.5.30, macOS and Node 22.22.3.
Additional Context
Keep the cursor at the newest message that produced capture events. This retains progress for normal turns and lets an uncaptured trailing message be reconsidered. The local test uses the plugin's context capture path and does not require a model or a running OpenCode host. Codex assisted with the investigation and reproduction.
- Dominant language
- Python
- Stars
- 42.6k
- Forks
- 3.6k
- Avg merge
- 15h 44m
- Merged PRs (30d)
- 558
Getting set up
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from volcengine/OpenViking
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
volcengine/OpenViking#8116 · 2 comments ·
Maintainers usually reply within 1 day
-
[Bug]: parse_memory_file_with_fields parses first MEMORY_FIELDS match instead of trailing trailer, silently corrupting metadataPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
volcengine/OpenViking#8113 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
volcengine/OpenViking#7732 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
volcengine/OpenViking#7622 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
volcengine/OpenViking#7620 ·
Maintainers usually reply within 1 day
All issues in volcengine/OpenViking
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
ActivityWatch/docs#223 ·
-
comp/tools P2 tool/skills type/bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
NousResearch/hermes-agent#159541 ·
Maintainers usually reply within 1 day
-
bot-triaged module: correctness (silent) module: cpu module: empty tensor module: loss triage review
Difficulty 1/5 Under an hour Newbie friendliness 80/100
Maintainers usually reply within 1 day
-
request-theme
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
LizardByte/ThemerrDB#10167 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
equinor/fmu-drogon#153 ·