rea
morluto
Reverse engineer anything with agents, from app behavior down to native binaries.
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:ixietv/dsh-session-rewind
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
English | 中文
Rewind the conversation you are in — same session, no fork, no new tab.
DSH's official flow for "undo a few turns" is either a new fork or hand-editing state. dsh-session-rewind adds a single command — /rewind — that folds the tail of the current conversation away in place. The sessionId never changes, the event log stays append-only, and the model genuinely forgets the folded turns on its next request.
This is not a fork. Nothing is deleted from disk, no .jsonl is rewritten, no new session appears in the sidebar.
| Scenario | Before | With dsh-session-rewind |
|---|---|---|
| Bad turn, want a clean retry | Start a new session, lose context | /rewind 1, keep everything before it |
| Prompt went sideways mid-thread | Fork and re-explain | /rewind 3, continue in place |
| Trim a long exploration | Manual pruning | One click in the turn action row |
session.append('user/message', checkpoint, { surfaceOp: 'replace' }); sessionId unchanged.deriveMessages(), so the next request really lacks them./rewind [<turn>] command, plus an icon button in the official conversation.chat.assistant-actions row.PERSIST_FAILED instead of pretending success.react.git clone https://github.com/ixietv/dsh-session-rewind.git "$HOME/.dsh/plugins/dsh-session-rewind"
Then restart DeepSeek Harness. The Loader picks up cordis.patch.yml and inserts the Host row; the Web shell loads lib/client.js via dsh.client.platform: "web".
| Entry | Syntax | Behaviour |
|---|---|---|
| Command | /rewind |
Rewind past the most recent turn |
| Command | /rewind 3 |
Rewind to before turn 3 |
| UI | Turn action-row icon | Hover a turn, click to rewind to it |
User: /rewind <turn>
│
▼
Host (lib/host.js) ── validate turn, agent idle, no rewind in flight
│
▼
Locate target turn/start seq ── collect every surface node up to the tail
│
▼
session.append('user/message', checkpoint, { surfaceOp: 'replace', sourceEventSeqs })
│
▼
ctx.sessions.flush(session) ── persist; failure → PERSIST_FAILED
│
▼
Client (lib/client.js) ── hide folded DOM rows, mark via sessionStorage
dsh-session-rewind
├── lib/host.js # Host half: register /rewind, compute cut point, append checkpoint
├── lib/client.js # Web client half: action-row button, DOM hiding, rewind marks
├── cordis.patch.yml # Loader patch: insert one Host row (no override/isolate)
├── docs/design.md # Round-2 contract: semantics, decisions DEC-1..DEC-12
├── docs/research.md # Surface-primitive and command-system research
├── docs/research-truncate.md # Truncation / tool-pairing semantics
└── docs/verification.md # Verification log and acceptance evidence
| Module | Responsibility |
|---|---|
lib/host.js |
Owns the command, the cut point and the single surfaceOp: replace append |
lib/client.js |
Owns the trigger surface and the visual disappearance of folded rows |
cordis.patch.yml |
Composes next to official modules instead of replacing them |
{ kind: 'user' } — inside the closed MessageSourceMap; it is not rendered as a user bubble because replace checkpoints are not "append surface" events.node --check lib/host.js
node --check lib/client.js
Does this create a new session? No. The whole point is that it does not.
Is history deleted from disk? No. Events stay; only the derived surface stops exposing them.
Can I undo a rewind? Not in-place. The folded nodes are no longer on the surface.
MIT
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: deepseek-harness。