paperclip-github-plugin 0.19.0 → 0.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +84 -520
- package/dist/manifest.js +22 -302
- package/dist/ui/index.js +2540 -37008
- package/dist/ui/index.js.map +4 -4
- package/dist/worker.js +1451 -16587
- package/package.json +5 -12
package/README.md
CHANGED
|
@@ -5,150 +5,28 @@
|
|
|
5
5
|
[](https://www.npmjs.com/package/paperclip-github-plugin)
|
|
6
6
|
[](https://github.com/alvarosanchez/paperclip-github-plugin/blob/main/LICENSE)
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
A Paperclip plugin that lets agents work from GitHub, with GitHub as the system of record:
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
- **One GitHub identity per company.** Agents act as a GitHub App's bot account (or as the owner of a personal token), and the credential never reaches the agent.
|
|
11
|
+
- **Webhook wakes.** The App's signed webhooks wake the agent an event route names, with a short prompt about the event. No Paperclip issue is created, so there are no assignments, blockers or recovery issues to clean up.
|
|
12
|
+
- **GitHub tools.** Agents read and write issues, pull requests, reviews, check runs, labels and review threads through 26 plugin tools.
|
|
13
|
+
- **Shared memory.** Short notes every agent in a company can save and recall, keyed by repository and topic.
|
|
11
14
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
GitHub is often where work appears first, but it is not always where teams want to plan, prioritize, and coordinate. GitHub Sync lets GitHub stay the source of incoming work while Paperclip becomes the place where the team manages it.
|
|
15
|
-
|
|
16
|
-
With this plugin, you can:
|
|
17
|
-
|
|
18
|
-
- connect one or more GitHub repositories to Paperclip projects
|
|
19
|
-
- import open GitHub issues into Paperclip without adding title prefixes or duplicate issues
|
|
20
|
-
- keep descriptions, labels, and status aligned with GitHub over time
|
|
21
|
-
- configure mappings and import defaults per Paperclip company
|
|
22
|
-
- run sync manually or on a schedule
|
|
23
|
-
- triage open pull requests from mapped Paperclip projects in a hosted queue
|
|
24
|
-
- give Paperclip agents native GitHub tools for issues, pull requests, CI, review threads, and org-level projects
|
|
25
|
-
|
|
26
|
-
## What you get in Paperclip
|
|
27
|
-
|
|
28
|
-
The plugin adds a full in-host workflow instead of a one-off import script:
|
|
29
|
-
|
|
30
|
-
- a hosted settings page for GitHub auth, repository mappings, company defaults, execution-policy handoff fallbacks, and sync controls
|
|
31
|
-
- setup controls for Paperclip board access when host API calls require board credentials
|
|
32
|
-
- a dashboard widget that shows sync readiness, current sync status, and run/cancel controls
|
|
33
|
-
- a separate KPI dashboard widget that tracks GitHub backlog size, GitHub issues closed, and Paperclip pull requests created with recent history and historical comparisons
|
|
34
|
-
- saved sync diagnostics that let operators inspect the latest per-issue failures, raw errors, and suggested next steps
|
|
35
|
-
- a project sidebar item that opens a live project-scoped Pull Requests page for the mapped repository and can show the open PR count through a lightweight badge read (Paperclip `2026.831` hosts do not render it; see the compatibility boundary below)
|
|
36
|
-
- manual sync actions from global, project, and issue surfaces
|
|
37
|
-
- a GitHub detail tab on synced Paperclip issues that includes GitHub-marked action buttons plus the GitHub issue creator with avatar, lets operators manually link or unlink a Paperclip issue from a GitHub issue or pull request, and shows compact troubleshooting details if the host cannot provide a resolvable issue context
|
|
38
|
-
- GitHub link annotations on sync-generated status transition comments when the host supports comment annotations
|
|
39
|
-
|
|
40
|
-
## How it works
|
|
41
|
-
|
|
42
|
-
1. Save a GitHub token, or a GitHub App's credentials, in the plugin settings.
|
|
43
|
-
2. Connect one or more GitHub repositories to Paperclip projects.
|
|
44
|
-
3. Run a sync manually or let the scheduled job keep things up to date.
|
|
45
|
-
|
|
46
|
-
During sync, the plugin imports one top-level Paperclip issue per GitHub issue, stamps it with a namespaced GitHub Sync plugin origin, updates already imported issues instead of recreating them, maps GitHub labels into Paperclip labels, and keeps GitHub-specific metadata in dedicated Paperclip surfaces rather than stuffing everything into the issue description. Imports are first created as neutral, unassigned backlog issues with their durable origin identity; GitHub Sync then persists activation state and any required agent-wake intent before applying the configured initial status or assignee. That ordering lets a restarted worker recover an origin-only issue without duplicating it or losing its first agent wake. Detail surfaces likewise recover GitHub issue and pull request links from Paperclip's own `originKind` / `originId` fields when the plugin registry, link entity, or legacy hidden marker is missing.
|
|
47
|
-
|
|
48
|
-
When the host exposes plugin issue creation, imported GitHub issues are created through the Paperclip plugin SDK path so they are not attributed to the connected board user. The worker still uses direct local Paperclip REST calls for label sync and for description, assignee, or status repair paths when those routes are available.
|
|
49
|
-
|
|
50
|
-
Long-running syncs continue in the background, so quick actions do not have to wait for the whole import to finish. Once a sync has started, the settings page, dashboard widget, and toolbar actions can request cancellation; the worker stops cooperatively after the current repository or issue step finishes. If the worker restarts mid-run, GitHub Sync now recovers that orphaned `running` state on the next read or control action instead of leaving the UI stuck in `running` or silently restarting the old run. When sync needs to wake an assigned agent, it uses Paperclip's host-owned issue wakeup API first so blocker, liveness, budget, and auth checks stay centralized, then falls back to the local wakeup route only when an older or partial host bridge cannot service the SDK call.
|
|
51
|
-
|
|
52
|
-
## Highlights
|
|
53
|
-
|
|
54
|
-
### Company-aware configuration
|
|
55
|
-
|
|
56
|
-
GitHub tokens, repository mappings, advanced import defaults, Paperclip board access, and sync cadence are managed per company. When you open settings inside a specific company, you only edit that company's setup.
|
|
57
|
-
|
|
58
|
-
### Project binding that respects existing work
|
|
59
|
-
|
|
60
|
-
If a company already has a Paperclip project bound to a GitHub repository workspace, the settings UI can reuse that project instead of creating a duplicate. New mappings can also create and bind a Paperclip project automatically, and those newly created projects opt into isolated issue checkouts with new issues defaulting to isolated checkout.
|
|
61
|
-
|
|
62
|
-
### Status sync with delivery context
|
|
63
|
-
|
|
64
|
-
The plugin does more than mirror issue text. It looks at linked pull requests, mergeability, CI, review decisions, review threads, and trusted new GitHub comments so imported Paperclip issues can reflect where the work actually is. When GitHub links an issue to a pull request in another repository, GitHub Sync now follows that pull request's actual repository for status checks, review state, and deep links instead of assuming the issue repository. When sync closes an imported issue as `done` or `cancelled`, it also clears any pending Paperclip review or approval execution policy/state so the host accepts the terminal transition cleanly and does not keep waking stale review participants.
|
|
65
|
-
|
|
66
|
-
Sync-driven transitions use a phase-aware durable action journal keyed by a fixed-length hash of the Paperclip issue, effective remote action, comment watermarks, and target state. A retry reuses an already completed explanatory comment or issue mutation instead of repeating it. If the worker can see an intent but cannot prove whether the corresponding side effect completed, it fails closed for operator reconciliation rather than risking a duplicate comment or status write.
|
|
67
|
-
|
|
68
|
-
### Company KPI dashboard
|
|
69
|
-
|
|
70
|
-
GitHub Sync exposes a dedicated KPI dashboard widget alongside the operational sync widget. During full company syncs, the worker snapshots the current open GitHub backlog and records when already-imported GitHub issues move from open to closed. The KPI widget turns that worker-owned state into backlog, issue-closure, and Paperclip PR-creation cards with recent history and comparisons against older periods.
|
|
71
|
-
|
|
72
|
-
Because GitHub alone cannot tell which pull requests came from a Paperclip company, the plugin uses explicit Paperclip attribution for delivery activity. `create_pull_request` automatically records a Paperclip-created PR event, and agents that use `gh` or another non-plugin GitHub client can post pull-request-created events to the plugin API route so the KPI history stays specific to Paperclip work. When either path includes the Paperclip issue id, GitHub Sync also records the pull request link so later sync runs can move that issue based on PR CI, merge state, and review activity.
|
|
73
|
-
|
|
74
|
-
That API route remains intentionally separate from the plugin tool surface because it records PRs created outside the plugin, for example when an agent uses an external GitHub client instead of the GitHub Sync tool. The Paperclip host authenticates the bearer agent token, scopes the request to the calling agent's company, and rejects anonymous or non-agent calls before dispatching to the worker.
|
|
75
|
-
|
|
76
|
-
### Third-party issue links
|
|
77
|
-
|
|
78
|
-
Sometimes a Paperclip issue is implemented through a GitHub issue or pull request in a repository that is not mapped to any Paperclip project. GitHub Sync can now track those targeted links without enrolling the whole repository in sync. Authenticated agent runs should use the `link_github_item` plugin tool to record the durable link.
|
|
79
|
-
|
|
80
|
-
Third-party links are company-scoped and sync only the linked GitHub issue or pull request. Future manual or scheduled company sync runs refresh those external records and update the Paperclip issue status from the same CI, mergeability, review, thread, and issue-state rules used for mapped repositories.
|
|
81
|
-
|
|
82
|
-
### Durable pull-request follow-through owners
|
|
83
|
-
|
|
84
|
-
A pull-request link may include `followThroughAssigneeAgentId`, an optional Paperclip agent id that owns future actionable work for that specific PR. `create_pull_request`, `link_github_item`, the authenticated pull-request metric endpoint, and the hosted link action all accept the field for PR links. Responses include the persisted owner when one is set. Pass `null` when the surface supports updating a link to clear the owner; omitting the property preserves the existing value.
|
|
85
|
-
|
|
86
|
-
The worker validates an explicit owner against the authoritative Paperclip agent service before writing the link. The agent must exist and belong to the authenticated company; missing and cross-company ids fail closed. Successful owner changes carry `followThroughAssigneeUpdatedAt` in the durable link and agent-tool changes remain visible in the existing issue interaction ledger.
|
|
87
|
-
|
|
88
|
-
The owner is stored on the PR-link entity, so unrelated title/state refreshes, process restarts, and execution-state cleanup do not remove it. Old link records without the property remain valid and use the previous fallback behavior. For actionable direct-PR work, assignment precedence is: an active execution-state `returnAssignee`, the PR's durable follow-through owner, the configured company executor, then the configured default assignee. Red CI, unresolved review threads, trusted follow-up, and merge-conflict/action-required states assign and wake the selected owner. A healthy external-maintainer wait remains `in_review` with no agent assignee; a human assignee is left in place, because a person parked on such an issue is the reviewer the work is waiting on. Effective-state fingerprints include durable routing so unchanged polls neither repeat the mutation nor enqueue another wake.
|
|
89
|
-
|
|
90
|
-
### Project pull request command center
|
|
91
|
-
|
|
92
|
-
Each mapped project can expose a **Pull Requests** entry in the sidebar that opens a live GitHub queue page for that repository (on Paperclip `2026.831` the streamlined sidebar does not mount project sidebar items, so open the page directly at `/<company-prefix>/github-pull-requests?projectId=<project id>`). The sidebar badge uses a lightweight total-count read, while the queue keeps the default view fast by loading only the current 10-row page, uses a repo-wide metrics read for the summary cards, reuses that cached metrics scan to keep filtered views fast by fetching only the visible filtered rows, keeps repo-scoped count, metrics, and per-PR review/check insight caches warm for repeat visits, lets operators explicitly bust those caches with Refresh when they want a live reread, shows total, mergeable, reviewable, and failing cards that filter the table, only treats a pull request as mergeable when it targets the current default branch with green checks, at least one approval, no outstanding change requests, and no unresolved review threads, includes an **Up to date** column that distinguishes current branches, clean update candidates, conflict cases, and unknown freshness when GitHub cannot confirm the comparison, shows the PR target branch with a highlighted default-branch badge, keeps the list sorted by most recently updated first, paginates larger repositories, keeps a compact bottom detail pane with markdown-and-HTML-rendered conversation plus an inline comment composer, supports deterministic **Update branch** actions for clean behind-base pull requests, adds Copilot quick actions that post `@copilot` requests for **Fix CI**, **Rebase**, and **Address review feedback**, requests Copilot through GitHub’s native reviewer flow for **Review**, keeps comment, review, quick approve/request-changes, re-run CI, merge, and close actions available, lets the review modal submit comment-only, approve, or request-changes reviews, hides any pull request action whose required GitHub permission is not verified for the saved token, and opens linked Paperclip issues in a plugin-provided right drawer so operators can stay on the queue page.
|
|
93
|
-
|
|
94
|
-
Paperclip issue linkage on the queue prefers the GitHub issue that the pull request closes, so imported GitHub issues and delivery work stay connected in the same project view. If a pull request has no closing-issue-backed link yet, the queue falls back to the Paperclip issue created directly from that pull request and updates the table immediately when that create action returns.
|
|
95
|
-
|
|
96
|
-
Those pull-request-created Paperclip issues also stay in the scheduled/manual sync loop even when the pull request does not close a GitHub issue. GitHub Sync checks their CI, merge state, review decision, and review threads so new failures or requested feedback move the Paperclip issue back into active work. The same durable PR link is written when an agent creates a PR through the plugin tool with `paperclipIssueId`, when an authenticated agent records a `gh`-created PR through the agent API route with `paperclipIssueId`, or when an operator manually links an unlinked issue from the issue page.
|
|
97
|
-
|
|
98
|
-
The issue detail panel and sync-created comment annotations also preserve cross-repository linked pull requests, showing those PRs with their real repository path so operators land in the right place on GitHub.
|
|
99
|
-
|
|
100
|
-
### Manual GitHub links
|
|
101
|
-
|
|
102
|
-
If a Paperclip issue was created locally or by an agent workflow before GitHub Sync saw the matching GitHub item, the issue detail surface shows a **Link GitHub item** action. The modal accepts either a GitHub issue number or full issue URL, or a pull request number or full pull request URL. Number-only entries use the issue's mapped Paperclip project repository; full URLs can point at any repository mapped to that project.
|
|
103
|
-
|
|
104
|
-
Manual GitHub issue links are added to the same import registry and issue-link entity used by normal sync, so future syncs update the Paperclip issue from the GitHub issue. Manual pull request links are added to the PR-link entity used by the project Pull Requests page, so future syncs monitor PR status even when there is no closing GitHub issue.
|
|
105
|
-
|
|
106
|
-
When a Paperclip issue is linked to a GitHub issue and also has older direct pull request links, the GitHub issue remains the status source of truth. Direct pull request links only drive status for PR-only Paperclip issues, which prevents stale merged PR metadata from closing work while the GitHub issue and its current linked PR are still open.
|
|
107
|
-
|
|
108
|
-
Operators can unlink a linked Paperclip issue from the GitHub detail surface when they intentionally want GitHub Sync to stop updating it. Agent-facing tools can create durable issue and pull request links, but they do not expose an unlink operation; internal sync repair may still tombstone a link when GitHub transfers an issue to an unmapped repository.
|
|
109
|
-
|
|
110
|
-
### Agent workflows built in
|
|
111
|
-
|
|
112
|
-
Paperclip agents can search GitHub for duplicates, read and update issues, assign issues to the saved token owner, post comments, create pull requests, inspect changed files and CI, reply to review threads, resolve or unresolve threads, request reviewers, search org-level GitHub Projects, and associate pull requests with those projects without leaving the Paperclip plugin surface.
|
|
113
|
-
They can also link a Paperclip issue to a GitHub issue or pull request in any accessible repository with `link_github_item`, including third-party repositories that are not mapped to a Paperclip project.
|
|
114
|
-
|
|
115
|
-
### Issue interaction ledger and 30-day summary
|
|
116
|
-
|
|
117
|
-
GitHub Sync keeps a forward-only, issue-scoped interaction ledger in `paperclip-github-plugin.issue-interaction-event` entities. It captures sync status decisions (changes and meaningful no-ops, including direct-PR status paths) and issue-scoped mutating GitHub agent tool attempts. Each mutation records a uniquely identified durable intent before execution and a separate result afterward; known mutation/comment/annotation failures receive failed results, while only unmatched structured intent events are reported as uncertain attempts. Events use content-addressed entity IDs so concurrent identical writes converge without allowing different payloads to overwrite one another. Agent/run/model attribution and normalized remote identifiers are retained when available, including identifiers resolved from Paperclip issue/PR links, derived from `reference` and `pullRequestUrl` inputs, and returned by newly created GitHub items; HTTP(S) metadata has userinfo, query strings, and fragments removed, and raw issue or comment bodies, logs, credentials, secret references, headers, and provider payloads are never stored. Required intent persistence failures prevent the mutation, while intent/result persistence failures return structured tool errors instead of rejecting the tool call or silently reporting a fully recorded mutation.
|
|
118
|
-
|
|
119
|
-
Agents can call `get_issue_interaction_summary` with:
|
|
120
|
-
|
|
121
|
-
- `paperclipIssueId` (required)
|
|
122
|
-
- `from` (optional inclusive ISO timestamp)
|
|
123
|
-
- `to` (optional exclusive ISO timestamp)
|
|
124
|
-
|
|
125
|
-
The authenticated tool-run company is authoritative. The worker verifies the issue in that company and rejects cross-company access. The default range is the 30 days ending now, custom ranges use UTC `[from,to)` semantics, and no query may exceed 30 days. Results are deterministic compact JSON with coverage metadata, counts for events/runs/comments/mutating-tool attempts/remote writes/status decisions/transitions/failures/no-ops, ordered transitions, repeated-action and reversal signals, and explicit limitations.
|
|
126
|
-
|
|
127
|
-
Coverage is dimensioned rather than reported as one misleading complete flag: the response marks overall history incomplete, reports the plugin-ledger start and window completeness separately, and explicitly states that Paperclip core history and arbitrary external GitHub history are not included. Malformed rows, conflicting logical dedupe keys, or the 5,000-row scan safety cutoff make plugin-ledger coverage incomplete and are reported in integrity/truncation metadata; transitions and repeated-action details are also capped while aggregate counts remain bounded by that scan. The ledger starts with the earliest captured valid event for that issue; GitHub Sync does not reconstruct earlier history. GitHub actions performed outside captured plugin paths are absent, and mutating tools only produce issue-ledger entries when they are invoked with `paperclipIssueId`. Thread-only mutations accept an optional `paperclipIssueId` for this attribution. This first increment does not capture read-only tools, operator UI mutations, arbitrary external GitHub activity, token/cost data, or historical comments/runs.
|
|
15
|
+
Releases up to 0.19 also synced GitHub issues into Paperclip projects. 0.20 removed issue sync and everything built on it: repository mappings, the sync job, the pull request page, the issue detail tab, the dashboard and KPI widgets, Paperclip board access and the tools that worked on Paperclip issues (`create_pull_request`, `link_github_item`, `get_issue_interaction_summary`).
|
|
128
16
|
|
|
129
17
|
## Requirements
|
|
130
18
|
|
|
131
19
|
- Node.js 24.11+ (the `@paperclipai/plugin-sdk` 2026.831 line requires it)
|
|
132
|
-
-
|
|
133
|
-
-
|
|
20
|
+
- A Paperclip host with plugin installation enabled, `2026.831.1` or newer. The manifest relies on explicit capabilities instead of a strict host-version gate, because development hosts can report `0.0.0` during plugin upgrade.
|
|
21
|
+
- A GitHub App installed on the repositories agents work on (recommended), or a GitHub token
|
|
134
22
|
|
|
135
|
-
## Install
|
|
23
|
+
## Install
|
|
136
24
|
|
|
137
25
|
```bash
|
|
138
26
|
npx paperclipai plugin install paperclip-github-plugin
|
|
139
27
|
```
|
|
140
28
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
```bash
|
|
144
|
-
npx paperclipai plugin install paperclip-github-plugin \
|
|
145
|
-
--data-dir /path/to/paperclip-data \
|
|
146
|
-
--config /path/to/paperclip.config.json
|
|
147
|
-
```
|
|
148
|
-
|
|
149
|
-
## Install from a local checkout
|
|
150
|
-
|
|
151
|
-
If you are developing the plugin locally or testing an unpublished change, you will also need `pnpm`:
|
|
29
|
+
From a local checkout:
|
|
152
30
|
|
|
153
31
|
```bash
|
|
154
32
|
pnpm install
|
|
@@ -156,94 +34,28 @@ pnpm build
|
|
|
156
34
|
npx paperclipai plugin install --local "$PWD"
|
|
157
35
|
```
|
|
158
36
|
|
|
159
|
-
##
|
|
160
|
-
|
|
161
|
-
1. Open the plugin settings for **GitHub Sync** from inside the Paperclip company you want to configure.
|
|
162
|
-
2. Paste a GitHub token, validate it, and save it.
|
|
163
|
-
3. If the deployment is authenticated or local trusted, connect Paperclip board access from the same settings page and complete the approval flow when host API calls need board credentials.
|
|
164
|
-
4. Add one or more repository mappings for the current company.
|
|
165
|
-
5. For each mapping, either choose an existing GitHub-linked Paperclip project or enter the project name that should receive synced issues.
|
|
166
|
-
6. Optionally configure company-wide defaults for imported issues, including the default assignee, the default Paperclip status, executor/reviewer/approver handoff assignees for sync-driven transitions, and ignored GitHub usernames. When Paperclip board access is connected, each assignee dropdown also offers `Me` for the connected board user. `Automatic routing` means GitHub Sync follows the issue's Paperclip execution policy first and only uses the saved fallback when Paperclip does not expose the next reviewer, approver, or return assignee yet. Bot aliases such as `renovate[bot]` are matched when you save `renovate`.
|
|
167
|
-
7. Choose the automatic sync interval in minutes.
|
|
168
|
-
8. Save the settings and run the first manual sync.
|
|
169
|
-
9. Repeat inside other companies if they need their own mappings, defaults, or board access.
|
|
170
|
-
|
|
171
|
-
Repository input accepts either `owner/repo` or `https://github.com/owner/repo`.
|
|
172
|
-
When a token is saved, the settings page audits the mapped repositories for the permissions needed by pull request actions and warns when permissions are missing or GitHub cannot verify them yet.
|
|
37
|
+
## Setup
|
|
173
38
|
|
|
174
|
-
|
|
39
|
+
Open the plugin's settings page inside the Paperclip company you want to configure.
|
|
175
40
|
|
|
176
|
-
|
|
41
|
+
### GitHub access
|
|
177
42
|
|
|
178
|
-
|
|
43
|
+
Choose **GitHub App**, enter the App ID and paste the App's private key (`.pem`). The settings page checks the credentials against GitHub and picks the App installation: the only one, or the one on the account you name when the App is installed on several. The key is stored as a company secret named `github_sync_app_key_<company id>` and referenced from plugin config as `githubAppPrivateKeyRefs`, next to `githubAppsByCompanyId` (App ID, installation ID, slug).
|
|
179
44
|
|
|
180
|
-
|
|
45
|
+
The worker signs a short-lived App JWT with that key and exchanges it for an installation access token, which it caches and renews about five minutes before its one-hour expiry. Every tool call uses that token, so comments, labels, reviews and check runs are attributed to `<slug>[bot]`. App authentication takes precedence over a saved token for that company, and saving a token again switches the company back to token authentication.
|
|
181
46
|
|
|
182
|
-
|
|
47
|
+
The App needs Metadata (read), Contents (read), Issues and Pull requests (read and write), and Checks (read and write) for check runs. `assign_to_current_user` is not available with an App, because GitHub does not let an App assign issues to itself.
|
|
183
48
|
|
|
184
|
-
|
|
49
|
+
**Personal token** is the alternative. The token is stored as a company secret named `github_sync_<company id>` and referenced from plugin config as `githubTokenRefs`. Check runs need an App, so `create_check_run` and `update_check_run` fail with a token.
|
|
185
50
|
|
|
186
|
-
###
|
|
51
|
+
### GitHub App events
|
|
187
52
|
|
|
188
|
-
|
|
189
|
-
| --- | --- |
|
|
190
|
-
| Open issue with no linked pull request, created by a repository maintainer | `todo` on first import |
|
|
191
|
-
| Open issue with no linked pull request | Configured default status, which defaults to `backlog` |
|
|
192
|
-
| Open issue with a linked pull request and unfinished CI | `in_progress`; already-blocked pending-only PR waits remain `blocked` |
|
|
193
|
-
| Open issue with failing CI, a non-mergeable linked pull request, or unresolved review threads | `todo`, or `in_progress` when GitHub Sync can hand the work back to an executor |
|
|
194
|
-
| Open issue with green CI, a merge-ready linked pull request, and all review threads resolved | `in_review` |
|
|
195
|
-
| Closed issue completed as finished work | `done` |
|
|
196
|
-
| Closed issue closed as `not_planned` or `duplicate` | `cancelled` |
|
|
197
|
-
|
|
198
|
-
Additional behavior:
|
|
199
|
-
|
|
200
|
-
- Open issues with no linked pull request that are created by a verified repository maintainer/admin bypass the default imported status and start in `todo`.
|
|
201
|
-
- If the Paperclip host initially creates that imported maintainer issue in `backlog`, GitHub Sync promotes it to `todo` without replacing the configured default assignee with the executor handoff assignee, so triage ownership stays intact.
|
|
202
|
-
- When Paperclip board access is connected for a company, the advanced assignee dropdowns list both company agents and `Me` for the connected board user.
|
|
203
|
-
- Newly imported issues that finish sync in `todo` and are assigned to an agent enqueue an assignee wakeup so the agent can pick them up promptly.
|
|
204
|
-
- GitHub Sync will not repeatedly re-open a deliberately blocked issue. When it moves an issue out of `blocked` it records a hash of the linked pull requests' externally observable state (head SHA, CI state, mergeability, merge state status, review decision, unresolved review threads); while that state is unchanged, a later pass leaves `blocked` alone. This matters when a required check is red for something nobody in the company can clear — the contributor CLA gate is the common case, an upstream baseline failure or an unreleased dependency behave the same. Previously each sync pass moved the issue back to active work, the assignee woke, re-established that it was still externally blocked, and the loop repeated on the next pass. Any real change — a push, a CI result, a review, a resolved conflict — changes the hash and normal routing resumes immediately.
|
|
205
|
-
- For linked pull requests, GitHub Sync treats merge-conflict, behind-branch, blocked, draft, unstable merge states, and unresolved review threads as executor work, while merge-ready states such as `CLEAN` and `HAS_HOOKS` can move work into `in_review` when CI is green and review threads are resolved. If an issue is already `blocked` and GitHub reports only pending external merge requirements while CI is unfinished, sync preserves the external wait instead of waking an executor. A stale aggregate `CHANGES_REQUESTED` review decision alone does not move that maintainer wait back to active execution. Transient `UNKNOWN` mergeability also does not move an already `in_review` maintainer wait back to active execution when CI is green and review threads are resolved.
|
|
206
|
-
- Imported issues that are already `blocked` stay `blocked` while any first-class `blockedBy` issue is still non-terminal, even if the linked GitHub pull request is otherwise green and review-ready.
|
|
207
|
-
- When sync moves work into `in_review`, GitHub Sync first follows the Paperclip issue execution policy's current reviewer or approver when that stage is visible on the issue. If Paperclip exposes an internal review or approval stage but not yet the participant, the plugin falls back to the configured reviewer or approver handoff assignee. If the transition is only a healthy linked-PR wait with no visible internal review or approval stage, GitHub Sync leaves the issue unassigned so it can wait on normal maintainer review without waking an internal owner. An execution state explicitly marked `completed` contains historical stage and decision fields, not active routing: GitHub Sync clears that completed policy/state and the stale internal agent assignee atomically when restoring `done` to `in_review`, keeps any human assignee, and emits no assignment wakeup.
|
|
208
|
-
- When sync moves work back into active execution, GitHub Sync first follows the Paperclip issue execution policy `returnAssignee` when it is available. Otherwise it uses the durable pull-request follow-through owner, then falls back to the configured executor handoff assignee and finally to the default imported assignee.
|
|
209
|
-
- Sync-driven handoffs to agent assignees best-effort enqueue an explicit wakeup so the next reviewer, approver, or executor can pick the issue up even when their agent is not running heartbeats.
|
|
210
|
-
- After applying a GitHub-derived state, GitHub Sync immediately stores a bounded fingerprint of the effective issue/PR condition (including head SHA, closure outcome, and the highest-priority actionable check/review/merge condition). While local Paperclip status, assignment, and execution metadata still match the desired state, the same fingerprint remains quiescent: sync does not repeat the transition, comment, or wake, including for `done`/`cancelled` closure outcomes and directly PR-linked issues. If local state later drifts under unchanged remote evidence, sync reconciles it through a drift-specific journal attempt and issues one required wake when the corrected state is actionable and agent-owned. Raw `UNKNOWN`/aggregate jitter that does not change the effective action cannot re-arm the transition. A changed effective fingerprint or a trusted new issue/PR/review comment bypasses suppression; untrusted comment-count changes do not. Status/comment watermarks advance only after their action succeeds. When a required assignee wake fails, the successful mutation and a bounded pending-wake record are already durable, so the next sync retries only the wake without repeating the status change or comment.
|
|
211
|
-
- Open imported issues that are already `backlog` stay in `backlog` until someone changes them in Paperclip.
|
|
212
|
-
- If an imported issue is `done` or `cancelled` and GitHub shows it open again with no linked pull request, sync moves it to `todo` so agents can pick it up again.
|
|
213
|
-
- Trusted new GitHub comments from the original issue author or a verified maintainer/admin can move an open imported issue back into active work, whether the new comment lands on the source issue, in a linked pull request's top-level comment stream, or in a linked pull request review thread; GitHub Sync uses `in_progress` when it can route the issue to an executor and otherwise `todo`.
|
|
214
|
-
- When the sync changes a Paperclip issue status, it adds a Paperclip comment explaining what changed and why.
|
|
215
|
-
|
|
216
|
-
## Security and authentication
|
|
217
|
-
|
|
218
|
-
The plugin is designed to avoid persisting raw credentials in plugin state.
|
|
219
|
-
|
|
220
|
-
- GitHub tokens saved through the UI are stored as per-company Paperclip secret references. Paperclip `2026.831` re-enabled plugin secret refs and made plugin config company-scoped: the settings UI mirrors each saved secret into that company's GitHub Sync plugin config as a `{ "type": "secret_ref", "secretId": "<uuid>" }` binding, the host binds that secret to the plugin, and the worker resolves it with the company id and config path. This is the normal path; no worker-local copy is needed.
|
|
221
|
-
- Paperclip board access tokens are also stored as per-company secret references and mirrored the same way.
|
|
222
|
-
- The settings UI also keeps lightweight non-secret identity labels for those saved connections, so later visits can still show who each company GitHub token and board access are connected as.
|
|
223
|
-
- Agents use Paperclip's plugin tool dispatcher for GitHub Sync tools; the settings UI no longer propagates the saved GitHub token into agent environment variables.
|
|
224
|
-
- The worker resolves those secret references at runtime instead of storing raw tokens in plugin state.
|
|
225
|
-
- When the host cannot resolve a saved secret ref (a pre-`2026.831` host that rejected plugin secret refs, or a plugin config row that still holds a pre-`2026.831` bare secret id the host will not bind), GitHub Sync keeps company-scoped worker-local compatibility copies for GitHub tokens and Paperclip board-access tokens in `${PAPERCLIP_HOME:-~/.paperclip}/plugins/github-sync/config.json`. On `2026.831` the settings page detects bare-id refs and re-mirrors them as bindings on the next visit; reconnect board access once after upgrading if sync still cannot authenticate Paperclip label or issue REST calls.
|
|
226
|
-
- On authenticated Paperclip deployments, sync is blocked until the relevant company has connected Paperclip board access. On local trusted deployments, board access setup remains visible so operators can configure it for host API paths that still require board credentials, but missing board access does not by itself block sync preflight.
|
|
227
|
-
- KPI API route requests must include `Authorization: Bearer <PAPERCLIP_API_KEY>` from an agent run; the Paperclip host authenticates the token and supplies the agent company before the worker records any metric event.
|
|
228
|
-
|
|
229
|
-
### Authenticating as a GitHub App
|
|
230
|
-
|
|
231
|
-
A company can act on GitHub as a GitHub App instead of a person. In **GitHub access**, choose **GitHub App**, enter the App ID and paste the App's private key (`.pem`). The settings page checks the credentials against GitHub, picks the App installation (the only one, or the one on the account that owns the company's mapped repositories), stores the private key as a company secret named `github_sync_app_key_<company id>`, and mirrors it into plugin config as `githubAppPrivateKeyRefs` next to `githubAppsByCompanyId` (App ID, installation ID, slug).
|
|
232
|
-
|
|
233
|
-
The worker then signs a short-lived App JWT with that key and exchanges it for an installation access token, which it caches and renews about five minutes before its one-hour expiry. Sync, every agent tool and branch publication use that token, so comments, labels, reviews and pull requests are attributed to the App's bot account (`<slug>[bot]`). App authentication takes precedence over a saved token for that company; saving a token again switches the company back to token authentication. Other companies on the same instance are unaffected.
|
|
234
|
-
|
|
235
|
-
The App needs the repository permissions for what the company does: at least Metadata (read), Contents (read), Issues and Pull requests (read and write); Checks (read and write) for check runs; Contents (write) only if agents publish branches. `assign_to_current_user` is not available in App mode, because GitHub does not let an App assign issues to itself.
|
|
236
|
-
|
|
237
|
-
### Waking agents from GitHub App events
|
|
238
|
-
|
|
239
|
-
With GitHub App authentication, GitHub can wake Paperclip agents directly, without syncing issues. GitHub sends the App's webhook deliveries to the plugin. Each delivery that matches one of the company's **event routes** wakes the route's agent through `agents.invoke`. That run has no Paperclip task, so it creates no assignments, blockers or recovery issues. The agent gets a short prompt with the event, repository, pull request or issue, head commit, labels and any comment text, and fetches the rest with the agent tools.
|
|
240
|
-
|
|
241
|
-
To set it up, open **GitHub App events** in GitHub Sync settings:
|
|
53
|
+
In **GitHub App events**:
|
|
242
54
|
|
|
243
55
|
1. Copy the **Webhook URL** (`<paperclip origin>/api/plugins/paperclip-github-plugin/webhooks/github`) into the App's webhook settings on GitHub and turn the webhook on.
|
|
244
|
-
2. Click **Generate secret
|
|
56
|
+
2. Click **Generate secret**. The secret is saved as a company secret straight away. Paste it into the App's webhook secret on GitHub.
|
|
245
57
|
3. Subscribe the App to the events your routes use: Pull request, Issues, Issue comment, Pull request review, Pull request review comment, and Check suite and Workflow run for `ci_completed`.
|
|
246
|
-
4. Write the routes as a JSON array and
|
|
58
|
+
4. Write the routes as a JSON array and click **Save event routes**.
|
|
247
59
|
|
|
248
60
|
```json
|
|
249
61
|
[
|
|
@@ -270,355 +82,107 @@ To set it up, open **GitHub App events** in GitHub Sync settings:
|
|
|
270
82
|
| `requireMention` | Comment and review events wake only when the text mentions `@<app slug>`. Defaults to `true`. |
|
|
271
83
|
| `instructions` | Text appended to the prompt, up to 4,000 characters. |
|
|
272
84
|
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
Every delivery's signature is checked against the company's webhook secret before anything in it is used. Only deliveries from the company's App installation are accepted. The App's own activity never wakes an agent. A redelivery, or several CI suites finishing on one commit, wakes each route once. A delivery with a bad signature is rejected and shows as failed in the App's delivery log.
|
|
276
|
-
|
|
277
|
-
#### Sharing the token with Paperclip's own GitHub features
|
|
278
|
-
|
|
279
|
-
GitHub Sync stores its token as a company secret named `github_sync_<company id>` and references it from plugin config. Paperclip's host-side GitHub features do not read that reference: `server/src/services/git-credentials.ts` resolves a company secret **by name**, probing `GITHUB_TOKEN`, `GH_TOKEN` and `PAPERCLIP_GITHUB_TOKEN` in that order. Those credentials back managed-checkout git authentication, the merged-PR confirmation sweep, the execution-workspace reaper's `merged_via_pr` detection, and the built-in GitHub external-object provider's liveness snapshots. Without one of those secrets those host features run unauthenticated and degrade on private repositories and GitHub rate limits.
|
|
280
|
-
|
|
281
|
-
The **GitHub access** section of GitHub Sync settings has an opt-in checkbox, **Also expose this token to Paperclip as `GITHUB_TOKEN`**. It is unchecked by default. When checked, saving the token also creates a company secret named `GITHUB_TOKEN` with the same value, or rotates the existing one in place when the company already has it, so there is never a second divergent copy. The plugin's own `github_sync_<company id>` secret and its plugin-config reference are unchanged either way; unchecking the box on a later save does **not** delete or rotate an existing `GITHUB_TOKEN`.
|
|
282
|
-
|
|
283
|
-
The host matches the name **exactly**, so the plugin looks for a secret named `GITHUB_TOKEN` case-sensitively. Paperclip also derives a unique `key` from a secret's name, so a company that already has a secret named `github_token` (or any other casing) makes the create fail with a conflict; the settings page surfaces that conflict instead of silently rotating the wrong row. Keep the secret's status `active`: the git-credential probe silently skips a disabled or archived secret, and the external-object/merged-PR path fails with an auth error on one.
|
|
85
|
+
Each matching delivery wakes the route's agent through `agents.invoke`, as a run with no Paperclip task. The prompt names the event, repository, pull request or issue, head commit, labels and any comment text, and marks GitHub text as untrusted. The agent fetches the rest with the tools.
|
|
284
86
|
|
|
285
|
-
|
|
87
|
+
`ci_completed` fires when every check run on a pull request's head commit has finished, not counting the App's own checks, so a review can wait for CI. It comes from `check_suite` and `workflow_run` deliveries, finds pull requests from forks through the commit, and reports the overall result as `success` or `failure`.
|
|
286
88
|
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
Paperclip-managed, company-scoped secret refs are the normal path on Paperclip `2026.831` and newer. If they are not available, the worker can read a local fallback file at `${PAPERCLIP_HOME:-~/.paperclip}/plugins/github-sync/config.json`:
|
|
290
|
-
|
|
291
|
-
```json
|
|
292
|
-
{
|
|
293
|
-
"githubToken": "ghp_your_token_here",
|
|
294
|
-
"githubTokensByCompanyId": {
|
|
295
|
-
"company-uuid": "ghp_company_specific_token_here"
|
|
296
|
-
},
|
|
297
|
-
"paperclipBoardApiTokensByCompanyId": {
|
|
298
|
-
"company-uuid": "paperclip_board_api_token_here"
|
|
299
|
-
}
|
|
300
|
-
}
|
|
301
|
-
```
|
|
302
|
-
|
|
303
|
-
Notes:
|
|
304
|
-
|
|
305
|
-
- This file is read by the worker only.
|
|
306
|
-
- The raw token is never persisted back into plugin state or plugin config.
|
|
307
|
-
- A GitHub token secret saved through the settings UI is the primary source. Only if the Paperclip host cannot resolve that secret ref for the plugin worker (older hosts that rejected plugin secret refs, or a ref that is not bound to the plugin for that company) does GitHub Sync store the validated token in `githubTokensByCompanyId` as a worker-local compatibility fallback.
|
|
308
|
-
- A Paperclip board access secret saved through the settings UI is also the primary source. If the host cannot resolve it for plugin workers, reconnecting board access stores the approved board token in `paperclipBoardApiTokensByCompanyId` as a worker-local compatibility fallback for direct Paperclip REST calls.
|
|
309
|
-
|
|
310
|
-
### Worker-facing Paperclip API URL
|
|
311
|
-
|
|
312
|
-
GitHub Sync uses direct worker-side Paperclip REST calls for host paths that are not fully covered by the plugin SDK, such as label reconciliation and some issue repair paths. By default, manual setup and sync actions use the current browser origin. If that origin is not reachable from the plugin worker, set **Worker Paperclip API URL** in GitHub Sync settings; the value is saved internally as plugin config `paperclipApiBaseUrl`.
|
|
313
|
-
|
|
314
|
-
For private LAN, Docker, Kubernetes, custom DNS, or self-signed-certificate deployments, set that field to a local route the plugin worker can reach, such as `http://localhost:3100`, and port-forward or route that address to the Paperclip API when needed. Do not rely on exporting a process environment variable named `PAPERCLIP_API_URL` to Paperclip; release-target verification keeps this as explicit plugin configuration because worker runtime environments do not guarantee that process variable.
|
|
315
|
-
|
|
316
|
-
## GitHub agent tools
|
|
317
|
-
|
|
318
|
-
The plugin exposes GitHub workflow tools to Paperclip agents, including:
|
|
319
|
-
|
|
320
|
-
- repository-scoped search for issues and pull requests
|
|
321
|
-
- issue reads, comment reads, comment writes, metadata updates, native `completed`/`not_planned`/`duplicate` closure and `reopened` transitions, and `assign_to_current_user` assignment to the saved token owner
|
|
322
|
-
- pull request creation, reads, updates, changed-file inspection, CI-check inspection, and asset upload for PR visual evidence
|
|
323
|
-
- review-thread reads, replies, resolve and unresolve actions, and `request_pull_request_reviewers` reviewer requests
|
|
324
|
-
- shared company memory: `remember_memory`, `recall_memories`, and `forget_memory`
|
|
325
|
-
- review tools for an AI first-pass reviewer: `submit_pull_request_review`, `create_check_run`, `update_check_run`, `add_pull_request_labels`, and `remove_pull_request_labels`
|
|
326
|
-
- organization-level GitHub Project search/listing and pull-request-to-project association
|
|
327
|
-
|
|
328
|
-
`create_pull_request` is the single agent-facing delivery call for both branch publication and PR creation. The caller supplies the Paperclip issue id, a plain local branch name, the exact 40-character local branch-tip SHA, the base branch, and the PR metadata. The optional `repository` may select any GitHub repository, including one that is not mapped in Paperclip; if omitted, the issue project must have exactly one mapped repository. By default the tool uses the execution-workspace root as the local Git checkout. For general-purpose workspaces that contain several repositories, `workspaceRelativePath` selects a checkout below that trusted root, with realpath containment enforced. The trusted plugin worker verifies checkout ownership, resolves the issue's execution worktree and GitHub secret, verifies the checked-out branch, worktree HEAD, local branch tip, and base ancestry, publishes only that exact commit with a non-forcing refspec, reads the remote branch SHA back, and only then asks GitHub to create and link the PR. GitHub token permissions determine whether publication and PR creation are allowed. The credential is never returned to or injected into the calling agent.
|
|
329
|
-
|
|
330
|
-
Branch publication uses an isolated temporary bare repository backed by the selected trusted-workspace checkout's object database. It does not execute repository hooks, accept arbitrary refspecs, or honor repository-local remotes. An optional checkout path must resolve inside the issue execution workspace, while the selected target repository must be a canonical GitHub `owner/repo` reference. Publication rejects owner-qualified heads, base-branch targets, non-fast-forward updates, cross-project issues, mismatched local branch tips, and remote SHA mismatches.
|
|
331
|
-
|
|
332
|
-
Optional `labels`, `userReviewers`, and `teamReviewers` are applied right after the pull request exists (for example the approved `type:` label and the linked issue author as reviewer). Those follow-up calls never undo the pull request: their outcome is reported in the result as `labels`, `requestedReviewers`, `requestedTeams`, or `warnings`. The tool also appends the new pull request to the issue's GitHub link record immediately, so the Paperclip issue card shows the linked pull request without waiting for the next sync. `update_pull_request` accepts a replacement `labels` set, and `get_issue` returns the issue `author`, all `participants` (author and distinct commenters with their repository association), and `reviewerCandidates` (non-bot owners, members, and collaborators among them) so agents can request the reporter and the maintainers who joined the discussion as reviewers.
|
|
333
|
-
|
|
334
|
-
The memory tools give every agent in a company one shared notebook. A note has a topic, short content (up to 2,000 characters), optional tags, and either a repository (`owner/repo`) or company-wide scope. Saving the same repository and topic again replaces the note, and `forget_memory` removes it. `recall_memories` returns notes for a repository plus the company-wide ones. It ranks them by how many query words appear in the topic, tags and content, then by recency, and returns at most 25. No model call is involved. Notes are plugin entities scoped to the company, with up to 1,000 per company, and they are never visible to another company. Don't store secrets or personal data in them.
|
|
335
|
-
|
|
336
|
-
`submit_pull_request_review` submits one review with an optional set of up to 50 inline comments on diff lines (`path`, `line`, optional `side`, and `startLine` for a range). The verdict is `COMMENT` (default) or `REQUEST_CHANGES`; `APPROVE` is rejected, so approval always stays with a human reviewer. The review summary carries the AI-authorship footer. `create_check_run` attaches a named check, such as `AI first pass`, to the pull request head commit (or an explicit `headSha`), and `update_check_run` moves it to `in_progress` or completes it with a conclusion and a `title`/`summary` output. Branch rules can require that check, which lets an agent gate a merge without approving it. GitHub only lets GitHub Apps write check runs, so these two tools need [GitHub App authentication](#authenticating-as-a-github-app); with a personal token they fail with an error that says so. `add_pull_request_labels` and `remove_pull_request_labels` change only the named labels, unlike `update_pull_request`, which replaces the whole set; removing a label the pull request does not have is reported in `notPresent` rather than failing.
|
|
337
|
-
|
|
338
|
-
The call is ordered and retry-safe rather than a cross-system transaction: a published branch may remain if GitHub PR creation or Paperclip link persistence fails. On retry, the tool re-verifies and republishes the exact SHA, then recovers an already-open PR only when repository, head, base, and head SHA all match before repairing the link and metric. It never deletes a branch or closes a PR as automatic compensation.
|
|
339
|
-
|
|
340
|
-
After that durable link is written, pull-request tools can use the same `paperclipIssueId` to read or update the PR immediately, even when the Paperclip issue was created natively and has no linked GitHub issue. If one Paperclip issue has same-number PRs in different repositories, the caller must also supply the repository so the worker can reject ambiguous or unlinked selections.
|
|
341
|
-
|
|
342
|
-
When an agent sends GitHub body content through the plugin, including issue bodies, pull request descriptions, comments, and review-thread replies, the plugin adds a GitHub-flavored Markdown footer with a horizontal rule and compact heading that discloses AI authorship. If the tool caller supplies an `llmModel`, the footer also includes the model name, for example `###### ✨ This comment was AI-generated using gpt-5.4`.
|
|
343
|
-
|
|
344
|
-
`update_issue` accepts `stateReason` with GitHub's native values `completed`, `not_planned`, `duplicate`, and `reopened`. Closing uses `state: "closed"` with one of the first three reasons; reopening uses `state: "open"` with `stateReason: "reopened"`. Duplicate closure also requires `duplicateIssueNumber`, which the worker resolves to GitHub's canonical database id in the same repository. GitHub only applies a reason while changing state, so changing the reason of an already-closed issue fails clearly and requires reopening it first.
|
|
89
|
+
Every delivery's signature is checked against the company's webhook secret before anything in it is used, and only deliveries from the company's App installation are accepted. A delivery carries no company context, so the worker reads each company's own config to find the one that owns the installation. The App's own activity never wakes an agent. A redelivery, or several CI suites finishing on one commit, wakes each route once. A delivery with a bad signature is rejected and shows as failed in the App's delivery log.
|
|
345
90
|
|
|
346
91
|
### Granting the tools to agents
|
|
347
92
|
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
Two details decide the recipe:
|
|
351
|
-
|
|
352
|
-
- Plugin tools are dispatched with `providerType: "paperclip_plugin"` and carry **no connection id, no catalog entry id and no application id** (`server/src/services/tool-gateway.ts`). A profile entry with `selectorType: "connection"` or `"catalog_entry"` requires a non-null id at write time, so those selectors can never match a plugin tool.
|
|
353
|
-
- The selectors that *can* match are `tool_name` (compared against the fully namespaced name, `paperclip-github-plugin:<tool>`) and `risk_level`. A profile with `defaultAction: "allow"` also matches everything.
|
|
354
|
-
|
|
355
|
-
The recipe below uses explicit `tool_name` include entries for all 29 tools on a profile whose `defaultAction` stays `deny`, bound at **company** scope. That keeps the profile least-privilege and makes the grant auditable per tool.
|
|
356
|
-
|
|
357
|
-
#### The 29 tool names
|
|
358
|
-
|
|
359
|
-
```text
|
|
360
|
-
paperclip-github-plugin:search_repository_items
|
|
361
|
-
paperclip-github-plugin:get_issue
|
|
362
|
-
paperclip-github-plugin:list_issue_comments
|
|
363
|
-
paperclip-github-plugin:update_issue
|
|
364
|
-
paperclip-github-plugin:assign_to_current_user
|
|
365
|
-
paperclip-github-plugin:add_issue_comment
|
|
366
|
-
paperclip-github-plugin:create_pull_request
|
|
367
|
-
paperclip-github-plugin:get_pull_request
|
|
368
|
-
paperclip-github-plugin:update_pull_request
|
|
369
|
-
paperclip-github-plugin:list_pull_request_files
|
|
370
|
-
paperclip-github-plugin:get_pull_request_checks
|
|
371
|
-
paperclip-github-plugin:list_pull_request_review_threads
|
|
372
|
-
paperclip-github-plugin:reply_to_review_thread
|
|
373
|
-
paperclip-github-plugin:resolve_review_thread
|
|
374
|
-
paperclip-github-plugin:unresolve_review_thread
|
|
375
|
-
paperclip-github-plugin:request_pull_request_reviewers
|
|
376
|
-
paperclip-github-plugin:submit_pull_request_review
|
|
377
|
-
paperclip-github-plugin:create_check_run
|
|
378
|
-
paperclip-github-plugin:update_check_run
|
|
379
|
-
paperclip-github-plugin:add_pull_request_labels
|
|
380
|
-
paperclip-github-plugin:remove_pull_request_labels
|
|
381
|
-
paperclip-github-plugin:list_organization_projects
|
|
382
|
-
paperclip-github-plugin:add_pull_request_to_project
|
|
383
|
-
paperclip-github-plugin:upload_pull_request_asset
|
|
384
|
-
paperclip-github-plugin:link_github_item
|
|
385
|
-
paperclip-github-plugin:remember_memory
|
|
386
|
-
paperclip-github-plugin:recall_memories
|
|
387
|
-
paperclip-github-plugin:forget_memory
|
|
388
|
-
paperclip-github-plugin:get_issue_interaction_summary
|
|
389
|
-
```
|
|
390
|
-
|
|
391
|
-
#### Ready-to-run recipe
|
|
392
|
-
|
|
393
|
-
The script derives the names from the host instead of hard-coding them, so it stays correct across plugin versions. Use a **board API key** as the bearer token: board *session* cookies are additionally subject to the host's board-mutation origin guard, which rejects `POST`s without a trusted `Origin` header.
|
|
394
|
-
|
|
395
|
-
```bash
|
|
396
|
-
#!/usr/bin/env bash
|
|
397
|
-
set -euo pipefail
|
|
398
|
-
|
|
399
|
-
PAPERCLIP_API_URL="${PAPERCLIP_API_URL:-http://localhost:3100}"
|
|
400
|
-
PAPERCLIP_BOARD_API_KEY="${PAPERCLIP_BOARD_API_KEY:?set a board API key}"
|
|
401
|
-
COMPANY_ID="${COMPANY_ID:?set the Paperclip company id}"
|
|
402
|
-
PLUGIN_ID="paperclip-github-plugin"
|
|
403
|
-
|
|
404
|
-
# `--fail-with-body` makes curl exit non-zero on 4xx/5xx while still printing the error body,
|
|
405
|
-
# so a 409 conflict or a 403 cannot be parsed into a null id and used in the next request.
|
|
406
|
-
api() {
|
|
407
|
-
local method="$1" path="$2"
|
|
408
|
-
shift 2
|
|
409
|
-
curl -sS --fail-with-body -X "${method}" "${PAPERCLIP_API_URL%/}${path}" \
|
|
410
|
-
-H "authorization: Bearer ${PAPERCLIP_BOARD_API_KEY}" \
|
|
411
|
-
-H "content-type: application/json" \
|
|
412
|
-
-H "accept: application/json" "$@"
|
|
413
|
-
}
|
|
414
|
-
|
|
415
|
-
require_id() {
|
|
416
|
-
local value="$1" label="$2"
|
|
417
|
-
if [ -z "${value}" ] || [ "${value}" = "null" ]; then
|
|
418
|
-
echo "${label} was not returned by Paperclip." >&2
|
|
419
|
-
exit 1
|
|
420
|
-
fi
|
|
421
|
-
printf '%s' "${value}"
|
|
422
|
-
}
|
|
423
|
-
|
|
424
|
-
# 1. Derive the tool names. As a board actor this route is unfiltered by policy and
|
|
425
|
-
# `pluginId` must be the plugin key, not the plugin's database UUID.
|
|
426
|
-
# The response is a bare array whose `name` field is already `<pluginKey>:<tool>`.
|
|
427
|
-
tool_names="$(api GET "/api/plugins/tools?pluginId=${PLUGIN_ID}" | jq -r '.[].name')"
|
|
428
|
-
test -n "${tool_names}" || { echo "No plugin tools returned; is GitHub Sync installed?" >&2; exit 1; }
|
|
429
|
-
|
|
430
|
-
# 2. Build one include entry per tool.
|
|
431
|
-
entries="$(jq -Rn --arg names "${tool_names}" '
|
|
432
|
-
($names | split("\n") | map(select(length > 0)))
|
|
433
|
-
| map({ selectorType: "tool_name", toolName: ., effect: "include" })
|
|
434
|
-
')"
|
|
435
|
-
|
|
436
|
-
# 3. Create the profile. `defaultAction` stays "deny": only the listed tools are included.
|
|
437
|
-
profile_id="$(require_id "$(api POST "/api/companies/${COMPANY_ID}/tools/profiles" -d "$(jq -n \
|
|
438
|
-
--argjson entries "${entries}" '{
|
|
439
|
-
profileKey: "github-sync-tools",
|
|
440
|
-
name: "GitHub Sync tools",
|
|
441
|
-
defaultAction: "deny",
|
|
442
|
-
status: "active",
|
|
443
|
-
entries: $entries
|
|
444
|
-
}')" | jq -r '.id')" "Profile id")"
|
|
445
|
-
|
|
446
|
-
# 4. Bind it to the whole company. `targetId` must equal the company id for company scope.
|
|
447
|
-
api POST "/api/companies/${COMPANY_ID}/tools/profiles/${profile_id}/bind" -d "$(jq -n \
|
|
448
|
-
--arg targetId "${COMPANY_ID}" '{
|
|
449
|
-
targetType: "company",
|
|
450
|
-
targetId: $targetId,
|
|
451
|
-
priority: 100
|
|
452
|
-
}')" | jq '{ id, targetType, targetId, priority }'
|
|
453
|
-
|
|
454
|
-
# 5. Verify for one agent. `allowedToolNames` includes tool_name entries that have no MCP
|
|
455
|
-
# catalog row, which is exactly how plugin tools show up here.
|
|
456
|
-
agent_id="$(require_id "$(api GET "/api/companies/${COMPANY_ID}/agents" \
|
|
457
|
-
| jq -r '[.[] | select(.status == "active")][0].id')" "Active agent id")"
|
|
458
|
-
api GET "/api/companies/${COMPANY_ID}/tools/profiles/effective/agents/${agent_id}" \
|
|
459
|
-
| jq --arg prefix "${PLUGIN_ID}:" '[.allowedToolNames[] | select(startswith($prefix))] | length'
|
|
460
|
-
```
|
|
461
|
-
|
|
462
|
-
Notes and gotchas:
|
|
463
|
-
|
|
464
|
-
- Request/response shapes at `2026.831.1`: profile create returns the profile object **at the top level** (so `.id` works), bind returns the binding at the top level, and list returns `{ "profiles": [...] }`. Profile-entry bodies take `selectorType`, `effect`, `toolName`, `riskLevel`, `applicationId`, `connectionId`, `catalogEntryId` and `conditions` — there is no `selectorValue` field, and unknown keys are silently dropped by the validator.
|
|
465
|
-
- `profileKey` must match `^[a-z0-9][a-z0-9._:-]*$`; creating a second profile with the same name in one company is a conflict.
|
|
466
|
-
- Both `POST`s require a board actor with an **active, non-viewer** company membership. Agent API keys are rejected.
|
|
467
|
-
- Binding `targetType: "agent"` narrows the grant to a single agent and wins over a company-scope binding for that agent. `project`, `routine`, `issue` and `gateway` bindings are ignored by the effective-tools view.
|
|
468
|
-
- To revoke, `POST /api/companies/{companyId}/tools/profiles/{profileId}/unbind` with `{"targetType":"company","targetId":"<companyId>"}`.
|
|
469
|
-
- The effective-tools route is evaluated **per agent**, and an `agent`-scoped binding overrides the company one, so verifying one agent does not prove the grant for every agent. GitHub Sync settings runs this same check read-only against a single sampled agent and warns when that agent can see none of the tools; the banner names the agent it checked. The check needs Paperclip board access connected and a reachable **Worker Paperclip API URL**; on hosts that do not expose the route it stays silent.
|
|
470
|
-
|
|
471
|
-
### KPI attribution API route
|
|
472
|
-
|
|
473
|
-
The `create_pull_request` tool automatically records a company-level Paperclip PR creation metric. For delivery flows that use `gh` or another non-plugin GitHub client, post a JSON payload to `/api/plugins/paperclip-github-plugin/api/company-metrics/events` after the PR is created.
|
|
474
|
-
|
|
475
|
-
Supported payload fields:
|
|
476
|
-
|
|
477
|
-
- `metric` required: `pull_request_created`
|
|
478
|
-
- `companyId` optional; when present it must match the authenticated agent's company
|
|
479
|
-
- `repository` optional: `owner/repo` or `https://github.com/owner/repo`
|
|
480
|
-
- `pullRequestNumber` optional
|
|
481
|
-
- `pullRequestUrl` optional
|
|
482
|
-
- `paperclipIssueId` optional: the Paperclip issue id that should be linked to the pull request for future PR-status sync
|
|
483
|
-
- `occurredAt` optional ISO timestamp
|
|
484
|
-
- `eventKey` optional custom dedupe key
|
|
485
|
-
- `count` optional positive integer
|
|
486
|
-
|
|
487
|
-
Each request must be made by a Paperclip agent run and include:
|
|
488
|
-
|
|
489
|
-
- `Authorization: Bearer <PAPERCLIP_API_KEY>`
|
|
490
|
-
|
|
491
|
-
The Paperclip host validates that bearer token and passes the authenticated agent company to the plugin worker. Requests are rejected before worker dispatch when the token is missing, invalid, expired, or not an agent token.
|
|
492
|
-
|
|
493
|
-
Example:
|
|
93
|
+
Paperclip's tool gateway is fail-closed: an agent sees no `paperclip-github-plugin:*` tools until a tool profile includes them. Plugin tools carry no connection or catalog id, so only `tool_name` and `risk_level` selectors (or `defaultAction: "allow"`) can match them. Give each agent only the tools it needs: create a profile with `defaultAction: "deny"` and one `tool_name` include entry per tool, using the namespaced name such as `paperclip-github-plugin:submit_pull_request_review`, and bind it to the agent or the company.
|
|
494
94
|
|
|
495
95
|
```bash
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
96
|
+
API="${PAPERCLIP_API_URL:-http://localhost:3100}"
|
|
97
|
+
COMPANY_ID="<company id>"
|
|
98
|
+
AGENT_ID="<agent id>"
|
|
99
|
+
auth=(-H "authorization: Bearer ${PAPERCLIP_BOARD_API_KEY:?set a board API key}" -H "content-type: application/json")
|
|
100
|
+
|
|
101
|
+
entries="$(jq -n '[
|
|
102
|
+
"get_pull_request", "list_pull_request_review_threads", "submit_pull_request_review",
|
|
103
|
+
"create_check_run", "update_check_run", "add_pull_request_labels", "remove_pull_request_labels",
|
|
104
|
+
"add_issue_comment", "recall_memories", "remember_memory", "forget_memory"
|
|
105
|
+
] | map({ selectorType: "tool_name", toolName: ("paperclip-github-plugin:" + .), effect: "include" })')"
|
|
106
|
+
|
|
107
|
+
profile_id="$(curl -sS --fail-with-body "${auth[@]}" -X POST "$API/api/companies/$COMPANY_ID/tools/profiles" \
|
|
108
|
+
-d "$(jq -n --argjson entries "$entries" '{ profileKey: "reviewer-github-tools", name: "Reviewer GitHub tools", defaultAction: "deny", status: "active", entries: $entries }')" \
|
|
109
|
+
| jq -r '.id')"
|
|
110
|
+
|
|
111
|
+
curl -sS --fail-with-body "${auth[@]}" -X POST "$API/api/companies/$COMPANY_ID/tools/profiles/$profile_id/bind" \
|
|
112
|
+
-d "$(jq -n --arg id "$AGENT_ID" '{ targetType: "agent", targetId: $id, priority: 100 }')"
|
|
113
|
+
|
|
114
|
+
# Check what the agent can call now.
|
|
115
|
+
curl -sS --fail-with-body "${auth[@]}" "$API/api/companies/$COMPANY_ID/tools/profiles/effective/agents/$AGENT_ID" \
|
|
116
|
+
| jq '[.allowedToolNames[] | select(startswith("paperclip-github-plugin:"))]'
|
|
502
117
|
```
|
|
503
118
|
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
### Paperclip 2026.831 compatibility boundary
|
|
119
|
+
`GET /api/plugins/tools?pluginId=paperclip-github-plugin` lists every tool name. An agent-scoped binding overrides a company one for that agent. To revoke, `POST .../tools/profiles/{profileId}/unbind` with the same target.
|
|
507
120
|
|
|
508
|
-
|
|
121
|
+
## Agent tools
|
|
509
122
|
|
|
510
|
-
|
|
511
|
-
- **Secret refs re-enabled.** Company-scoped secret refs are the normal path again. The settings UI mirrors GitHub tokens and board access tokens into plugin config as `{ "type": "secret_ref", "secretId": "<uuid>" }` bindings, and the worker resolves them with the company id and config path. The worker-local token file remains a compatibility fallback only.
|
|
512
|
-
- **Tool gateway.** Agent tool discovery and execution now run through the host tool gateway, which applies each company's tool-access policy before a GitHub Sync tool runs. The gateway is fail-closed, so a company with no matching tool profile sees no GitHub Sync tools at all. Tool names are unchanged (`<pluginId>:<tool>`); see [Granting the tools to agents](#granting-the-tools-to-agents) for the profile recipe and the settings-page warning that detects this.
|
|
513
|
-
- **Optional capabilities not adopted.** `2026.831` adds `issue.interactions.read`, `issue.attachments.read`, `approvals.read`, `issue.comments.create_human_attributed`, `issue.interactions.respond`, and `approvals.respond`. GitHub Sync does not use those host surfaces, so it does not declare them; it keeps its existing capability set.
|
|
514
|
-
- **Company export/import does not carry plugin data.** The full-fidelity import/export bundles introduced in `2026.817` describe companies, agents, skills, projects, issues, comments, labels, blobs, documents, work products, monitors and attachments (`packages/shared/src/validators/company-portability.ts`). The manifest has no plugin section at all, so **nothing owned by GitHub Sync survives an export/import**: repository mappings, plugin config and secret refs, issue-link and pull-request-link entities, the import registry, KPI history and the issue interaction ledger are all absent from the bundle, and imported issues keep only their `metadata`. After importing a company, re-open GitHub Sync settings in the target company, save the token and mappings again, and expect the first sync to treat previously imported GitHub issues as new work unless the links are rebuilt. A "re-link imported company" action that rebuilds link entities from the canonical GitHub URLs in issue descriptions and comments is future work, not a shipped feature.
|
|
515
|
-
- **The experimental GitHub MCP app is complementary, not a replacement.** Connections v3 (`2026.722`) ships a GitHub app definition (`packages/shared/src/app-definitions/github.json`) that connects agents to GitHub's hosted MCP server at `https://api.githubcopilot.com/mcp/` with an API key. Those are *raw* GitHub tools: they act on `owner/repo` coordinates, know nothing about Paperclip issues, and the connection credential is handled as a normal connection secret. GitHub Sync's tools are *issue-aware*: they take a `paperclipIssueId`, resolve the mapped repository and execution worktree, write durable issue/PR link entities and interaction-ledger rows, record KPI attribution, and never return or inject the GitHub token into the calling agent. Use the MCP app for ad-hoc or read-only GitHub work outside mapped projects, and GitHub Sync tools for anything that has to stay attached to Paperclip work. If both are enabled, scope them with separate tool profiles so agents get a predictable set.
|
|
516
|
-
- **The host's merged-PR confirmation sweep coexists with plugin status routing.** `2026.817` added a sweep (`server/src/services/issue-thread-interactions.ts`, `sweepMergedPullRequestConfirmations`) that auto-resolves `request_confirmation` interactions whose text references a pull request once GitHub reports it merged. It uses a read-only merge-state resolver and the host's own `GITHUB_TOKEN`-family credential, so it never writes to GitHub and never changes issue status. GitHub Sync remains the source of truth for mapped and linked issue status: the sweep closes the human confirmation loop, while sync still performs the `in_review` -> `done` transition, the assignee and execution-policy handoff, and the transition comment. The two can run against the same pull request without conflicting; if the sweep resolves nothing, check that the host has one of the `GITHUB_TOKEN`-family company secrets (see [Security and authentication](#security-and-authentication)).
|
|
517
|
-
- **No strict host-version gate.** The manifest still relies on declared capabilities and runtime fallbacks instead of `minimumHostVersion`, because latest/development hosts can report `0.0.0` during plugin upgrade.
|
|
518
|
-
- **Project sidebar item has no mount point.** `2026.831` made the streamlined main sidebar mandatory (PAP-12472) and no longer renders the per-project list that hosted `projectSidebarItem` contributions. GitHub Sync keeps declaring the slot for hosts that render it, but on `2026.831` the **Pull Requests** entry does not appear; the queue page itself is unaffected and opens at `/<company-prefix>/github-pull-requests?projectId=<project id>`. The e2e harness verifies the sidebar link only when the host renders it and always opens the page by route.
|
|
123
|
+
Every tool that targets an issue or pull request takes `repository` (`owner/repo` or `https://github.com/owner/repo`) and `issueNumber` or `pullRequestNumber`.
|
|
519
124
|
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
125
|
+
| Area | Tools |
|
|
126
|
+
| --- | --- |
|
|
127
|
+
| Issues | `search_repository_items`, `get_issue`, `list_issue_comments`, `update_issue`, `assign_to_current_user`, `add_issue_comment` |
|
|
128
|
+
| Pull requests | `get_pull_request`, `update_pull_request`, `list_pull_request_files`, `get_pull_request_checks`, `request_pull_request_reviewers`, `upload_pull_request_asset` |
|
|
129
|
+
| Reviews | `submit_pull_request_review`, `list_pull_request_review_threads`, `reply_to_review_thread`, `resolve_review_thread`, `unresolve_review_thread` |
|
|
130
|
+
| Checks and labels | `create_check_run`, `update_check_run`, `add_pull_request_labels`, `remove_pull_request_labels` |
|
|
131
|
+
| GitHub Projects | `list_organization_projects`, `add_pull_request_to_project` |
|
|
132
|
+
| Memory | `remember_memory`, `recall_memories`, `forget_memory` |
|
|
523
133
|
|
|
524
|
-
|
|
134
|
+
- **AI authorship.** Issue bodies, pull request descriptions, comments, review summaries and thread replies get a Markdown footer that discloses AI authorship. Pass `llmModel` to name the model in it, for example `###### ✨ This comment was AI-generated using gpt-5.4`.
|
|
135
|
+
- **Reviews never approve.** `submit_pull_request_review` submits one review with up to 50 inline comments (`path`, `line`, optional `side`, and `startLine` for a range). The verdict is `COMMENT` (default) or `REQUEST_CHANGES`, and `APPROVE` is rejected, so approval always stays with a person.
|
|
136
|
+
- **Check runs gate merges.** `create_check_run` attaches a named check, such as `AI first pass`, to the pull request head (or an explicit `headSha`). `update_check_run` moves it to `in_progress` or completes it with a conclusion and a `title`/`summary`. Branch rules can require the check. GitHub only lets Apps write check runs.
|
|
137
|
+
- **Labels.** `add_pull_request_labels` and `remove_pull_request_labels` change only the named labels; removing a label the pull request does not have is reported in `notPresent`. `update_pull_request` replaces the whole set.
|
|
138
|
+
- **Issue state.** `update_issue` accepts GitHub's `stateReason` values `completed`, `not_planned`, `duplicate` and `reopened`. Duplicate closure needs `duplicateIssueNumber`, which the worker resolves to GitHub's id. GitHub only applies a reason while changing state.
|
|
139
|
+
- **Reviewer routing.** `get_issue` returns the `author`, all `participants` (author and commenters, with their repository association) and `reviewerCandidates` (non-bot owners, members and collaborators among them).
|
|
140
|
+
- **Assets.** `upload_pull_request_asset` takes `fileName` and `contentBase64` or a `dataUrl` (up to 10 MiB), commits it to a non-merge branch `paperclip-artifacts-pr-<number>` under `assets/pr-<number>/<head-sha>/`, and returns immutable raw URLs plus Markdown for the pull request description.
|
|
141
|
+
- **Memory.** A note has a topic, content up to 2,000 characters, optional tags, and either a repository or company-wide scope. Saving the same repository and topic replaces the note, and `forget_memory` removes it. `recall_memories` returns the repository's notes plus the company-wide ones, ranked by how many query words appear in the topic, tags and content, then by recency, at most 25. No model call is involved. Notes are plugin entities scoped to the company, up to 1,000 per company. Don't store secrets or personal data in them.
|
|
525
142
|
|
|
526
|
-
|
|
143
|
+
## Security
|
|
527
144
|
|
|
528
|
-
|
|
145
|
+
- Credentials are company secrets, referenced from company-scoped plugin config as `{ "type": "secret_ref", "secretId": "<uuid>" }` bindings. The worker resolves them at runtime and never stores raw credentials in plugin state, returns them from a tool, or injects them into an agent.
|
|
146
|
+
- Webhook deliveries are verified with HMAC-SHA256 against the company's webhook secret, and GitHub text in wake prompts is marked as untrusted.
|
|
529
147
|
|
|
530
|
-
|
|
148
|
+
### Worker-local token file
|
|
531
149
|
|
|
532
|
-
|
|
150
|
+
If the host cannot resolve a saved token secret for the worker (an older host, or a ref that is not bound to the plugin), the settings page stores the validated token in `${PAPERCLIP_HOME:-~/.paperclip}/plugins/github-sync/config.json` as a compatibility fallback. You can also write that file yourself:
|
|
533
151
|
|
|
534
152
|
```json
|
|
535
153
|
{
|
|
536
|
-
"
|
|
537
|
-
"
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
"contentBase64": "<base64 PDF bytes>",
|
|
541
|
-
"mimeType": "application/pdf"
|
|
154
|
+
"githubToken": "ghp_your_token_here",
|
|
155
|
+
"githubTokensByCompanyId": {
|
|
156
|
+
"company-uuid": "ghp_company_specific_token_here"
|
|
157
|
+
}
|
|
542
158
|
}
|
|
543
159
|
```
|
|
544
160
|
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
### Issue link tool
|
|
548
|
-
|
|
549
|
-
Authenticated agent runs can link the current Paperclip issue to a GitHub issue or pull request by calling the `link_github_item` tool. This is useful after creating a PR with `gh` in a repository that is not mapped to a Paperclip project.
|
|
550
|
-
|
|
551
|
-
Supported payload fields:
|
|
552
|
-
|
|
553
|
-
- `paperclipIssueId` required: the Paperclip issue id to link
|
|
554
|
-
- `kind` optional: `issue` or `pull_request`; omitted values are inferred from full GitHub URLs when possible
|
|
555
|
-
- `reference` optional: a GitHub issue or pull request number, or a full GitHub URL
|
|
556
|
-
- `repository` optional: `owner/repo` or `https://github.com/owner/repo`, required for number-only references when the issue project is not mapped to that repository
|
|
557
|
-
- `issueNumber`, `pullRequestNumber`, or `pullRequestUrl` optional alternatives to `reference`
|
|
558
|
-
|
|
559
|
-
Example tool payload:
|
|
560
|
-
|
|
561
|
-
```json
|
|
562
|
-
{
|
|
563
|
-
"paperclipIssueId": "iss_123",
|
|
564
|
-
"pullRequestUrl": "https://github.com/third-party/external/pull/77"
|
|
565
|
-
}
|
|
566
|
-
```
|
|
161
|
+
Only the worker reads it, and the token is never copied into plugin state or config.
|
|
567
162
|
|
|
568
163
|
## Troubleshooting
|
|
569
164
|
|
|
570
|
-
-
|
|
571
|
-
-
|
|
572
|
-
-
|
|
573
|
-
-
|
|
574
|
-
-
|
|
575
|
-
- If a scheduled sync reports that Paperclip denied worker access for a company, that company has GitHub Sync mappings but no saved plugin config row. Open GitHub Sync settings inside that company and save settings once so the host registers it.
|
|
576
|
-
- If a KPI API route call is rejected, make sure the request includes `Authorization: Bearer ${PAPERCLIP_API_KEY}`, that the token is still valid for the current run, and that any `companyId` in the payload matches the calling agent's company.
|
|
577
|
-
- If the worker reaches an authenticated HTML page instead of the Paperclip API JSON responses it expects, connect Paperclip board access for that company or set **Worker Paperclip API URL** in GitHub Sync settings to a worker-accessible Paperclip API origin.
|
|
578
|
-
- If a Paperclip API fetch fails before any HTTP response is returned, the saved diagnostics include the method, URL, primary error, nested cause, and cause code when Node exposes them.
|
|
579
|
-
- If a sync run finishes with partial failures, open the saved troubleshooting panel in GitHub Sync to inspect the repository, issue number, raw error, and suggested fix for each recorded failure.
|
|
580
|
-
- If sync says the Paperclip API URL is not trusted, set **Worker Paperclip API URL** in GitHub Sync settings to the worker-accessible Paperclip API origin and retry.
|
|
581
|
-
- If a pull request comment or review action is rejected, read the full toast message. Fine-grained GitHub tokens need write access to that repository, and GitHub requires a review summary when requesting changes.
|
|
582
|
-
- If a GitHub-linked project does not show the **Pull requests** sidebar entry on Paperclip `2026.831`, that is expected: the streamlined sidebar has no `projectSidebarItem` mount point, so open `/<company-prefix>/github-pull-requests?projectId=<project id>` directly. On hosts that still render project sidebar items, reopen the plugin settings and re-save the mapping. The project pull request surfaces also recover older mappings when saved ids are missing, and they can fall back to the active project's bound GitHub repository when the project already has a GitHub workspace configured.
|
|
583
|
-
- If GitHub rate limiting is hit, the plugin pauses sync until the reported reset time instead of retrying pointlessly.
|
|
584
|
-
- If a manual sync takes longer than the host action window, it continues in the background and updates the UI when it finishes or when a cancellation request stops it.
|
|
585
|
-
- If a sync shows `running` after the worker has restarted, the next settings read, toolbar read, cancel action, or scheduler tick will reconcile that stale run into an interrupted error or a cancelled result so you can retry cleanly.
|
|
165
|
+
- **Webhook deliveries fail with 502.** Releases before 0.20 read instance-wide config while handling a delivery, which Paperclip 2026.1117 refuses with `company context is required`. Upgrade the plugin.
|
|
166
|
+
- **No agent wakes.** In the App's delivery log on GitHub, check the delivery got a 2xx. Then check the company has a webhook secret (the settings page shows **Secret saved**), the App is subscribed to the route's events, and the route's filters match. Comment routes need an `@<app slug>` mention unless `requireMention` is `false`.
|
|
167
|
+
- **Tools fail with `deny_default`.** No tool profile grants the tool to that agent. See [Granting the tools to agents](#granting-the-tools-to-agents).
|
|
168
|
+
- **`Secret is not bound to plugin` or `Invalid secret reference for plugin`.** The company's plugin config still holds a pre-2026.831 bare secret id. Open the settings page in that company so it re-saves the reference as a binding, or save the credentials again.
|
|
169
|
+
- **Upgrade fails with `requires host version ... but this server is running 0.0.0`.** That is an older build with a strict host-version gate. Upgrade to a current build.
|
|
586
170
|
|
|
587
171
|
## Development
|
|
588
172
|
|
|
589
|
-
Run the smallest relevant checks from the repository root:
|
|
590
|
-
|
|
591
173
|
```bash
|
|
592
174
|
pnpm typecheck
|
|
593
175
|
pnpm test
|
|
594
176
|
pnpm build
|
|
595
177
|
```
|
|
596
178
|
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
- `pnpm dev` watches the manifest, worker, and UI bundles and rebuilds them into `dist/`
|
|
600
|
-
- `pnpm dev:ui` starts a local Paperclip plugin UI dev server from `dist/ui` on port `4177`
|
|
601
|
-
- `pnpm test:e2e` builds the plugin, boots an isolated Paperclip `2026.831.1` instance, installs the plugin, and verifies the hosted settings page renders
|
|
602
|
-
- `pnpm verify:manual` builds the plugin, boots a local-trusted Paperclip `2026.831.1` instance for manual inspection, seeds a `Dummy Company` with a mapped review project and a `CEO` agent on the Codex local adapter using model `gpt-5.4`, installs the plugin, and opens the company dashboard without seeding KPI history.
|
|
603
|
-
|
|
604
|
-
The disposable Paperclip harnesses run `paperclipai@2026.831.1` under `node@24`, matching the release's Docker baseline and avoiding Node 20's missing `node:sqlite` runtime module.
|
|
605
|
-
|
|
606
|
-
For fast hosted UI iteration, run `pnpm dev` in one terminal and `pnpm dev:ui` in another.
|
|
607
|
-
|
|
608
|
-
Set `PAPERCLIP_E2E_PAPERCLIPAI_VERSION` to run e2e or manual verification against a different Paperclip release.
|
|
609
|
-
|
|
610
|
-
If you want the seeded `CEO` agent used in manual verification to opt into Codex's bypass flag, set `PAPERCLIP_E2E_CEO_BYPASS_APPROVALS_AND_SANDBOX=true`.
|
|
179
|
+
`pnpm dev` watches the manifest, worker and UI bundles and rebuilds them into `dist/`. `pnpm dev:ui` serves the settings page from `dist/ui` on port 4177.
|
|
611
180
|
|
|
612
181
|
## Release process
|
|
613
182
|
|
|
614
|
-
- Publishing
|
|
615
|
-
- The
|
|
616
|
-
- The
|
|
617
|
-
- The published version is derived from the GitHub release tag rather than the committed `package.json` version.
|
|
618
|
-
- Tags may be either `1.2.3` or `v1.2.3`; the workflow normalizes both to `1.2.3`.
|
|
619
|
-
- During release, the package version is stamped from the tag before build and publish, and the built plugin manifest uses that same resolved version.
|
|
620
|
-
- After a successful publish, the workflow also commits that resolved version back into the checked-in `package.json` on the release target branch so the repository metadata stays in sync with npm.
|
|
621
|
-
- The workflow is intended for npm trusted publishing through GitHub Actions OIDC, so no long-lived `NPM_TOKEN` secret is required when trusted publishing is configured correctly.
|
|
183
|
+
- Publishing a GitHub Release runs `.github/workflows/release.yml`.
|
|
184
|
+
- The version comes from the release tag (`1.2.3` or `v1.2.3`), is stamped into the package and the built manifest, and is committed back to `package.json` on the target branch after publishing.
|
|
185
|
+
- The package is published with npm trusted publishing through GitHub Actions OIDC, so no `NPM_TOKEN` secret is needed.
|
|
622
186
|
|
|
623
187
|
## License
|
|
624
188
|
|