# Triage Desk reference The full behavior of Triage Desk. The [README](../README.md) is the short overview; [ARCHITECTURE.md](ARCHITECTURE.md) maps files and contracts. ## Contents - [Inbox](#inbox) - [Snooze](#snooze) - [Launch scenarios](#launch-scenarios) - [Terminal launcher](#terminal-launcher) - [Choosing a terminal](#choosing-a-terminal) - [Prompt delivery](#prompt-delivery) - [Launch steps](#launch-steps) - [Agents](#agents) - [Clone discovery](#clone-discovery) - [Configuration](#configuration) - [Uninstall and saved settings](#uninstall-and-saved-settings) - [How it works](#how-it-works) - [Large sources](#large-sources) - [Limitations](#limitations) - [Development](#development) - [Releasing (maintainers)](#releasing-maintainers) ## Inbox Triage Desk reads pull requests, issues, reviews, and CI through the signed-in GitHub CLI; other code hosts are not supported. If GitHub is not connected, the error notice has a **Sign in to GitHub** action; Settings also shows whether `gh` is installed and which account is connected, and its **Sign in to GitHub** button opens an interactive `gh auth login` in a terminal. The **Reviews** tab groups the three review queues. Select a group to filter further. - **Awaiting my review** lists direct and team requests on PRs you have never reviewed. - **Awaiting my re-review**: PRs you already reviewed whose head commit is no longer the one you reviewed (new commits, a rebase, or a force-push; matched by commit id, not by commit date), PRs where the author clicked **Re-request review** for you on the same or a changed head, or PRs where the author replied **to you** after your last action (a threaded reply to your review comment or an explicit @-mention). An author reply alone is secondary: it stays in the same section, muted and at the bottom, with the exact reason in the row tooltip. Other reviewers' activity alone does not ask you for another pass. A pending team request stays with the PR in this group when the head changes after your review. An approval covering the new head can make the re-review optional when GitHub's review requirements are satisfied. - **Feedback on my PRs** includes requested changes and new comments, including inline replies, on your PRs and drafts. Open the PR conversation from its title or use the agent button to draft a reply. Requested changes also link to the files. An approval alone creates no feedback task. - **Ready to merge**: your non-draft PRs that are approved, mergeable, and (by default) green. PRs GitHub marks `BLOCKED` are excluded even when approval and checks pass. - **Needs your action** includes PRs with a merge conflict alone, issues assigned to you, and unanswered mentions. When a PR has both feedback and a conflict, its feedback row also shows the conflict. - **CI is failing**: red checks on your PRs and on branches, in personal and organization repositories: a red default branch of a repository you administer or maintain, and any red branch (the default one included) whose latest commit you (or a configured self alias) authored within the last week. - **New in your repositories**: **unassigned** issues opened in the last 30 days in repositories you maintain, styled quieter; they do not inflate the attention counter. Issues with an assignee are either your action (assigned to you, under *Needs your action*) or that person's work, so they never appear here. The 30-day window is fixed; snooze the issues you do not want to see. A [large source](#large-sources) does not show this list. Other panel features: - **Copy a link**: each row has one copy-link action; the toolbar and section headers do not duplicate it. - **Counters**: the sidebar badge counts each item once (a PR in both *Feedback on my PRs* and *CI is failing* is one item), leaves out review requests that are optional because someone else's approval already satisfies the PR, and leaves out snoozed items and new unassigned issues. Section chips (and *Snoozed*) count the rows the list shows under the current source filter and search; the page total is the badge for the selected source. Hover or focus the page total for what it counts and what it leaves out. - **Sources**: GitHub personal repositories and up to 10 organizations the account belongs to (or an explicit list of up to 10). Each row carries its source, and a source filter narrows the list (and its counts) when more than one source is connected. - **Languages**: English and Chinese. There is no language setting in the plugin; the panel follows the DSH interface language, and every interface language other than Chinese shows English. - **Agent tool**: `triage_desk` returns the same snapshot to a DSH agent, so "what needs my attention?" is answered from one source of truth. When you ask explicitly, it also opens a terminal for a URL (for example "open Codex on PR 288"), with the same prompt delivery as the panel: the agent may start, but nothing is submitted. The report says how old the snapshot is, adds a `Status: stale|partial — reason` line when the last refresh failed or some sources could not be read, and tells an empty inbox apart from requested sections that are empty while others are not. - **Settings in the panel** has three sections, in this order. - **GitHub** contains the connection, organizations, personal repositories, refresh interval, and PR rules. **Custom…** accepts an interval of 1–60 minutes. - **Agents** uses **Run on** to select the machine whose default agent you want to edit. **Configure local agents** edits commands on this computer. Selecting an SSH host checks its available agents. **Prompt templates** applies across machines. - **Launch environments** contains the terminal, prompt delivery, and working folders. **Repository folders on** selects the machine whose folders you want to edit. Local **Repository overrides** bind a GitHub repository to a specific working copy. - Light and dark themes both use the host theme tokens. ## Snooze - The clock button on a row opens a menu: *Until new activity* (the default), *Until tomorrow* (09:00 local time), or *Until next week* (Monday 09:00). The item leaves every section and the badge. Any new activity on GitHub (a newer `updatedAt`, or a new commit for a branch) brings it back early, also for a timed snooze; a timed snooze ends on time without a refresh. - A toast confirms the snooze with *Undo* for about 6 seconds. - The *Snoozed (n)* chip after the section chips shows the snoozed items, dimmed, each with its return time and *Unsnooze*; it disappears when nothing is snoozed. - **Bulk snooze**: the clock button in a section header snoozes every row the section shows (after the source filter and search) through the same menu; in the Snoozed view it becomes *Unsnooze all (n)*. - **Selection**: *Select* next to the search field gives every row a checkbox before its icon. A click anywhere on a row selects it instead of opening the link (Space on a focused checkbox works too; Shift+click selects a range within a section), each section header gets a select-all checkbox, and the row buttons step aside. A bottom bar offers *Snooze* (or *Unsnooze* in the Snoozed view), *Select all* / *Deselect all*, and *Done*. A PR listed in two sections is one selected item. A filter, source, or search change clears the selection but keeps the mode. Use *Done* or Escape to leave it. Bulk snooze and unsnooze also end selection and show one toast with *Undo* for the whole action. - Snoozes are kept in this browser's local storage (`triage-desk:snoozed:v2`) and are not synced between devices; entries for items that left the inbox are pruned after a complete refresh. ## Launch scenarios Click the terminal button on a row or in a group heading to preview and edit its rendered prompt. Select a machine and agent, then **Open** or **Copy prompt**. Agent selection and draft edits are independent. **Settings → Agents → Prompt templates** controls each template's prompt, enabled state, order and applicable sections. Templates use the selected machine’s default agent. An existing local override can be cleared with **Use machine default**. The saved row default takes precedence where it applies. Built-in task templates cover initial review, re-review, repair, replies and issue triage. Group templates use the visible items in their own section. Existing scenarios bound to *Needs your action* also apply to *Feedback on my PRs* after upgrading and restarting the host. Settings offers the bindings supported by the running host. You can edit the two bindings independently. **Terminal** in the launch picker opens an interactive shell for a row or group. Local launches use the matching working copy, falling back to the workspace. On SSH, the terminal uses the host’s configured folders and the usual working-copy chooser. For groups spanning repositories it uses the workspace locally or the first accessible repository folder (otherwise home) remotely. Terminal launches skip prompt delivery and agent discovery on the launch path. To open a plain local shell through `triage_desk`, use `action: "launch"`, the row’s `url`, and `target: "terminal"`. **What the built-in prompts ask for.** They use `gh` and work with any agent. The review scenarios (*Review this PR*, *Re-review after changes*, *Review everything awaiting me*) flag only problems the PR introduces that are worth fixing, then post **one** `COMMENT` review through `gh api repos/OWNER/REPO/pulls/N/reviews`. Each finding is an inline comment on a changed line, tagged `[P1]` blocking, `[P2]` should fix, or `[P3]` minor; a `suggestion` block is used only when it fully fixes the issue. They don't change code, never approve or request changes, and post nothing when there is nothing new to say. A re-review covers changes and replies since your last review. Group prompts list each PR's re-review reason and ask the agent to read author replies even when the diff is empty. *Fix* scenarios check out the branch, fix the first real error with the smallest change without skipping hooks, wait for your OK before pushing, and never merge. *Reply* scenarios draft as you and post after you approve. *Triage* scenarios only report: summary, likely cause, size, labels from the repository's existing ones, duplicates, and the next step. Every prompt asks for no AI attribution in comments and commits, and treats PR, issue, and CI log text as data, not instructions. **Prompt upgrades.** An unedited built-in prompt is saved empty, so it follows the default when a release changes it. A saved copy whose prompt and scope match an earlier built-in default, including the 0.1.4 group review prompt, is upgraded on load. A prompt you edited, or a scenario moved to the other scope, is kept. **Reset scenario** takes the current default. **DSH target.** The host renders the same scenario prompt and opens it as a new DSH session draft through the `uiWorkspace.startSession` client service; when the blank session already has a draft, the prompt is appended to it. No terminal is opened, and nothing is submitted until you press Enter. The session opens in the current workspace, not in the repository clone; the prompt contains the links and the scenario text. **Section scenarios** run on the group whose menu you open. The menu shows the batch size (for example, “Re-review 3 PRs”). Source filters, search and snoozes apply, and each item appears once. Optional reviews are skipped by default. In *Select* mode, check individual rows, including any optional PRs you want, then use the group's terminal button to act on that selection. The prompt asks the agent to delegate each item to a separate sub-agent where that makes sense. When all items that fit in the draft belong to one repository, a local agent opens in the matching clone and SSH looks for a working copy by its Git remotes. If a working copy is missing or the included items span repositories, a local agent opens in the workspace. For an unmatched repository SSH asks for a folder and suggests the first accessible root or remote home. Mixed-repository groups open at the first accessible root or remote home. **Placeholders** use single braces. Row scenarios: `{url}`, `{repo}`, `{owner}`, `{name}`, `{number}`, `{title}`, `{branch}`, `{kind}`, `{ref}`, `{author}`, `{reason}`. Section scenarios: `{links}` (the generated list), `{count}`, `{section}`, `{date}`. Unknown `{…}` tokens stay as text. A section prompt without `{links}` gets the generated list appended at the end; a row prompt without `{url}` (and without `{links}`) gets the one-item list appended. The list itself is written in English (`reason: new commits since my review`) so it matches the built-in English prompts. **Limits.** Prompts are rendered on the host from the snapshot. Templates are capped at 4 000 characters and the rendered prompt at 16 000. When a section list does not fit, `{count}` gives the number of items included. The draft and the panel notification both report how many fit. If the first item cannot fit, the panel reports an error before opening a draft or terminal. Shorten the template or remove repeated `{links}` placeholders. ## Terminal launcher A local terminal launch opens the agent in the repository's local clone (see [Clone discovery](#clone-discovery)) with the prompt prepared but **not sent**. The terminal stays open with a shell after the agent exits, survives a plugin reload, and is closed when DSH quits. The **Sign in to GitHub** button uses the same terminal. ### Choosing a terminal Settings → *Launch environments* → **Open agents in** offers *Automatic* or one of this platform's terminals; terminals that are not installed are shown disabled. The config key is `terminal`: `auto` (default) or a terminal id. A saved terminal that is not installed falls back to Automatic at launch, and the launch toast says so. | Platform | Terminal | Id | Opens | |---|---|---|---| | macOS | Terminal | `terminal` | a new window per launch | | macOS | iTerm2 | `iterm` | a tab in the current window | | macOS | Ghostty | `ghostty` | a tab in the current window | | Linux | GNOME Terminal | `gnome-terminal` | a tab | | Linux | Konsole | `konsole` | a tab | | Linux | Xfce Terminal | `xfce4-terminal` | a tab | | Linux | Ghostty | `ghostty` | a window | | Linux | kitty | `kitty` | a window | | Linux | Alacritty | `alacritty` | a window | | Linux | xterm | `xterm` | a window | | Windows | Windows Terminal | `windows-terminal` | a tab in the shared window | | Windows | PowerShell window | `console` | a new console window | *Automatic* resolves to: - **macOS**: iTerm2 when installed, otherwise Terminal. - **Linux**: `$TERMINAL` when it is an absolute path, otherwise the first installed of `gnome-terminal`, `konsole`, `xfce4-terminal`, `kitty`, `alacritty`, `x-terminal-emulator`, `xterm`. - **Windows**: Windows Terminal when installed, otherwise a PowerShell window. Opening a draft from the panel uses a fresh tab or window to deliver the edited text. For a tool launch without edited text, re-launching the *same* agent on the *same* item switches to its existing tab instead of opening a duplicate where the terminal allows it. This focus-or-reuse is best-effort and falls back to a fresh tab or window. A section launch always opens a fresh tab or window for its batch. - **macOS**: iTerm2 opens each launch as a new tab in the current window (`create tab with default profile command …`) and re-launching selects the matching tab. Ghostty (1.4 or later, through its AppleScript dictionary) opens a tab in the front window, or a new window when none is open, and re-launching selects the tab whose title matches. Terminal opens a new window per launch: its AppleScript interface cannot create a tab (`do script … in window` writes into the current tab, which would corrupt a running agent's input), so it has no shared window and no focus-reuse. - **Linux**: GNOME Terminal, Konsole, and Xfce Terminal open a tab when their server is running; the others open a window. Focus-or-reuse uses `wmctrl -a` (or `xdotool` as a fallback) to raise the matching window by title when either is installed. Both are X11 tools, so focus-reuse may be unavailable on a pure Wayland session; neither is required. - **Windows**: Windows Terminal (`wt.exe`) opens each launch as a new tab in the shared window (`wt -w 0 new-tab`); when the tab cannot be opened, a new Windows Terminal window (`wt -w -1 new-tab`) is tried. The PowerShell choice opens a new console window (`cmd.exe /c start`). Windows Terminal multiplexes tabs into one host window, so a re-launch opens another tab there; per-tab focus by title is not available. Launch scripts are PowerShell 5.1 `.ps1` files. ### Prompt delivery **Claude Code** opens with its native draft flag, `claude --prefill ''`: the TUI starts with the prompt in its composer and nothing submitted. On Windows the draft is used only when the agent's executable resolves to an `.exe`. A `.cmd`/`.bat` shim (what an npm install of `claude` creates) runs through `cmd.exe`, which reads the command line a second time and does not treat `\"` as an escaped quote: `&`, `|`, `<`, `>` and `^` in a prompt can act as operators, `%NAME%` is expanded, and a line break ends the command. Such an agent, a `.ps1` shim, or one whose path detection could not resolve gets the prompt like the agents below: typed in, or on the clipboard. Every launch, in every delivery mode, runs the program that detection reported by its absolute path (see [Agents](#agents)). On Windows this means a `$PROFILE` alias or function of the same name, or another PATH order in the terminal, cannot start a `.cmd` shim instead of the detected `.exe`, or the reverse. An `.exe` can itself be a shim that starts another program, possibly a `.cmd` or `cmd.exe`. Detection recognizes these shims by what sits next to them and never reads what they point at, so a recognized shim gets no draft: - **Scoop**: a `.shim` file beside the `.exe`; its `path` may be `cmd.exe`, and the shim starts whatever it names. - **bun** global bins: a `.bunx` file beside it; bun starts a `.cmd`/`.bat` target as `cmd /c`. - **Chocolatey**: the `.exe` is in Chocolatey's `bin` folder: `$env:ChocolateyInstall\bin`, `%ProgramData%\chocolatey\bin`, the legacy `C:\Chocolatey\bin`, or any folder with Chocolatey's `choco.exe` beside it. A shimgen shim can point at a `.bat` file. - **Volta**: `volta-shim.exe` beside it; Volta starts every tool as `cmd.exe /C`. - **mise**: mise's `.mode` file beside it; `mise x` starts `.cmd` tools too. - **proto**: proto's `registry.json` beside it; the shim runs `proto run`, which starts what the tool's plugin names. When the detected `.exe` is a symlink or sits in a junction, the markers beside the target count too, so a link in another folder to a shim also loses the draft. A link to something other than an `.exe`, and a marker or link that cannot be checked (other than missing), count as a shim. So Claude Code installed with Scoop or bun gets the prompt typed in, like an npm install. The official installer, winget and a manually placed `claude.exe` keep the draft: winget `Links` entries are symlinks to the program itself, with no shim process. npm, pnpm and yarn global bins are `.cmd`/`.ps1` files, which the `.exe` rule already excludes. The shim check is a best effort over the managers above. A hard link has no target to follow, so a hard link to a shim placed in another folder is not recognized, and managers without a marker beside the `.exe` (aqua's `aqua-proxy.exe` hard links, for one) are not covered. For such an install, write the absolute path of the program the shim starts in the agent command. For other local agents, **Settings → Launch environments → Prompt delivery** (config key `promptDelivery`) chooses how the prompt arrives: - **Type into the agent** (`paste`, the default and recommended): the agent runs through a small paste wrapper in a pseudo-terminal. The wrapper: 1. waits until the agent's input box is ready: the agent turns on bracketed paste and its screen settles (quiet for 0.7 s, or 2.5 s after bracketed paste turned on for agents that keep redrawing); 2. while a folder-trust dialog is on screen, waits until you press Enter, then waits for readiness again; 3. pastes the prompt into the input box as one bracketed paste, without pressing Enter, so you review it and send it yourself. Control characters other than newline and tab are removed from the prompt first, so it cannot end the paste early or send keys; 4. passes everything else through unchanged, follows the real window size, and exits with the agent's exit status. When the agent is not ready within 2 minutes, nothing is pasted. Local launches also copy the prompt to the clipboard as a fallback. The wrapper works with any agent whose TUI supports bracketed paste, including Claude Code, Codex, opencode, and Antigravity (`agy`). - **Copy to clipboard** (`clipboard`): the agent opens empty with the prompt on the clipboard and a hint printed above it. Paste it with ⌘V on macOS, Ctrl+Shift+V in Linux terminals, or Ctrl+V on Windows; the toast and Settings show the keys for your platform. The clipboard uses `pbcopy` on macOS, `clip.exe` on Windows, and `wl-copy`, `xclip`, or `xsel` on Linux. Requirements for **Type into the agent**: - **macOS**: Python 3, from the Command Line Tools (`xcode-select --install`); Homebrew Python also works. - **Linux**: Python 3 with the standard `pty` module. - **Windows**: Windows 10 version 1809 or later (ConPTY). The wrapper is compiled by PowerShell 5.1 at launch. When the requirement is missing, Settings shows why and launches use the clipboard; the launch toast tells you how to fix it. Each launch menu shows a line for the selected agent, such as *Opens in Ghostty · prompt typed into the input box, unsent*, *Opens in Terminal · prompt in the input box, unsent* (Claude Code), or *Opens in iTerm2 · prompt copied to the clipboard (⌘V)*. The launch toast names the agent and the terminal, for example *Codex opened in Ghostty (/path): the prompt will appear in its input box, not sent — review it and press Enter*. **Security note.** Native `--prefill` passes the prompt as an agent argument, so the draft text and its URLs are visible in the process list. The paste wrapper reads the prompt from a temporary file that it deletes once read; local terminal launches also copy to the clipboard. Each launch writes its script into its own `triage-desk-*` temporary directory; the script removes itself and the then-empty directory, and directories older than a day are swept at startup and before each launch. ### Launch steps 1. The plugin resolves the clone of the row's repository (see [Clone discovery](#clone-discovery)). A section launch spanning several repositories opens the current **workspace**; when a single-repository clone is missing, the agent opens in the workspace and the prompt contains the links. It never clones, fetches, checks out, or changes git state. 2. It renders the scenario prompt for the row or for the visible section list. 3. It picks the prompt delivery: native draft for Claude Code, otherwise the paste wrapper or the clipboard (see [Prompt delivery](#prompt-delivery)). 4. It writes a launch script and opens it in the chosen terminal (see [Choosing a terminal](#choosing-a-terminal)), or focuses the existing tab for the same agent and item. ### Agents For **This computer**, open **Settings → Agents → Configure local agents** to edit a display name or launch command. The agent ID stays the same when you rename it. The built-in commands are listed below. | Agent id | Launch command | Prompt delivery | |---|---|---| | `claude` | `claude --dangerously-skip-permissions {prompt}` | native `--prefill` (input box, unsent) | | `codex` | `codex --dangerously-bypass-approvals-and-sandbox {prompt}` | Prompt delivery setting | | `opencode` | `opencode --prompt {prompt}` | Prompt delivery setting | | `gemini` | `gemini --yolo {prompt}` | Prompt delivery setting | | `cursor-agent` | `cursor-agent --yolo {prompt}` | Prompt delivery setting | | `agy` | `agy --dangerously-skip-permissions {prompt}` | Prompt delivery setting | | `pi` | `pi {prompt}` | Prompt delivery setting | **Full access.** Like Orca's *Full access* mode, every agent with such a flag starts without permission prompts: the flags in the table above, plus Aider `--yes-always`, Amp `--dangerously-allow-all`, Droid `--auto high`, and Crush `--yolo`. opencode and pi have none; Goose's is an environment variable (`GOOSE_MODE=auto`) that a Windows launch cannot set. The agent then edits files, runs commands, and posts to GitHub without asking, so a step a scenario asks it to confirm first, such as pushing, rests on the agent following the prompt. Delete the flag from an agent's command in Settings to get the prompts back. An unedited command is saved empty, so it follows the default when a release changes it; a profile whose agents were last saved before 0.1.4 has its old defaults (`codex {prompt}`) upgraded on load. An edited command is kept, and so is a flag you removed: saving agents marks them `agentsVersion: 2`, which ends the upgrade. **Find agents** in Settings scans the login environment for known CLIs (Claude Code, Codex, opencode, Gemini CLI, Cursor Agent, Antigravity, pi, Aider, Amp, Droid, Goose, and Crush) and adds the installed ones without touching the agents you already configured. Edits, additions, and removals made while the scan runs are preserved. **Detection** is best-effort and asks the login environment once for all configured commands, because the DSH app often starts with a minimal `PATH`: - **macOS**: an interactive login zsh (`/bin/zsh -lic`, `whence -p`), so PATH setup in `~/.zshrc` (such as nvm) counts. - **Linux**: the login shell from `$SHELL` when it is a POSIX-family shell, otherwise `/bin/sh`; bash is asked as an interactive login shell (`-lic`, `type -P`), so PATH setup in `~/.bashrc` (such as nvm) counts. - **Windows**: PowerShell `Get-Command`, limited to applications and scripts. Only absolute paths count. An alias whose value is one absolute executable resolves to that executable; any other alias or a shell function is reported as unavailable (the menu says *shell alias or function — use a path*), because the launch shell does not have your aliases. Configured binaries that are not found are shown as *not installed* and cannot be launched. A launch runs the detected absolute path, so the terminal starts the same program Settings reports even when its own aliases, functions or `PATH` differ: - **macOS and Linux**: the command's executable is replaced by the detected path, unless the command already names a path. The launcher also adds the path's directory to `PATH` when it is missing, so `#!/usr/bin/env node` shims (nvm) find their runtime. - **Windows**: the command's first word is replaced by the detected path, with a drive letter or a UNC root. This also applies when the command names a path: detection checks and reports it resolved, so `\tools\claude.exe` becomes `C:\tools\claude.exe` on the current drive. The first word is the program even when it looks like `VAR=value`, because PowerShell has no such prefix: detection looks for a program of that name and reports the agent as not installed. `PATH` is not changed. Every Windows launcher runs the path as a PowerShell literal, so a backtick or `$(` in it is not expanded. A `.cmd`/`.bat` agent runs through `cmd.exe` (a batch file needs `cmd.exe /c`), as it would when found by name, so static arguments in its configured command are parsed by `cmd.exe`. They are your own configuration, and prompts never go on that command line. A `.ps1` agent runs under the same execution policy as when found by name. Launch windows start PowerShell with `-ExecutionPolicy Bypass`, which sets the Process scope for that session and its child sessions (the paste host's nested `powershell.exe` inherits it through `$Env:PSExecutionPolicyPreference`), and only a Group Policy setting overrides that, for the bare name as well. When detection could not run (the probe failed), the launch runs the command as written and the terminal resolves it; the config response reports this as `detectedAgents[id]` with `available: null` and `reason: 'probe-failed'`. On Windows that is the only launch that does not run a detected path: any other agent either runs by its detected path or is refused with the detection reason (*not installed*, *not executable*). Detection results are reused for two minutes. Before a launch runs a detected path it checks that the file is still there; when it is gone (the agent was moved or reinstalled), the launch detects again once and uses the fresh answer. **Command rules.** An agent command must contain `{prompt}` exactly once, unquoted and unescaped, after the executable word: either as its own argument (`codex {prompt}`) or directly after a `--flag=` (`aider --message={prompt}`). Quoted or otherwise embedded placeholders, command substitutions (`$( )`, `${ }`, backticks), comments, and shell operators (`; & | < > ( )`) are rejected; use a wrapper executable for complex shell setup. Quoted executable paths and static arguments are supported, as are POSIX environment assignments before the executable (including quoted values with spaces). Paste and clipboard launches run the command without its `{prompt}` argument and preserve the remaining quoting and argument spacing; on Windows, quoted paths and arguments stay single words. Prompt text is quoted as data, but the configured command itself is trusted code, not a sandbox. **Invalid saved agents** (for example, written by hand into the profile) are not dropped silently: the valid agents stay usable, the invalid ones appear in Settings as editable rows marked invalid (fix the command or remove the row before saving), and a scenario pinned to such an agent fails with an explanation until it is fixed. When no saved agent is valid, the built-in presets are used and the warning lists the rejected ones. ## Clone discovery - Manual repository folder overrides (`repoPaths`) win; the repository name is matched case-insensitively. Then the configured clone directories (`cloneDirs`) are searched. Without configured directories the plugin searches the typical folders that exist (`~/Projects`, `~/Developer`, `~/Documents/GitHub`, …) together with project roots detected in your home. - Under **Launch environments**, select **This computer** and expand **Repository overrides** to add, edit, or remove a repository and its local folder. The collapsed heading shows the number of overrides. Existing mappings appear here. When editing overrides, enter each GitHub repository once, regardless of case. - **Choose folder…** opens the native picker. If the repository field is empty, choosing a working copy fills it from the GitHub remote (upstream, then origin, then another GitHub remote). You can also enter both fields by hand. - Each saved SSH destination searches its own folders, including each folder itself and three levels of visible subdirectories (up to 1,500 directories per root). Nested directory symlinks are skipped. Discovery reads GitHub fetch URLs from Git on the server and resolves literal GitHub SSH aliases from the server's `~/.ssh/config`. Selecting **Find repositories** for a saved server needs non-interactive SSH authentication. Interactive launches can prompt for login. When several paths match, the terminal can save your choice under `~/.triage-desk/working-copies/` on the server and uses it only while it matches. - **Find repositories** in Settings shows what the search finds. - The local search goes three levels deep, with an independent 400-directory budget per root, and skips hidden and heavy directories. Symlinked directories are followed, each real directory once. - All Git remotes that point to GitHub count, so a fork with `origin` and `upstream` serves either repository. HTTPS, `ssh://`, and scp-style remotes (with or without `git@`) are recognized, as are SSH host aliases from `~/.ssh/config` whose `HostName` is `github.com` or `ssh.github.com`. Both searches read literal `Host` names from the configuration on their own machine. Local discovery reads literal patterns only. The remote lookup also checks applicable wildcard patterns when choosing a literal alias's `HostName`. `Match` and `Include` are outside both lookups. - Worktrees and submodules are found when their git config can be read; otherwise add a `repoPaths` override. ## Configuration The settings form writes the plugin row's `config` into the active DSH profile. The same fields can be set manually in `cordis.patch.yml`. The first **Save** in Settings adds an override for the plugin's row to the profile's own patch file, `$DSH_HOME/profiles//cordis.patch.yml` (`DSH_HOME` defaults to `.dsh` in your home folder on macOS, Linux and Windows): ```yaml - id: triage-desk name: dsh-triage-desk config: orgs: - acme refreshSeconds: 600 # … the other fields Settings saved ``` Turning the row off in Plugin Manager writes `disabled: true` into the same override (or adds one if Settings has not saved yet). Fields: | Field | Default | Meaning | |---|---|---| | `orgs` | `[]` | Organizations to scan, at most 10; empty auto-detects memberships, of which the first 10 are scanned (an `orgs-truncated` warning names the cap) | | `includePersonal` | `true` | Include the account's personal repositories as a source | | `refreshSeconds` | `1200` | Panel auto-refresh interval, 15–3600 s (the form's **Custom…** option takes minutes, 1–60) | | `ttlMs` | `max(refreshSeconds, 600)` s, capped at 1 h | Host snapshot cache lifetime | | `requireGreenChecks` | `true` | List under "Ready to merge" only with green checks or no checks (pending/red are excluded) | | `includeBotReviews` | `false` | Count reviews from bot accounts as yours on the PRs your searches return | | `agents` | installed agents | Agent list (up to 12): `{ id, label, command }`; an empty `command` on a known agent id means its current default; otherwise `command` contains exactly one unquoted `{prompt}` after the executable, as its own word or after `--flag=` (see [Agents](#agents)). Unset, the menu shows the known CLIs that are installed; editing the list in Settings saves it | | `defaultAgent` | `dsh` | What a launch opens unless another target is picked: `dsh` (a new DSH chat) or an agent id. An agent that cannot start opens a DSH chat instead, and Settings says so. Launches the host runs (the agent tool) cannot open DSH and use the first installed agent | | `terminal` | `auto` | Terminal for launches: `auto` or one of `terminal`, `iterm`, `ghostty`, `gnome-terminal`, `konsole`, `xfce4-terminal`, `kitty`, `alacritty`, `xterm`, `windows-terminal`, `console` (see [Choosing a terminal](#choosing-a-terminal)) | | `promptDelivery` | `paste` | How agents without a native draft get the prompt: `paste` (typed into the input box, unsent) or `clipboard` (see [Prompt delivery](#prompt-delivery)) | | `cloneDirs` | `[]` | Optional base directories for clone discovery, up to 8 (under *Launch environments*); empty searches the typical dirs that exist (`~/Projects`, `~/Developer`, …) plus project roots detected in your home | | `repoPaths` | `{}` | Optional `owner/repo` → absolute clone path exceptions, up to 50, matched case-insensitively (under *Launch environments*) | | `scenarios` | built-in set | Named launch scenarios: `{ id, label?, scope: 'item' \| 'section', sections, prompt, agent: 'default' \| , enabled }`; array order resolves competing templates; an empty `prompt` on a built-in scenario means its current default | | `defaultScenario` | empty string | Task-based preselection, or an enabled row scenario ID where applicable | | `sshServers` | `[]` | Remote destinations. Each entry has a case-sensitive OpenSSH `alias`, preferred built-in `agent` ID (empty uses the first detected agent), optional built-in `alternatives` and ordered remote `folders` (absolute or `~/…`) (up to eight). A legacy `cwd` supplies one folder | | `ghCommand` | `gh` | Path to the GitHub CLI | | `timeoutMs` | `30000` | Timeout of one `gh` invocation | | `meLogins` | `[]` | Extra self logins: decide ownership, direct review requests, your activity, and recent branch authors on the items the signed-in account's searches find. PRs that involve only an alias are not found; aliases add no sources or team memberships | | `teams` | `[]` | Reviewer teams, if `gh` cannot read team membership | There is intentionally no `export const Config`: the row config is validated by the settings endpoint and read with defaults in code, so the bundle needs no `@deepseek-ai/*` dependency (a linked local bundle cannot resolve them). ## Uninstall and saved settings Updating, removing and reinstalling the plugin never edit the profile's `cordis.patch.yml`. The [saved override](#configuration), including a `disabled: true` row, stays and applies again when the plugin is reinstalled. While the plugin is not installed, DSH logs `patch: entry triage-desk not found` each time it loads the profile (its offline config dump quotes the id: `patch: entry "triage-desk" not found`); the warning is harmless. To start from the defaults, quit DSH and delete the whole `- id: triage-desk` override (the line and everything indented under it) from the profile's `cordis.patch.yml`. Deleting it also stops the warning. Leave the rows of other plugins as they are. If it was the only entry, leave `[]` on a line of its own: the file must stay a YAML list, and DSH does not start the profile when it holds only comments. This section was checked against DSH 0.2.2-rc.5; the plugin supports `>=0.2.2-rc.2 <0.3.0`. ## How it works - **Host half** (`index.js`, `host/`, `github.js`): collects a snapshot through the signed-in `gh` CLI. Sources are the personal account (`user:`) and each organization (`org:`). For every source one GraphQL request reads your team memberships and runs three searches for open pull requests in non-archived repositories, most recently updated first: `review-requested:` (which also matches requests to your teams), `reviewed-by:`, and `author:`. A second query searches for issues assigned to you, new unassigned issues, and mentions. Each PR search reads 25 results per page and follows up to 4 pages (100 PRs); a PR found by several searches is listed once. - **Branch CI** comes from a separate repository scan without pull requests: 100 repositories per page, newest pushed first, up to 3 pages (300 repositories) per source, reading each repository's default-branch checks and up to 100 branch heads. - **Fair scheduling**: every source gets its first request before any source reads a second page, so one large organization cannot use up the refresh. - **Cache and route**: results are cached (single-flight, `ttlMs`) and served to the panel over `GET /triage-desk/snapshot` on the Host's own web server; the route is fenced with the browser-trust check. - **Aliases**: the searches run for the signed-in account only. `meLogins` aliases decide ownership, review requests, and activity on the PRs those searches return, and `includeBotReviews` applies to the same PRs; a PR that involves only an alias is not found. - **Teams**: team review requests are matched against the teams you belong to (`teams(userLogins:)`), not against every team in the organization. When that membership cannot be read (for example, without the `read:org` scope or for nested teams), a PR that GitHub's `review-requested:` search returned is attributed to the first team among its requested reviewers. - **Client half** (`client.js`): a plain-JavaScript DSH client bundle. It registers the sidebar panel and the page, polls the snapshot, and renders it with the host theme tokens. Returning to a hidden browser tab immediately rechecks the snapshot through the host cache; changing the interval restarts the timer; relative times ("updated 3 min ago") advance every minute. After a failed load the panel retries after 15 s, 60 s, and 5 min (each capped by the refresh interval), then waits for the regular poll. A stale snapshot's banner shows the current failure. Delayed recovery is cancelled when the last view unmounts or the plugin is disposed, including when an older response arrives afterward. No build step, no external network calls. - **Settings** are saved through DSH's config editor into the profile patch and applied to the running plugin without a restart: the `triage_desk` tool and the routes stay registered, so an agent calling the tool during a save is answered (with the settings it started under). A save that leaves the GitHub settings (sources, refresh interval, green checks, bot reviews) unchanged keeps the cached snapshot; otherwise the next read builds a new one, and if that first build fails the previous snapshot is served marked stale. A config that cannot be applied live falls back to a plugin restart. The host answers only after the profile write and the loader applied the config, and only then does the panel show **Saved** and read the snapshot: a read already running is followed by a fresh one, and a failed first read (a restarted plugin whose routes are not back yet) is retried once after 1.5 s before it is shown. A failed write keeps the form open with the error and the edits available for retry. Settings reads started before a confirmed save cannot overwrite its values or status. Leaving Settings with unsaved edits (Back, Cancel, or the gear) asks whether to discard them or keep editing. - **Launches**: scenarios are normalized and their prompts rendered in `launcher.js` (pure helpers: tokens, the item list block, trimming). `POST /triage-desk/launch` validates the scenario and URLs, resolves the clone, agent, terminal, and prompt delivery on the host, and only then asks the OS to open the terminal. `GET /triage-desk/clones` powers **Find repositories** in Settings. - **Failures**: transient network failures are retried once. A failed query loses only its own results and makes the snapshot partial: a source whose PR searches fail is reported as unavailable but still shows its issues and branch CI, and a failed issue search or branch scan keeps the source's pull requests. When GitHub times out on a query (see [large sources](#large-sources)), the pull searches retry lighter instead of repeating it. When a refresh cannot scan any source (network down, rate limit, plugin reload), the panel and the agent tool keep the previous snapshot, marked stale with the reason, instead of showing an empty inbox; without a previous snapshot the error is reported explicitly. A permission denial (HTTP 403) on one source does not stop the other sources; an explicit rate-limit error or HTTP 429 stops further requests. A cancelled agent tool call stops waiting but does not cancel the shared refresh. ## Large sources When GitHub can't serve an organization in full, Triage Desk reads it in a lighter mode instead of failing, and says so in a **Limited view** notice above the inbox. **When it starts.** GitHub stops a GraphQL request after about 10 seconds and answers HTTP 502 or 504. A request that fails that way twice, or returns more than 12 MB, switches its source to the lighter mode. A source with more than 500 new unassigned issues in the last 30 days gets the same issue and branch limits for that refresh. **What changes** | | Normal | Lighter mode | |---|---|---| | Pull requests per list | the 100 most recently updated | 50, or 25 if GitHub still times out | | History read per pull request | last 30 comments, 10 review threads × 5 | at 25: last 15 comments, 5 threads × 3 | | New unassigned issues | listed | not listed; the notice gives the count | | Branch CI | the 300 most recently pushed repositories | up to 10 repositories you work in, only branches with your login in the name (such as `users//…`) | "Repositories you work in" are those with your open pull requests and those you committed to or opened pull requests in during the last year. Their red default branches are still checked. **How long it lasts.** Until DSH restarts or the GitHub settings change. The issue count is checked on every refresh. **Where it shows.** Limits appear in the collapsed *Limited view* notice and do not mark the snapshot as partial. The amber *Some data couldn't be loaded* banner is only for requests that failed. The agent tool lists limits on a separate `Limits:` line. Warning codes: `source-degraded`, `new-issues-skipped`, `branch-scan-narrowed`. ## Limitations - **Coverage per refresh**: at most 10 organizations (`orgs-truncated` warning), 100 open PRs per search and source (`prs-truncated`; fewer for a [large source](#large-sources)), and 300 repositories per source for branch CI (`repos-truncated`). The limits keep the most recently updated PRs and the most recently pushed repositories, which is not a guarantee that older ones have no pending work. - **Quota**: a refresh has no fixed point budget. It stops starting queries only when GitHub reports a rate limit or 100 or fewer points remaining; fetched results are kept and a `scan-budget` warning marks the snapshot partial. By GitHub's documented cost formula (an estimate, not a measurement) a source costs about 21 points in a typical refresh and about 70 when every search and repository page is followed; the returned costs are recorded in the snapshot metadata. - **GitHub only**: the data layer is isolated in `github.js` and the snapshot contract is provider-neutral, so a GitLab (or other) provider can be added without touching the UI. - **PR history windows**: re-review uses `viewerLatestReview` for your own last review, so the review window cannot hide it. Other PR history is read in bounded windows: the last 50 reviews, the last 30 comments, and the last 10 review threads with their last 5 comments each (smaller for a [large source](#large-sources)). An @-mention counts only outside code, quoted lines and HTML comments. When GitHub reports more, the snapshot carries a `truncated-history` warning instead of silently dropping them. New commits are always detected: the head commit id is compared with the commit your latest review was attached to. - **Terminal tabs**: Terminal on macOS has no scripting API for creating tabs, so it opens a new window per launch; choose iTerm2 or Ghostty for tabs and focus-reuse. Ghostty tabs need Ghostty 1.4 or later. Windows tabs need Windows Terminal 1.5 or later. Focus-reuse works with iTerm2 and Ghostty on macOS and with `wmctrl` or `xdotool` on Linux (X11); Windows opens another tab in the shared window. - **Paste wrapper**: it needs an agent TUI that turns on bracketed paste; an agent that never does, or is not ready within 2 minutes, gets no paste. For local launches, paste the prompt from the clipboard. For SSH launches, choose **Copy prompt** in the panel and then paste into the remote agent. A folder-trust dialog is recognized by its text (the wording used by Claude Code, Codex, Antigravity, and Gemini CLI). - **Windows**: PowerShell scripts are written as UTF-8 with a BOM and draft prompt files are read explicitly as UTF-8; a `;` in the tab title or script path is escaped as `\;` for Windows Terminal; double quotes in the prompt are escaped for PowerShell 5.1's native argument passing. `npm run smoke:windows` runs the draft, paste and clipboard launchers for real on Windows in CI: a drive-letter clone path with non-ASCII characters and `;`, draft prompts with quotes and a trailing backslash or with `"`, `&`, `|`, `<`, `>`, `^`, `%PATH%` and a line break (one intact argument to an `.exe` agent), the latter typed into an npm-style `.cmd` shim and into an `.exe` shim in Scoop's layout that starts a `.cmd`, and paste launches of an `.exe`, `.cmd` and `.ps1` agent started by their detected paths (the `.ps1` marked as downloaded, and run under the launch window's inherited `Bypass`). A `.cmd`/`.bat` agent never gets the prompt as an argument ([Prompt delivery](#prompt-delivery)); static arguments in its configured command still go through `cmd.exe` and are trusted configuration ([Agents](#agents)). - **Linux launch errors**: launches observe immediate startup errors for 500 ms and then report success; the emulator keeps running without a lifetime timeout. Failures after that window are not reported. ## Development Layout: ``` index.js host plugin entry: wires host/ modules, routes, the agent tool host/ host modules: snapshot cache and store, config, processes and terminals, agents, clones, launch github.js GitHub data layer: GraphQL, gh runner, snapshot normalization launcher.js launcher entry: re-exports launcher/ (agent commands, presets, scenarios and prompts, clone discovery, terminals, paste wrapper, scripts, terminal plans) launcher/ launcher modules, pure helpers and platform scripts client.js client bundle: sidebar panel + page + settings form + scenario menus locale/ Plugin Manager display metadata (en, zh) icon.svg plugin icon docs/ this reference, the architecture map and shared contracts, the local dev workflow dev/ smoke scripts and fixtures used while developing (not shipped in npm) ``` Setup and the default gate: ```sh npm install # installs ESLint + React for the render smoke and sets .githooks npm run check # lint + docs links + all offline smokes npm test # alias for npm run check ``` The pre-commit hook runs `npm run check`; it is enabled by the `prepare` script (`git config core.hooksPath .githooks`). CI (`.github/workflows/check.yml`) runs the same command with `npm ci` on ubuntu and Windows (`check` and `check (windows-latest)`, which include `smoke:paste` and `smoke:windows`), and runs `smoke:paste` on macOS as `paste (macos-latest)`. Checks that need a POSIX shell, macOS, or symlink rights run only where those exist; each such skip is commented in the smoke. Pull requests from organization members also get an automated review from the DeepSeek review bot (`.github/workflows/deepseek-review.yml`); it reads the diff through the GitHub API and never checks out or runs pull request code. The local install and reload rules are in [DEV_LOCAL.md](DEV_LOCAL.md). Checks: - `npm run check:docs`: verifies that relative links, images and `[ref]:` definitions in every shipped Markdown file (both READMEs, the changelog, and `docs/`) resolve from the linking file's directory with exact case, and that `#section` anchors name a heading or `` anchor in the target file. Links in fenced or indented code blocks and code spans are skipped. - `npm run smoke:client`: registers the client bundle against a fake module loader, checks the slot registrations, validates EN/ZH dictionary parity (key sets, placeholders, literal `t()` keys), and tests polling, retries, and visibility handling with fake timers. - `npm run smoke:render`: renders the real `Page` and the settings screen with a fixture snapshot (catches components that read missing props/state and capability-gated controls that should be hidden), and drives settings flows, the minute tick, and launch-menu interactions through a deterministic hook runner (not a browser DOM). - `npm run smoke:launcher`: checks scenario prompts and tokens, clone discovery and matching, terminal plans, the native draft launcher (`--prefill`), and the paste and clipboard launch scripts. - `npm run smoke:routes`: exercises the host routes, fencing, clone scanning, native-picker routes, launch success and failure paths, and the launch tool action with a fake subprocess layer (never opens a terminal). - `npm run smoke:cache`: checks snapshot-cache behavior: success is cached, failures are retried, a forced refresh during an in-flight build is queued, and the TTL can be supplied dynamically. - `npm run smoke:snapshot`: runs the real snapshot builder and host cache against a fake `gh` that answers by GraphQL operation name (`ViewerSources`, `PullSearch`, `IssueSearch`, `PullSearchPage`, `BranchScan`) and rejects queries with unused or undeclared variables: section classification, search pagination and truncation, branch CI, quota stops, partial and failed sources, the previous snapshot kept as stale (also across a GitHub settings save), and a cancelled tool call not cancelling the build. - `npm run smoke:paste`: end-to-end check of the paste wrapper against a fake agent (the Python pty wrapper on macOS and Linux, the ConPTY host on Windows): the prompt arrives as one bracketed paste with no Enter, a folder-trust dialog holds the paste until Enter, an agent that never stops redrawing still gets the paste, and the agent's exit status is passed through. - `npm run smoke:windows`: runs the generated PowerShell 5.1 launchers on Windows with a recording agent and checks the exact arguments and working directory it receives, and that each launcher removes its per-launch directory; skipped on other platforms. - `npm run smoke:host`: **live, opt-in only**. Runs the host half against a fake Cordis context and the real `gh` CLI (requires `gh auth login`); it spends GitHub quota, so it is not part of `npm run check` or CI. ## Releasing (maintainers) ```sh npm run check # full gate; prepublishOnly runs it again on publish npm pack --dry-run # inspect what goes into the tarball npm publish # unscoped public package ``` Bump `version` in `package.json` and add a matching section to `CHANGELOG.md`. A release candidate (`X.Y.Z-rc.N`) is published under the `next` dist-tag so `latest` stays on the stable version: `npm publish --tag next`, with the GitHub release marked as a prerelease. Testers install it with `dsh plugin --profile add dsh-triage-desk@next` (`dsh plugin` passes its arguments to pnpm). The stable release is a new version `X.Y.Z` published to `latest`; then point `next` at it too (`npm dist-tag add dsh-triage-desk@X.Y.Z next`), so `@next` is never older than `@latest`. The package ships the host and client halves, launch presets, locale metadata, both READMEs, the changelog, the license, and `docs/REFERENCE.md`, `docs/ARCHITECTURE.md`, and `docs/DEV_LOCAL.md`; development smokes and the contributor docs (`AGENTS.md`, `CODING_STANDARDS.md`) stay out. The GitHub release for the version (with the notes from the changelog) should exist before the npm package is announced, so the `repository`, `homepage`, and `bugs` links resolve. To list the plugin in the community market, open a pull request against [awesome-dsh-plugin](https://github.com/awesome-dsh-plugin/awesome-dsh-plugin) that adds one `data/plugins/__.yml` entry (category `git`); the curated list feeds [dsh-market](https://github.com/dsh-market/dsh-market) and the DSH Discover index. The npm mapping is picked up from the published `repository` field. `npm pack --dry-run` is a good final check that the tarball contains both READMEs, both locale files, and the three docs.