Skip to content
dsh.fish
Bundle

@deepseek-ai/dsh-session-message-revision

Plugin-owned Host capability and optional browser action for revising the latest direct-human message

Source
xie-tj
stars
2 stars
License
MIT
Updated
Updated 12 days ago

Readme

# @deepseek-ai/dsh-session-message-revision

English | [中文](README.zh.md)

An optional plugin with separate Host and browser entrypoints for editing and resending the latest direct-human text message. The Host entrypoint owns admission, queueing, audit, rollback, and the generated Remote; the browser entrypoint owns only the additive Edit action.

## Features

- Accepts only the visible latest direct-human text message with non-empty text.
- Requires an idle non-subagent Agent with no queued work or pending interaction; stale identity and sequence checks reject concurrent changes.
- Queues a new message identity while preserving the session identity and append-only raw log.
- Records an ignorable `session/revision` audit event and rolls back the queued replacement when audit publication fails.
- Uses generic `historyOp` metadata independently from `surfaceOp`: current-history projections hide the superseded raw range while the ordered message surface keeps the replacement.
- Mounts the browser Remote and registers the Edit action through the existing conversation user-action Slots; it does not replace the built-in renderer.

## Composition

~~~yaml
- id: session-message-revision
  name: '@deepseek-ai/dsh-session-message-revision'
~~~

The Host and browser entrypoints are published together for this standalone distribution, but their responsibilities remain separate. Removing this row removes both the backend capability and the browser action.

The Host entrypoint requires the current `apiProxy` service, including its pending question/approval probe. A missing probe fails admission closed. The browser entrypoint requires the current Remote, locale, runtime, and conversation Slot services.

## Install

Install the prebuilt bundle into a profile:

~~~sh
dsh plugin --profile demo add github:xie-tj/dsh-easy-exit
~~~

The repository includes the published `lib/` artifacts, so Git installation does not need a build step. Restart the Web process after changing profile composition. Pin a commit when the profile must remain reproducible.

## Deployment

Use a Web profile that contains the standard Web bundle. Stop the running Web process before changing its profile dependencies.

1. Check that the installed Harness release supports the current Host and Client Remote contract:

~~~sh
dsh --version
~~~

2. Install a tagged, prebuilt plugin revision into the Web profile. The Git dependency contains its `lib/` artifacts, so pnpm does not need to run a build or an install-time script:

~~~sh
dsh plugin --profile web add github:xie-tj/dsh-easy-exit#v0.1.1-rc.2
~~~

3. Inspect the composed profile before booting it. The output must contain the `session-message-revision` bundle layer:

~~~sh
dsh --profile web --dump-config
~~~

4. Start the Web profile and verify the action with a latest direct-human text message. Click Edit, change the text, and press Enter. The replacement should become the next user message while the original remains available in the append-only log:

~~~sh
dsh web
~~~

To upgrade or roll back, install another immutable tag and restart Web:

~~~sh
dsh plugin --profile web add github:xie-tj/dsh-easy-exit#<tag>
~~~

To remove the capability, remove the package and restart Web. This removes the Host service and browser action together:

~~~sh
dsh plugin --profile web remove @deepseek-ai/dsh-session-message-revision
dsh --profile web --dump-config
~~~

If installation succeeds but the layer is absent, run `dsh plugin --profile web why @deepseek-ai/dsh-session-message-revision` and check that the installed package declares `dsh.bundle`. If boot fails with a missing Remote or service, upgrade the Harness profile to the release range listed in `peerDependencies` before retrying.

## Development

The source is kept in this repository and mirrors the Host and Client entrypoints in the [DeepSeek Harness monorepo](https://github.com/deepseek-ai/deepseek-harness). Build the artifacts from the monorepo, then copy the package publication set into this repository:

~~~sh
pnpm --filter @deepseek-ai/dsh-session-message-revision bundle
pnpm --filter @deepseek-ai/dsh-client-ui-message-revision bundle
~~~

## Model Experience

### Latest-user-message revision

#### What the model sees

The replacement becomes the next model-visible `user/message`. Generic `historyOp` metadata excludes the superseded range from the next request, while raw events, the audit record, and replacement-turn lifecycle events remain durable.

#### Token effect

The next request includes the replacement and current projected history. Superseded messages and responses are excluded from that request; durable usage records are not retroactively changed.

#### KV Cache effect

The prompt prefix from the edited message onward changes. Provider cache reuse therefore depends on the replacement text and resulting prefix.

## Known Limitations and Deferred Work

- Revisions are limited to the latest direct-human text message; images, injected context, older user messages, and subagent conversations are rejected.
- The Agent must be idle with no queued work or pending interaction.
- Tool calls, filesystem changes, network calls, and other external side effects already recorded by the session are not undone.

Install

dsh plugin --profile web add github:xie-tj/dsh-easy-exit#0427508702c3b366a1fd89cd585f134454c5aaf7

Profile: web

Source