DeepSeek Super-agent Hands-on: Automating GitHub Issue to PR Workflow

This tutorial walks through deploying DeepSeek's Super-agent prototype to automatically fix a CSV escaping bug via GitHub Issues, covering setup, permissions, task initiation, progress monitoring, iterative requirements, code review, and failure recovery — all without independent deployment verification.

Architect
Architect
Architect
DeepSeek Super-agent Hands-on: Automating GitHub Issue to PR Workflow

The article provides a step-by-step guide to using DeepSeek's Super-agent prototype to automate a GitHub Issue-to-PR workflow for a CSV field-escaping bug. The example uses a fictional repository acme/widgets and an agent account @csv-fix-agent to demonstrate the end-to-end process.

Account and Environment

Prerequisites include Node.js ^22.19.0 || >=24.0.0, pnpm (pinned to [email protected] via packageManager), git 2.32+, Python 3.8+, tmux, GitHub CLI 2.48+, and a configured DeepSeek Harness (DSH) model provider. A dedicated GitHub user account (not a GitHub App) must be invited to the target repository with write access so the agent can receive notifications, push branches, and open PRs. The article shows how to isolate the agent's gh credentials using a wrapper script:

mkdir -p ~/.local/bin
cat > ~/.local/bin/gh-agent <<'EOF'
#!/bin/sh
GH_CONFIG_DIR="$HOME/.config/gh-agent" exec gh "$@"
EOF
chmod +x ~/.local/bin/gh-agent
"$HOME/.local/bin/gh-agent" auth login
"$HOME/.local/bin/gh-agent" api user --jq .login

The wrapper's absolute path (e.g., /home/me/.local/bin/gh-agent) is later entered in the web panel. The OS user running commands remains the deployer; permissions default to danger-full-access. For stronger isolation, the official docs suggest a separate OS account.

Installation and Startup

Commands are based on the prototype commit 6337fc823ce20251c8de8085948165c81aaa701e:

npm install -g @deepseek-ai/[email protected]
git clone https://github.com/deepseek-ai/dsh-superagent-prototype.git dsh-superagent
cd dsh-superagent
git checkout 6337fc823ce20251c8de8085948165c81aaa701e
pnpm install && pnpm build
dsh superagent --from-default-profile web --dump-config > /dev/null
dsh plugin --profile superagent add "link:$PWD"

Warning: do not re-run --from-default-profile on an existing profile; it overwrites configuration and deletes cordis.patch.yml. Copy the example config for a new profile:

cp examples/profile.cordis.patch.yml "$HOME/.dsh/profiles/superagent/cordis.patch.yml"

Edit stateDir to an absolute path (e.g., /home/me/.dsh/state/superagent). Start the service and check status:

scripts/dsh-superagent start
scripts/dsh-superagent status

Open http://127.0.0.1:3082, navigate to the Superagent panel. The Overview page lists missing configuration items.

Permissions and Code Setup

In Settings → Sources → GitHub , enable GitHub, enter the repository ( owner/name), and paste the wrapper's absolute path as Agent CLI. Keep receive-all switches off initially; tasks are triggered by explicit @ mentions. In Settings → Eval → On each Source → GitHub , add the requester's GitHub login to the allowed list (empty by default). The default mode is observe; explicit @ mentions work in off, observe, and auto modes. The three modes differ in whether the agent can infer and accept work without an explicit mention: off: no inferred candidates. observe (default): evaluates candidates but only logs would_accept, does not execute. auto: accepts work if evaluation passes and at least one enabled rule matches.

Clone the target repository separately for the agent to modify:

mkdir -p /home/me/src
git clone https://github.com/acme/widgets.git /home/me/src/widgets

In Settings → Execution , set directory root to /home/me/.dsh/state/superagent/work and configure prepare to create a worktree from the local clone. The prepare command uses environment variables provided at runtime:

git -C /home/me/src/widgets fetch --no-tags \
  "https://github.com/$DSH_SUPERAGENT_GITHUB_REPOSITORY.git" \
  "${DSH_SUPERAGENT_GITHUB_PR_HEAD:-HEAD}:refs/dsh-superagent/$DSH_SUPERAGENT_TICKET" &&
git -C /home/me/src/widgets worktree add \
  -b "agent/$DSH_SUPERAGENT_NAME" \
  "$DSH_SUPERAGENT_DIR" \
  "refs/dsh-superagent/$DSH_SUPERAGENT_TICKET"

Set concurrency to 1 and choose the execution model. In Settings → Prompts , configure commit and review requirements: use the agent's own commit identity, describe actual checks run, and remove the auto-merge paragraph from SETUP.md (no merge CLI configured). The panel's Check again button re-validates after external CLI login changes.

Initiating the Fix

Using an allowed-list account, post a new comment on Issue #42 (editing the issue body does not generate a notification):

@csv-fix-agent 请修复本 Issue 的 CSV 字段转义问题。

复现输入:两个字段分别是 上海,浦东 和 他说"你好"。
期望同一行导出为:"上海,浦东","他说""你好"""

请先定位现有导出实现,补充包含逗号、双引号、换行的回归用例,
沿用项目现有 CSV 约定或库。保留现有接口、分隔符和编码约定,
不修改 UI,不做无关重构。

完成后提交 PR,说明复现方式、改动、实际运行的检查及未完成项。
等待人工审查,不自动合并。

The agent receives the request in the next polling interval (default 60 seconds).

Monitoring Progress

In the panel's Overview, find the ticket by Issue URL or #42. Open Execution ticket details to see current activity, execution logs, and questions requiring human answers. Key status labels:

Queued : waiting for an execution slot.

Working : actively processing.

Awaiting answer : needs human clarification; questions listed in details.

Awaiting review : agent reported ready with a tracked PR awaiting review. ready means the agent considers the work reviewable, not merged. If ready appears without a PR, the ticket may close directly. Clarifications and progress queries can be added as new comments on the original issue; the agent continues on the same task without re-explaining context.

Adding Requirements

After initial changes cover commas, quotes, and newlines, a review might reveal missing empty-field tests and encoding compatibility checks. Append a comment on the same issue (or the PR):

@csv-fix-agent 请在这项修复里再覆盖空字段,并检查现有编码约定
是否保持兼容。仍然只改 CSV 序列化,不扩展到导出页面。

The original agent continues on the same branch and PR, adding tests and updating the PR. The panel shows Delivered to Ticket without a new evaluation. If the new request exceeds the original scope (e.g., rewrite the entire export page), the agent should hand the message back to the system for a new work decision. After a task ends, further comments can still revive it if the original conditions (allowed list, no manual Stop) hold. For inferred tasks, revival requires auto mode and the original matching rule still enabled. Bot and CI messages do not revive ended tasks.

Review and Merge

Human review checks: clear explanation of the escaping bug, fix approach, added test cases, actual checks run, and any failed or unrun checks. The article provides a concrete test matrix for the CSV fix:

Test Input: Field 上海,浦东 — Expected Result: Exported as "上海,浦东"; parses back as one field.

Test Input: Field 他说"你好" — Expected Result: Exported as "他说""你好"""; quotes preserved on parse.

Test Input: Field with literal newline — Expected Result: Field wrapped in double quotes; parse retains single record with internal newline.

Test Input: Empty string in first, middle, last column — Expected Result: Empty strings remain in original columns; field count unchanged; format follows project convention.

Test Input: Normal field without special chars — Expected Result: Existing export/parse behavior unchanged; no regression.

Encoding compatibility must be verified separately: confirm character encoding and BOM usage from original implementation, docs, or tests, then validate exported bytes with a fixed Chinese sample. Field escaping and encoding are independent checks. Regression tests must fail on the pre-fix implementation (due to comma, quote, or newline errors) and pass after the fix; compile-only success is insufficient. Diffs must not include unrelated UI changes or dependency upgrades. All checks, CI runs, and reviews must reference the current PR commit SHA; new commits require re-verification. Further adjustments continue via PR comments; the agent processes in-scope changes. Final merge is performed manually in GitHub (no auto-merge CLI configured). The panel shows Pull request merged upon completion. New regression tests should be retained; stable encoding conventions can be codified in project rules (e.g., Magpie's LESSONS.md).

Failure and Recovery

No ticket after @ mention : verify new comment, requester in allowed list, GitHub source enabled, Pause processing off. Check Source credentials, Trigger for the comment, Eval for acceptance reasoning. Distinguish between message not arriving vs. not starting work; do not blindly switch observe to auto.

Prepare fails : open ticket, inspect command output, verify local clone path, agent repo permissions, and command syntax. Fix and click Retry or add a comment to retry preparation. Prepare failures do not auto-retry like transient model errors.

Blocked, Failed, or Input undelivered mid-task : address the blocker or delivery issue from details. Retry restarts the agent on the same session, directory, branch, and PR, preserving changes. If a human comment was delivered during blocked/failed state, the agent continues or re-queues; panel Retry disappears, but delivery failures remain retryable.

Service restart : session and directory persist; running agents restart with a recovery prompt. Agent must check working directory, Git history, and GitHub to see what's done (especially remote commits/PRs) before continuing.

Service issues after restart : scripts/dsh-superagent status exit codes: 1 — check service and startup logs; 2 — inspect component errors; 3 — complete pending configuration. Codes 2 and 3 require specific fixes; repeated restarts won't help. Logs at .artifacts/dsh-superagent-superagent-*.log.

Abandoning a fix : click Stop in panel to revoke authorization. Unlike Retry after failure, manual stop prevents comments from reviving the task; a new comment would be a fresh request. Writing "stop" in a comment is still a pending message; use panel Stop for immediate halt.

Broader Scenarios

The article outlines additional use cases (design concepts; current prototype supports single GitHub repo and optional Feishu):

CI failure follow-up : collect failure logs, associated commits, environment info in one issue; agent organizes failure step, hypotheses. New logs or re-run results appended to same discussion for hypothesis validation.

API latency investigation : feed alert summary, metrics, sanitized logs; agent timelines phenomena and questions. New data or change records added to same topic to correlate latency recovery, eliminate explanations, identify missing evidence. Co-occurring changes are clues, not root cause proof.

Project version and errata tracking : agent summarizes known issues, upgrade concerns, official notes for a dependency. New releases or errata appended for diff analysis; team decides upgrade timing.

Home repair tracking : consolidate device model, photos, repair records, quotes in one task. New quotes or symptoms added for comparative analysis; human confirms next steps.

Automation of data collection (CI logs, monitoring, official sites) and actions (deploy, restart, payments) requires additional integrations and authorizations beyond the prototype.

References

DeepSeek Super-agent Prototype README:

https://github.com/deepseek-ai/dsh-superagent-prototype/blob/6337fc823ce20251c8de8085948165c81aaa701e/README.md

SETUP.md (assisted configuration):

https://github.com/deepseek-ai/dsh-superagent-prototype/blob/6337fc823ce20251c8de8085948165c81aaa701e/SETUP.md

006 Deployment (Accounts, Install, Settings, Troubleshooting):

https://github.com/deepseek-ai/dsh-superagent-prototype/blob/6337fc823ce20251c8de8085948165c81aaa701e/docs/006-deployment.md

005 Panel (UI pages and operations):

https://github.com/deepseek-ai/dsh-superagent-prototype/blob/6337fc823ce20251c8de8085948165c81aaa701e/docs/005-panel.md

002 Authorization (Explicit delegation, acceptance modes, revival conditions):

https://github.com/deepseek-ai/dsh-superagent-prototype/blob/6337fc823ce20251c8de8085948165c81aaa701e/docs/002-authorization.md

003 Execution (Task states, PR tracking, failure recovery):

https://github.com/deepseek-ai/dsh-superagent-prototype/blob/6337fc823ce20251c8de8085948165c81aaa701e/docs/003-execution.md

008 Cookbook (Extending sources):

https://github.com/deepseek-ai/dsh-superagent-prototype/blob/6337fc823ce20251c8de8085948165c81aaa701e/docs/008-cookbook.md
Flowchart: supplementary comments on original Issue or PR continue the same fix, update PR, then human review and merge
Flowchart: supplementary comments on original Issue or PR continue the same fix, update PR, then human review and merge

}

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

automationdeploymentDeepSeekAI agentGitHubPR workflowSuper-agentCSV escaping
Architect
Written by

Architect

Professional architect sharing high‑quality architecture insights. Topics include high‑availability, high‑performance, high‑stability architectures, big data, machine learning, Java, system and distributed architecture, AI, and practical large‑scale architecture case studies. Open to ideas‑driven architects who enjoy sharing and learning.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.