1jehuang / 1jehuang/jcode

Critical Issue: /rewind n rewinds to a wrong number

Open
#688 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug needs-info priority: high triage: unclear
Dominant language
Rust
Stars
19.9k
Forks
2.3k
Avg merge
2d 7h
Merged PRs (30d)
30

Description

In a new session, the first time a user runs /rewind n rewinds to the prompt directly before the one included in the command (instead of message 5, message 4 for example). This is undoable using the /rewind undo command, which works fine. Any attempts at rewinding to a specific number, however, are absolutely broken, where any number the user inputs to the /rewind command gets completely discarded and the result is that the chat is rewinded to the message the user rewinded to the first time (in the upper example, after an undo, /rewind 11 would still rewind back to message 4), completely butchering over the chat history and possible the context window of the session. I do see that issue #432 is a duplicate, however the issue still persists and needs another bugfix.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the behavior in a new session with /rewind n, then use /rewind undo and try a different number. Trace the /rewind command handling and verify that each supplied number selects the requested message rather than reusing the first rewind target. Done means specific rewinds remain correct after undoing and repeating them.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.