mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-11-25 16:14:26 +01:00
## Thinking Path
> - Paperclip is the open source app people use to manage AI agents for
work
> - Plugins can provide connectors; a connection saves each tool's
definition from the plugin manifest when it is connected
> - The gateway advertised those saved definitions to agents, and its
freshness check only compared tool name and risk
> - So a plugin upgrade that changed a tool's input schema never reached
existing connections until someone refreshed the catalog by hand
> - This pull request treats a plugin connection's static tools as
Paperclip-defined, so the gateway reads their schema from the installed
plugin
> - The benefit is that plugin upgrades reach every existing connection
at once, with no manual step
## Linked Issues or Issue Description
**What happened?**
An upgraded connector plugin added a `count` operation and `order` and
`view` inputs to one tool. On a stack that had connected before the
upgrade, the agent's tool still rejected `count` ("must be one of the
allowed values") and `order` ("must NOT have additional properties"),
even though the installed manifest declared them. A manual catalog
refresh fixed that one connection.
**Expected behavior**
After a plugin upgrade, agents see the installed plugin's current tool
definitions on every existing connection.
**Steps to reproduce**
1. Install a connector plugin and connect it for an agent.
2. Upgrade the plugin so a tool's `parametersSchema` gains a property.
3. List the agent's session tools: the old schema is still advertised.
## What Changed
- `server/src/services/plugin-connector-runtime.ts`:
`pluginConnectionToolDefinition` returns the installed manifest's
definition of one static tool, built with the same descriptor the
catalog uses.
- `server/src/services/connectors/paperclip-defined-tools.ts`: the
Paperclip-defined tool registry now also covers plugin connections with
a static tool list, and its definition callback receives the connection.
- `server/src/__tests__/plugin-connector-tool-definitions.test.ts`: an
upgrade that adds an input is visible in the agent's session without a
catalog refresh.
## Verification
- New test passes; without the registry change it fails with `expected {
type: 'object' } to match object { properties: { order: ... } }`.
- `npx vitest run src/__tests__/plugin-connector-*.test.ts
src/__tests__/plugin-connectors-*.test.ts` plus catalog publication
tests: 42 passed, 1 skipped.
## Risks
- Low. Only plugin connections with a static tool list change. Dynamic
plugin catalogs and other connectors are unchanged. Catalog publication
already treats Paperclip-defined tools as trusted, so a plugin's own
updated definitions are not held for review.
## Model Used
- Claude Opus 5.5 (`claude-opus-5-5`), via Claude Code, with tool use.
## Checklist
- [x] I have included a thinking path that traces from project context
to this change
- [x] I have specified the model used (with version and capability
details)
- [x] I have checked ROADMAP.md and confirmed this PR does not duplicate
planned core work
- [x] I have searched GitHub for duplicate or related PRs and linked
them above
- [x] I have either (a) linked existing issues with `Fixes: #` / `Closes
#` / `Refs #` OR (b) described the issue in-PR following the relevant
issue template
- [x] I have not referenced internal/instance-local Paperclip issues or
links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip`
URLs)
- [x] My branch name describes the change (e.g. `docs/...`, `fix/...`)
and contains no internal Paperclip ticket id or instance-derived details
- [x] I have run tests locally and they pass
- [x] I have added or updated tests where applicable
- [x] I have updated relevant documentation to reflect my changes
- [x] I have considered and documented any risks above
- [ ] All Paperclip CI gates are green
- [ ] Greptile is 5/5 with no open P2s, recommendations, or follow-ups
- [x] I will address all Greptile and reviewer comments before
requesting merge
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>