Skip to content

fix(dsh): match DSH 0.2.1 credentials behaviour; show run failure reason in prompt TUI - #57

Merged
dancingteeth merged 5 commits into
mainfrom
fix/dsh-credentials-layout-v1
Nov 12, 2026
Merged

dancingteeth merged 5 commits into
mainfrom
fix/dsh-credentials-layout-v1

Conversation

@dancingteeth

Copy link
Copy Markdown
Owner

Why

A DSH-worker loop in a consumer repo could not get past iteration 1 with DSH 0.2.1-rc.3:

  1. The pre-WORKER preflight (added in 0.6.3) rejected ~/.dsh/.credentials.yaml as "not flat". DSH 0.2.1 reversed its format: credentials-local now requires layout v1 (version: 1 + refs: + DSH-owned records:) and auto-migrates the old flat map. Since dsh web writes layout v1, the harness was blocking the only valid store.
  2. With that fixed, the run died with MISSING_CREDENTIAL, even though the key was in refs:. DSH's --profile headless mounts no credentials service, so the worker only sees DEEPSEEK_API_KEY from the launching environment. The preflight still printed credentials ok worker=dsh.
  3. agent-loop-prompt sends run output to prompt-run.log, so its done screen only said run exited 1, with no reason.

What changed

  • fix(dsh): accept credentials layout v1. dshCredentialsDocumentProblem accepts layout v1 and the migratable flat map. It rejects only what DSH itself refuses: a version other than unquoted 1, non-POSIX or non-string refs, or a flat map DSH can't migrate. It still scans structure only and never echoes values. formatDshHeadlessFailure also matches DSH's new error strings. DSH_CREDENTIALS_FLAT_HINT is renamed to DSH_CREDENTIALS_LAYOUT_HINT.
  • fix(dsh): require DEEPSEEK_API_KEY in env. requiredCredentialNeed('dsh') now needs the env var, with a note explaining that the credentials file isn't enough. agent-check dsh exits 1 without it.
  • feat(prompt): show why a run failed. The done screen (and --plain stderr) shows the AGENT_LOOP_DONE reason, falling back to the last failed:/error line, plus the log path. It reads only this run's slice of the append-only log, using an offset recorded at spawn, so stale reasons never appear. New helper: parseLoopCompletionSignalLine.
  • docs: frontmatter tags (type/app, agentic_ai) on docs, plugin skills and templates. This is unrelated tagging, kept as its own commit.

Reviewer notes

  • Behaviour change: DSH loops without DEEPSEEK_API_KEY exported now abort up front. Before, they passed preflight and failed on iteration 1 anyway, so no working setup should break.
  • Checked by hand against dsh 0.2.1-rc.3: dsh --profile headless fails with MISSING_CREDENTIAL without the env var and succeeds with it, using the same layout-v1 store.
  • docs/dsh-runtime.md says "Before agent-looper 0.8.6", which assumes this ships in the next release. There's no version bump or CHANGELOG entry yet.
  • Tests: focused vitest runs over src/agents/dsh*, src/loop/loopCredentialPreflight, src/cli and src/integrations (197 tests pass); pnpm typecheck is clean. I haven't run the full suite locally.

🤖 Generated with Claude Code

dancingteeth and others added 4 commits November 12, 2026 03:28
DSH 0.2.1 credentials-local reads `version: 1` + `refs:` (and DSH-owned
`records:`), and auto-migrates the old flat KEY: "string" map. The 0.6.3
preflight still demanded the flat map, so every DSH loop whose store was
written by `dsh web` aborted before WORKER.

The structure-only scan now accepts both layouts and rejects only what DSH
itself refuses: a version other than unquoted 1, non-POSIX or non-string
refs, or a flat map DSH cannot migrate. Headless stderr collapse also
matches DSH's new error strings.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
agent-loop-prompt sent run output to prompt-run.log, so a failed run only
showed "run exited 1". The done screen (and --plain stderr) now shows the
AGENT_LOOP_DONE reason, falling back to the last failed:/error line, plus
the log path. Reads only this run's slice of the append-only log.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
DSH 0.2.1 `--profile headless` mounts no credentials service, so a key in
~/.dsh/.credentials.yaml (what the web Models page writes) never reaches
the worker. The preflight still printed "credentials ok worker=dsh" and the
run died with MISSING_CREDENTIAL on iteration 1.

agent-loop run / run-batch and agent-check dsh now abort up front unless
DEEPSEEK_API_KEY is exported, with a note explaining why the file is not
enough. Verified against dsh 0.2.1-rc.3: headless fails without the env
var and succeeds with it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 7ac07a56-6bd8-4ee3-832d-001293a84910
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

- package.json 0.8.6.
- Version labels kept in sync: README current line, CONSUMERS.md,
  docs/embed-api.md, llms.txt, site/ pages + site/llms.txt, and the site
  version test.
- Site DSH guidance (site/llms.txt, harnesses page) no longer tells users to
  flatten ~/.dsh/.credentials.yaml; it says to export DEEPSEEK_API_KEY and
  that layout v1 is fine. Site test beats updated to match.
- CHANGELOG: 0.8.6 — DSH 0.2.1 credentials compatibility; prompt TUI shows
  the failure reason.

Verified: pnpm test (vitest 1285 + node suites), typecheck, build.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dancingteeth
dancingteeth merged commit 7137137 into main Nov 12, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant