GitHub issue service for DSH: turns a telemetry failure analysis into a uniform issue report, builds a pre-filled new-issue URL that is shortened when it would exceed a configured length budget, rewrites a plain description into a structured issue with the deployment's model, and closes the intake loop by listing the open issues that carry a claim label and handing each one to a fresh session, placed in the Workspace registered for the configured directory when one matches and left ungrouped otherwise, as a one-shot automation task on the host's Schedule service, which delivers the rendered prompt into that session when the task comes due and shows up on the Web Automation tasks page (a host with no Schedule service admits the prompt directly instead), skipping issues an earlier pass already dispatched, leaving the local day uncommitted when every dispatch is refused so the next startup tries again, and repeating the pass on the first start of each local day when autopilot is enabled.
Install
# from npm (prebuilt)
dsh plugin --profile web add @zhangj1164/dsh-github-issue
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:zhangj1164/dsh-mega-plugins#path:/packages/github-issue/dsh-github-issue
Any plugin you install runs third-party code with your own permissions — it can read your files, use your credentials, and reach the network, and tool approvals don’t sandbox it. GitHub-sourced plugins also run build scripts at install time — pnpm blocks those until you allow them, so an install can stop with ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED or ERR_PNPM_IGNORED_BUILDS; dsh prints the exact key to add under allowBuilds in your profile’s pnpm-workspace.yaml, and the install works on the next run. Allowing a build is a trust decision: only install sources you trust, and pin a commit (github:owner/repo#sha).
README
English | 中文
GitHub issue generation and optimization service for DeepSeek Harness. Builds structured issue reports from telemetry analysis, constructs pre-filled issue-creation URLs, optimizes natural-language issue descriptions with the configured model, and closes the intake loop: filing the report through the GitHub API, listing the issues that carry the claim label, and handing one to a fresh Session on the first startup of the local day.
Plugin
GithubIssueService extends TypertRemoteService with static inject = ['llm']. The service uses ctx.get('llm') for model calls and exposes seven Remote methods callable by the client UI.
| Config | Default | Meaning |
|---|---|---|
repoUrl |
https://github.com/zhangj1164/dsh-mega-plugins |
Default repository URL for issue prefill when a request omits repoUrl. |
maxPrefillUrlLength |
7000 |
Longest pre-filled issue URL to produce, counted in characters. GitHub refuses a request URL that is too long and shows an error page instead of the new-issue form, and it publishes no stable constant for the boundary, so this carries headroom and is deployment-tunable. 0 disables shortening. |
prefillTruncationNote |
a Chinese note | Appended to the issue body when the URL had to be shortened, so the reader knows the body is partial. |
provider |
unset | Provider route for model calls. Unset follows the deployment's agentDefaultModel selection, so a deployment can pin issue generation from cordis.yml alone. |
model |
unset | Model id for model calls. Unset follows the same fallback as provider. |
tokenEnv |
GITHUB_TOKEN |
Environment variable read for the GitHub token when token is unset. An empty name disables the lookup. |
token |
unset | Explicit GitHub token. Set it when the deployment manages secrets itself; it wins over the environment and the command. |
tokenCommand |
gh auth token |
Command whose standard output is the token, run only when neither token nor tokenEnv supplies one. A successful result is reused for the process; a failed run is retried on the next call rather than cached, so a transient keyring failure or a slow host startup cannot disable GitHub until the next restart. The default reuses the credential the gh CLI already stores; set it to an empty string to disable the lookup. |
tokenCommandTimeoutMs |
10000 |
Deadline for tokenCommand, in milliseconds. The deadline is checked against the child's real state after it fires, so a command that finished while the host's event loop was busy is not mistaken for one that hung. |
apiBaseUrl |
https://api.github.com |
GitHub REST origin. An Enterprise deployment sets its own https://host/api/v3. |
requestTimeoutMs |
15000 |
Deadline for one GitHub REST request, in milliseconds. |
claimLabel |
ready-for-agent |
Label that marks an issue claimable by the intake loop. The repository's triage vocabulary owns the value; this field only names which label counts. |
maxIssuesPerRun |
3 |
Largest number of issues one intake pass may dispatch. |
autopilotEnabled |
false |
Whether the host checks for claimable issues on its first startup of the local day. Off by default: opening a Session without being asked is a deployment decision. |
autopilotCwd |
empty | Working directory the dispatched Sessions own. Empty follows the host's default directory. A directory registered as a Workspace places the dispatched Session in that Workspace's sidebar group; a directory that matches none leaves it ungrouped. |
autopilotPreset |
empty | Agent preset the dispatched Sessions run. Empty follows the deployment default. |
autopilotTimeZone |
empty | IANA zone "today" is measured in. Empty follows the host's own zone, so the user's local midnight starts a new day. |
autopilotPrompt |
the built-in template | Prompt handed to every dispatched Session. Placeholders {number}, {title}, {url}, {body}, and {labels} are replaced; an unknown placeholder stays visible. |
dispatchTaskDelaySeconds |
1 |
Seconds between registering a dispatch's automation task and its delivery, 1–3600. The Schedule service refuses a non-positive delay, so this cannot be 0. |
Settings-editable fields. Eight of these fields — repoUrl, claimLabel, maxIssuesPerRun, autopilotEnabled, autopilotCwd, autopilotPreset, autopilotTimeZone, and autopilotPrompt — are declared .volatile(), which is what lets @zhangj1164/dsh-client-ui-memo-settings expose them in the Settings panel: dsh-settings projects only volatile fields, an accepted write lands in the profile's user layer, and the service reads each value where it is used instead of copying it at construction, so the change reaches the running process without a restart. autopilotEnabled is read by the Service.init startup check, so flipping it applies from the next host start. The remaining fields stay deployment-only.
Remote methods
| Method | Behavior |
|---|---|
generateReport(request) |
Calls the model with a built-in structuring prompt to produce a uniform GitHub issue report from telemetry failure analysis. Returns a GithubIssueReport with title, body, and labels. The request names the pluginIds it covers — one report spans a whole suite — plus the analysis window and, per failure group, the route, the last failure time, and the attempts that followed it; the per-group facts are optional, and a missing one is passed to the model as not recorded rather than omitted. |
prefilledIssueUrl(request) |
Builds a pre-filled GitHub issue-creation URL from a report. Validates the repo URL; returns invalid-url on failure. Shortens the body when the composed URL would exceed maxPrefillUrlLength, which is a budget the title and labels also spend and percent-encoding inflates, so the check is on the URL rather than the body alone. |
optimizeIssue(request) |
Rewrites a natural-language description into a structured issue following a pinned Markdown template. Returns empty-input for blank descriptions, route-missing when no route resolves, llm-failure when the model call failed. |
createIssue(request) |
Files the report through the GitHub REST API and returns the created issue's { number, url }. The body is filed without its leading ## title heading, because GitHub takes the title as its own field. |
listClaimableIssues(request) |
Lists the open issues carrying the claim label, excluding pull requests, which GitHub's issue endpoints also return. |
dispatchIssue(request) |
Creates one Session through the Session controller, names it, and registers the rendered prompt as a one-shot automation task on the Schedule service, which delivers it into that Session, in the Workspace registered for the configured directory; returns its sessionId. A deployment that mounts no Schedule service admits the prompt directly instead. |
runIntake(request) |
Runs one pass: lists the claimable issues, skips those an earlier pass already dispatched, dispatches the rest, and records the local day durably. |
The intake methods report one stable failure code instead of a raw fetch error: auth-missing, credential-unresolved, auth-failure, rate-limited, invalid-repo, invalid-request, http-failure, network-failure, session-unavailable, or dispatch-failed. auth-missing is separate from auth-failure because no credential and a rejected credential are different deployment problems with different fixes. credential-unresolved means a configured credential source failed to produce a token — its message names the command problem — so a transient failure of tokenCommand is not grouped with a deployment that has no credential at all.
Model route
Both model-calling methods resolve their route the way the memo service does: the request's provider/model, then this service's Config, then the deployment's agentDefaultModel selection. The request fields are therefore optional, and the client UI sends them only when the user picked a model — the browser never has to publish a route for a call to work.
A blank value counts as absent rather than as a value, so an omitted field still reaches the deployment default instead of travelling to the model as an unusable route. When nothing resolves a route, the call returns route-missing and no model call is attempted: a call without an adapter cannot succeed, and reporting it as llm-failure would name the model for a routing problem.
Failure facts
A failed call keeps what DSH reported instead of collapsing it into one message. llm-failure carries the machine-routing code and the route in its message — model call to provider "custom" model "glm-5-2-260617" failed: NO_ADAPTER: no adapter registered for provider "custom" — so NO_ADAPTER (a route this deployment never registered), AUTH, RATE_LIMIT, and EMPTY_RESPONSE (the model genuinely returned no text) stay distinguishable. Reporting all of them as "the model produced no output" is what sent a user hunting for a model problem in a request that never reached a model.
A stream that throws a transport error rather than yielding a terminal finish chunk becomes LLM_STREAM_THREW, not an exception escaping the call.
Telemetry
Both model-calling methods report to the local telemetry service when the deployment has one, and behave identically when it does not. The service is read with ctx.get('telemetry') and deliberately not declared in static inject: this package installs on its own bundle, and a diagnostic dependency must never be the reason a service refuses to activate.
| Event | Recorded |
|---|---|
| A call that worked | Action optimizeIssue / generateReport as success, with the route that served it |
| A failed call | The preserved DSH code, message, and HTTP status, the route, and the github-issue:<action> feature anchor |
| A call with no resolvable route | Code NO_MODEL_ROUTE — the same code @zhangj1164/dsh-memo uses for that condition, so one report can group both packages |
generateReport also records which plugin's analysis it was given. Recording only successful calls would answer "which route served these calls" while leaving "has that route changed since it broke?" open, so both halves are recorded.
Issue report template
Both generateReport and optimizeIssue use built-in system prompts that pin a uniform Markdown structure. The first line is always a ## heading used as the issue title. The template includes sections for plugin, action, expected/actual behavior, route and timing, and reproduction steps.
generateReport receives the analysis window and, per failure group, the route, the last failure time, and how many attempts of the same action followed it. Its system prompt requires those facts to be stated, forbids proposing a mechanism the analysis does not evidence — sampling parameters, token budgets, timeouts, chunking, and response parsing are named as examples — and requires a fact the analysis does not carry to be written as not recorded. Writing that collection must be added is explicitly ruled out: a missing fact can be an older event as easily as a gap, and the report cannot tell which.
Issue intake loop
The loop has three steps, and this plugin owns the last two. The user describes a problem in natural language, optimizeIssue turns it into the pinned report, and createIssue files it. That replaces the point where the loop used to stop: a pre-filled URL still required the user to open the form and press Submit, so nothing could pick the issue up automatically.
runIntake then reads the issues that carry claimLabel and hands each one to a fresh Session, registered as a one-shot automation task. The Session is created through the Session controller, so it gets the same preset and workspace policy as one the user opened in the Web. The work is handed over as a task on the Schedule service — the same board the Web's Automation tasks page lists — and that service delivers the rendered prompt into the Session when the task comes due. A task always belongs to an existing Session, so the Session is created first; a deployment that mounts no Schedule service (a non-Web composition) admits the prompt directly with the controller's prompt instead, which is the same durable path the Web prompt uses: it records the message with a user source and queues it on the Session's Agent, resolving (and resuming) that Agent itself. Naming the Session is best-effort: a deployment that mounts no title service still gets a working Session.
The credential is resolved in this order: token, then tokenEnv, then tokenCommand. A successful resolution is cached for the process, so a keyring-backed credential is not fetched on every request; a failed one is not, because a missing credential is often transient — the host may stall its event loop while it starts, and a command that finished during that stall must not be remembered as a missing token. The deadline is checked against the child's real state after it fires, so a late deadline adopts a command that already finished, and a command that outlives its deadline is killed only if it is really still running. Concurrent callers share one resolution in flight, so a second caller can never read "not resolved yet" as "no credential". A repeated command failure is warned once per distinct reason, because the failed resolution is retried on every GitHub call. The default command is gh auth token, so a machine already logged in to GitHub needs no extra secret; a deployment that manages secrets itself sets token and disables the command with an empty string. The token is never logged, and when no credential is found the failure names the command problem it observed and is coded credential-unresolved, so a failed command is not reported as a deployment that has no token.
First startup of the day
autopilotEnabled turns on one check per local day at host startup. The local day is read from durable storage-domain state, so a restart later the same day does nothing, and an issue that was already dispatched is never dispatched again — its Session exists, and a second one would duplicate the work. The day is committed only after the listing succeeded, so a pass that could not reach GitHub is retried on the next startup instead of being remembered as done. A pass whose every dispatch failed is retried the same way: the day is committed only when an issue reached a Session or nothing needed dispatching, because remembering a broken dispatch as a finished day is what made a failing startup look like a day with nothing to do. The listing failure, the dispatch failures, and an intake state that cannot be opened are each written as a telemetry error event, so the reason a check did nothing is readable afterwards.
The check needs durable state and refuses to run without one: without a memory of what it dispatched, a restart would open a second Session for the same issue. It is also off by default, because opening a Session without being asked is a deployment decision rather than something a plugin install does on its own.
@deepseek-ai/dsh-storage-domain is an optional peer. Installing this package alone keeps the service loading, filing, and listing issues; only the daily check stays off, and the import happens when the check is enabled rather than when the module loads. Every DSH installation ships that package, so the missing case is a defence rather than a supported configuration.
# your cordis.yml, or your own bundle's patch
- insert:
- id: github-issue
name: @zhangj1164/dsh-github-issue
config:
repoUrl: https://github.com/your-org/your-repo
autopilotEnabled: true
autopilotCwd: /path/to/your-repo
claimLabel: ready-for-agent
The host must be running for the check to happen at all; a day with no startup is a day with no check. That is the intended behavior — the check is a startup hook, not a scheduler — and the Automation tasks page now lists each dispatch as the one-shot task it registers, with the delivered ones showing as ended.
autopilotCwd also decides which Workspace a dispatch joins. The controller creates a Session from a bare directory but never adds it to a Workspace, and a Session outside every Workspace is what the sidebar shows under its ungrouped heading. A dispatch therefore looks the directory up in the Workspace registry — separators and a trailing separator normalized away, and case folded only where the host filesystem ignores it — and passes the matching Workspace id instead of the directory. A create request takes either workspaceId or cwd, never both, so exactly one of them is sent. A deployment without the Workspace layer, a registry read that fails, and a directory that matches no registered Workspace all fall back to creating by directory: the dispatch still runs, it just stays ungrouped, and a warning names the directory that matched nothing.
A dispatched Session runs the repository workflow itself, and that workflow starts with git fetch. Under the default workspace-write sandbox a network command is blocked and raises an approval prompt that an unattended dispatch cannot answer, so a deployment that wants the loop to run on its own should pin the permission preset to danger-full-access in its own patch layer:
- id: permission
config:
presets:
read-only: { sandbox: read-only, approval: ask }
workspace-write: { sandbox: workspace-write, approval: ask }
danger-full-access: { sandbox: danger-full-access, approval: never }
defaultPreset: danger-full-access
That is a deployment-wide choice: it applies to every new Session the host creates, not only to dispatched ones.
Requirement mapping
- Req 8 —
generateReportturns telemetry failure analysis into a uniform GitHub issue report that correlates each failure group against the plugin's feature code. - Req 9 —
prefilledIssueUrlbuilds a pre-filled GitHub issue-creation URL so the user can jump to the project's new-issue page with the report already filled in. - Req 10 — Packaged as a standalone DSH plugin: this package declares its own
dsh.bundlewithcordis.patch.yml, so a deployment can install it on its own and any UI plugin can reach it. See "Adopting this plugin" below. - Req 11 —
optimizeIssuerewrites a natural-language description into a structured issue using the configured model and a built-in structuring prompt. Theui-memopackage calls this directly for its "Add Issue" editor. - Req 12 — Reusable: the issue report template, the prefill URL builder, and the optimization prompt are all generic and not memo-specific.
- Req 13 —
createIssuefiles the optimized report through the GitHub API, so "format the issue" and "file the issue" are one step instead of a form the user must submit. - Req 14 —
runIntakeand the first-startup check close the loop: a claimable issue becomes a Session without the user opening it by hand, and a dispatched issue is never dispatched twice.
Adopting this plugin
Install the package and add it to your deployment's composition:
pnpm add @zhangj1164/dsh-github-issue
# your cordis.yml, or your own bundle's patch
- insert:
- id: github-issue
name: @zhangj1164/dsh-github-issue
config:
repoUrl: https://github.com/your-org/your-repo
Read the service from any plugin with ctx.get('githubIssue'). It is optional from the consumer's side, so guard the read:
const issues = ctx.get('githubIssue')
if (issues !== undefined) {
const { report } = await issues.generateReport({ analysis, repoUrl })
}
The service has no dependency on @zhangj1164/dsh-memo; memo is one consumer among possible others.
This bundle is the sole owner of the github-issue entry id. @zhangj1164/dsh-memo injects the service but does not insert this row, so the standalone bundle and the memo suite compose without a conflict and pnpm run verify-bundle-entries finds no overlap. A memo deployment therefore names the whole suite:
dsh plugin --profile web add @zhangj1164/dsh-telemetry @zhangj1164/dsh-github-issue @zhangj1164/dsh-memo @zhangj1164/dsh-client-ui-memo-settings
@zhangj1164/dsh-github-issue is named explicitly rather than pulled in as a peer: a profile sets autoInstallPeers: false, so an install brings in what the command names plus what those packages depend on, and @zhangj1164/dsh-memo alone would leave this row unresolvable. The memo panel needs no name of its own — the memo bundle depends on it — but this service is owned by its own bundle, so it does.
Exports
Every subpath resolves to the flat lib/*.js layout tsdown emits.
| Subpath | Contents |
|---|---|
@zhangj1164/dsh-github-issue |
The GithubIssueService plugin and its Config. |
@zhangj1164/dsh-github-issue/types |
Wire types: GithubIssueReport, request and result shapes. |
@zhangj1164/dsh-github-issue/client |
The browser-facing type face. |
@zhangj1164/dsh-github-issue/invariant |
Invariant definitions. |
Known Limitations
- Model dependency —
inject: ['llm']means the service will not activate without an LLM provider. - No browser UI of its own — this package registers no model tool and ships no browser UI. Installing it on its own gives a deployment
ctx.get('githubIssue')and nothing a user can see or click; the visible entry point is@zhangj1164/dsh-client-ui-memo's issue editor, whose "File on GitHub" button and log-analysis action reach it over Remote. Treat it as a backend that a UI plugin consumes, not as a standalone feature. - Dispatch needs the Web composition —
dispatchIssueandrunIntakereadctx.get('sessionController')and, when it exists,ctx.get('schedule'). A headless or SDK-only composition that mounts no Session controller reportssession-unavailableand files or lists issues only; one that mounts a controller but no Schedule service still dispatches, admitting the prompt directly. - The first-startup check is a startup hook, not a scheduler — it runs only when the host starts. A deployment that keeps the host running across midnight gets the check on the next start, not at midnight.
- Workspace placement is a spelling match — a dispatch joins a Workspace only when
autopilotCwdnames that Workspace's registered directory, up to separators and case. A subdirectory of a Workspace, a relative path, or a symlinked spelling does not match: the Session is created by directory and stays ungrouped, with a warning. The plugin never creates a Workspace on its own, because that would change the user's sidebar.
Links
More in this category
yjh051108/dsh-routing-suite★ 7027
One repository, three parts: a runtime injector for DSH plugin packages (inject, hot-reload, unload, promote a dev staging tool to the front, route self-heal, plus a settings-page plugin manager that lists, unloads and drags folders in to internalize), a task-aware reasoning-mode router agent preset (router-standard / router-spec / router-react), and a graded two-level task protocol whose six tools (commit_star, lock_stage, revise_do, edit_plan, mark_task, redteam_verdict) pin task state to disk. The injector implementation ships in-tree, so the install carries its own behaviour rather than a dependency list.
strukto-ai/mirage#dsh★ 3950
Swaps the filesystem and bash providers for a mirage virtual workspace: file tools and shell commands run over mounted resources (RAM, S3, Redis, Slack, Gmail, Notion, Postgres) instead of the host disk, with per-mount read/write/exec modes, per-command sandbox routing (monty, pyodide, quickjs in process; docker, e2b, daytona remote), and installed CLIs (git, gh, slack, linear, ntn, gws, or one you register) as head words in the virtual terminal.
first-fluke/oh-my-agent#dsh★ 1494
Runs project OMA checks before and after tool execution and when a turn tries to finish. Installs its OMA CLI dependency and initializes unconfigured projects on first use. Requires Node.js 22+; initial setup needs network access and project write access.
MichengAI/dsh-skills-manager★ 631
Manages local DeepSeek Harness skills in Settings and shows shared Agent skills as read-only.
hust-open-atom-club/oh-dsh★ 326
Community distribution: TUI, desktop, and Web UI as one bundle with layered installation.
Fishquito7/dsh-skill-mcp-panel★ 291
Manages DSH skills and MCP servers from the web settings: skill cards with hot enable/disable, workspace scopes, groups, batch migration and drag-and-drop import, plus stdio/HTTP MCP CRUD with connection tests, secret redaction and the unified dsh-panel CLI.
Community comments
Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.