Skip to content

preset data-agent fails on DSH core 0.2.1-rc.1: unknown prompt variable "{{cwd}}" #28

Open

Description

@mishko7911

preset data-agent fails on DSH core 0.2.1-rc.1: unknown prompt variable "{{cwd}}"

Summary

preset/data-agent/agent.cordis.yml renders its persona through
@deepseek-ai/dsh-persona with an active {{cwd}} placeholder:

- id: persona
  name: '@deepseek-ai/dsh-persona'
  config:
    prefix: &data_agent_persona >-
      你是数据工程师 Agent。工作目录 {{cwd}}。可用工具:sql-query(只读 SQL,返回结构化

DSH core 0.2.1-rc.1 registers only three prompt variables — provider,
model, vision_router_mode_sync — and
@deepseek-ai/dsh-system-prompt/lib/index.js:174-177 throws on any other
name:

unknown prompt variable "{{cwd}}" in section "deployment:persona-suffix";
registered variables: provider, model, vision_router_mode_sync

Because this happens inside renderPrompt() on agent/pre-step, every session
using the data-agent preset dies at turn 1, step 1, before a single request
reaches a model and before any tool call. The session is not slow or degraded —
it never starts.

Impact (measured 2026-10-17, Windows, DSH desktop profile)

Eight sessions were killed inside a three-minute window, all at step: 1,
repeatably across retries:

09:28:03  session-9be5d66d…  turn 1  unknown prompt variable "{{cwd}}"
09:28:21  session-9be5d66d…  turn 2  (same, retry)
09:29:11  session-9be5d66d…  turn 3  (same, retry)
09:30:22  session-9be5d66d…  turn 4  (same, retry)

Knock-on damage: an automated archiver that spawns an extractor session with
this preset received turn/end {kind:'error'} at step 1 and reported the
extractor as "crashed before writing its verdict" — a false signal that sent a
repair agent to chase a nonexistent content bug.

Cause

{{cwd}} was a valid prompt variable in an older core and is no longer
registered. Nothing warns at preset load time: the preset mounts fine and fails
only when a turn actually renders the prompt.

Suggested fix

Either

  1. register cwd in the core's prompt-variable registry so presets keep
    working (and document the full variable list), or
  2. drop the placeholder from this preset — the working directory already
    reaches the prompt through the runtime context section, so nothing is lost:
    prefix: &data_agent_persona >-
      你是数据工程师 Agent。可用工具:sql-query(只读 SQL,返回结构化

Option 2 is a one-line change and is what I applied locally to unblock.

Suggested hardening

A preset that references an unregistered prompt variable should be reported at
mount time (or by a validation pass over preset/**/agent.cordis.yml), not on
the first turn of every session. An interpolate: false escape hatch or a
startup lint would turn a silent prod outage into a visible warning.

Verification after the local fix

  • No active {{cwd}} remains in any preset under ~/.dsh/.agent-presets or in
    packaged preset/ directories.
  • A guard script scanning both roots exits 0; with the placeholder
    reintroduced it exits 1 and names the exact file and line.
  • dsh-errors.jsonl shows no unknown prompt variable … cwd entries after the
    fix.

Version: @yejiming/dsh-data-agent 0.2.2, DSH core 0.2.1-rc.1.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions