# Conflicts: # apps/web/tests/markdown-images.e2e.ts # docs/cordis-catalog/services.md # docs/core-data-structures/session.i18n.yaml # docs/event-producer-consumer.md # examples/acp-agent/tests/snapshots/cordis-inspect-jsdoc/session.jsonl # packages/compact/compact-basic/tests/compact-basic.spec.ts # packages/context/time-context/tests/invariant.spec.ts # packages/context/time-context/tests/time-context.spec.ts # packages/core/agent-loop/src/invariant.ts # packages/core/agent-loop/tests/contract-regressions.spec.ts # packages/core/agent-loop/tests/request-reconstruction.spec.ts # packages/core/agent/tests/agent.spec.ts # packages/core/session/README.i18n.yaml # packages/core/session/src/index.ts # packages/core/session/tests/derived-cache.spec.ts # packages/core/session/tests/request-header.spec.ts # packages/core/session/tests/session.spec.ts # packages/core/session/tests/surface.spec.ts # packages/fs/tool-str-replace-editor/tests/tools.spec.ts # packages/goal/goal/tests/goal.spec.ts # packages/plan/plan-mode/tests/plan-mode.spec.ts # packages/pty/pty-local/tests/index.spec.ts # packages/pty/pty-local/tests/local.spec.ts # packages/pty/pty/tests/service.spec.ts # packages/pty/tool-bash-persistent/tests/loader-composition.spec.ts # packages/pty/tool-bash-persistent/tests/tools.spec.ts # packages/pty/tool-pty/tests/loader-composition.spec.ts # packages/pty/tool-pty/tests/tools.spec.ts # packages/session-title/session-title-all-messages-llm/tests/provider.spec.ts # packages/tasks/tasks-local/tests/tasks.spec.ts # packages/ui/user-approval/tests/approval.spec.ts
@deepseek-ai/dsh-tool-str-replace-editor
English | 中文
Standalone model-facing str_replace_editor over ctx.fs. It can be composed with persistent Bash, one-shot Bash, sandboxed Bash, or another terminal surface.
Config
| Key | Default | Meaning |
|---|---|---|
maxOutputChars |
16000 |
Prefix characters retained for file and directory views. |
description |
Editor command guide | Model-facing tool description. |
Tool
The schema provides view, create, str_replace, and insert over absolute paths. File views use one-based line numbers and preserve content tabs, so displayed text remains valid literal replacement input; directory views omit hidden, dependency, and Python-cache entries and descend two levels. Replacement requires one unique literal match and reports errors only in the public old_str vocabulary. Insert follows the selected zero-based insertion boundary without adding an implicit trailing newline. Mutations preserve tabs outside the requested edit.
Model Experience
Tool schema
What the model sees
The generated str_replace_editor schema, including the configured description. The plugin contributes no standalone system-prompt section.
Token effect
Fixed schema cost while str_replace_editor is visible.
KV Cache effect
Prefix-stable while the configured description and schema remain unchanged.
Tool results
What the model sees
Views return numbered text or a shallow directory listing. Calls expose file locations, and create/replace calls expose diff cards to presentation surfaces. Mutations return concise confirmations. Long views keep their prefix and append a clipping notice.
Token effect
Data-dependent and bounded by maxOutputChars plus the fixed clipping notice.
KV Cache effect
Append-only tool results follow the reusable request prefix.
Known Limitations and Deferred Work
- Operations target UTF-8 text; binary files are unsupported.
str_replaceintentionally rejects zero or multiple matches and has noreplace_allargument.- Every mutation goes through
fs/write-intentorfs/edit-intent, resolves the current session sandbox policy, and delegates enforcement to the mounted filesystem and policy plugins.