From ca0d650f8c18e463a916d33a1ee27270dc46fd88 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 4 Dec 2026 15:08:32 -0800 Subject: [PATCH 1/7] build(deps-dev): bump vitest from 4.1.12 to 5.1.2 in /scripts/typecheck-sandbox-providers (#22600) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bumps [vitest](https://github.com/vitest-dev/vitest/tree/HEAD/packages/vitest) from 4.1.12 to 5.1.2.
Release notes

Sourced from vitest's releases.

v5.1.2

   🐞 Bug Fixes

   🏎 Performance

    View changes on GitHub

v5.1.1

   🚀 Features

   🐞 Bug Fixes

... (truncated)

Commits

Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .../sandbox-providers/boxd/package.json | 2 +- .../cloudflare/bridge-template/package.json | 2 +- .../sandbox-providers/cloudflare/package.json | 2 +- .../sandbox-providers/createos/package.json | 2 +- .../sandbox-providers/e2b/package.json | 2 +- .../sandbox-providers/exe-dev/package.json | 2 +- .../sandbox-providers/kubernetes/package.json | 2 +- .../sandbox-providers/modal/package.json | 2 +- .../sandbox-providers/novita/package.json | 2 +- .../pnpm-lock.yaml | 234 ++++++------------ 10 files changed, 88 insertions(+), 164 deletions(-) diff --git a/packages/plugins/sandbox-providers/boxd/package.json b/packages/plugins/sandbox-providers/boxd/package.json index 10e0d78a7ec..ce0930e13c4 100644 --- a/packages/plugins/sandbox-providers/boxd/package.json +++ b/packages/plugins/sandbox-providers/boxd/package.json @@ -55,7 +55,7 @@ "devDependencies": { "@types/node": "^24.0.0", "typescript": "^7.0.2", - "vitest": "^4.1.8" + "vitest": "^5.1.2" }, "engines": { "node": ">=24.11.0" diff --git a/packages/plugins/sandbox-providers/cloudflare/bridge-template/package.json b/packages/plugins/sandbox-providers/cloudflare/bridge-template/package.json index ff3d0b20d1d..6152f445d35 100644 --- a/packages/plugins/sandbox-providers/cloudflare/bridge-template/package.json +++ b/packages/plugins/sandbox-providers/cloudflare/bridge-template/package.json @@ -15,7 +15,7 @@ "devDependencies": { "@cloudflare/workers-types": "^5.20261120.1", "typescript": "^7.0.2", - "vitest": "^4.1.8", + "vitest": "^5.1.2", "wrangler": "^4.170.0" }, "engines": { diff --git a/packages/plugins/sandbox-providers/cloudflare/package.json b/packages/plugins/sandbox-providers/cloudflare/package.json index 3b7d4b2afdd..0243ba6ca5e 100644 --- a/packages/plugins/sandbox-providers/cloudflare/package.json +++ b/packages/plugins/sandbox-providers/cloudflare/package.json @@ -53,7 +53,7 @@ "devDependencies": { "@types/node": "^24.0.0", "typescript": "^7.0.2", - "vitest": "^4.1.8" + "vitest": "^5.1.2" }, "engines": { "node": ">=24.11.0" diff --git a/packages/plugins/sandbox-providers/createos/package.json b/packages/plugins/sandbox-providers/createos/package.json index 47ca81e2f88..82ee71b5fb4 100644 --- a/packages/plugins/sandbox-providers/createos/package.json +++ b/packages/plugins/sandbox-providers/createos/package.json @@ -52,7 +52,7 @@ "devDependencies": { "@types/node": "^24.0.0", "typescript": "^7.0.2", - "vitest": "^4.1.8" + "vitest": "^5.1.2" }, "engines": { "node": ">=24.11.0" diff --git a/packages/plugins/sandbox-providers/e2b/package.json b/packages/plugins/sandbox-providers/e2b/package.json index 532db01dd5d..9a75033432c 100644 --- a/packages/plugins/sandbox-providers/e2b/package.json +++ b/packages/plugins/sandbox-providers/e2b/package.json @@ -55,7 +55,7 @@ "devDependencies": { "@types/node": "^24.0.0", "typescript": "^7.0.2", - "vitest": "^4.1.8" + "vitest": "^5.1.2" }, "engines": { "node": ">=24.11.0" diff --git a/packages/plugins/sandbox-providers/exe-dev/package.json b/packages/plugins/sandbox-providers/exe-dev/package.json index ac17f159082..a7cfc1a1556 100644 --- a/packages/plugins/sandbox-providers/exe-dev/package.json +++ b/packages/plugins/sandbox-providers/exe-dev/package.json @@ -52,7 +52,7 @@ "devDependencies": { "@types/node": "^24.0.0", "typescript": "^7.0.2", - "vitest": "^4.1.8" + "vitest": "^5.1.2" }, "engines": { "node": ">=24.11.0" diff --git a/packages/plugins/sandbox-providers/kubernetes/package.json b/packages/plugins/sandbox-providers/kubernetes/package.json index 77b3dadaffa..649e67abe06 100644 --- a/packages/plugins/sandbox-providers/kubernetes/package.json +++ b/packages/plugins/sandbox-providers/kubernetes/package.json @@ -54,7 +54,7 @@ "devDependencies": { "@types/node": "^24.0.0", "typescript": "^7.0.2", - "vitest": "^4.1.8" + "vitest": "^5.1.2" }, "engines": { "node": ">=24.11.0" diff --git a/packages/plugins/sandbox-providers/modal/package.json b/packages/plugins/sandbox-providers/modal/package.json index c188fa1e5e2..b5d0366d5f5 100644 --- a/packages/plugins/sandbox-providers/modal/package.json +++ b/packages/plugins/sandbox-providers/modal/package.json @@ -55,7 +55,7 @@ "devDependencies": { "@types/node": "^24.0.0", "typescript": "^7.0.2", - "vitest": "^4.1.8" + "vitest": "^5.1.2" }, "engines": { "node": ">=24.11.0" diff --git a/packages/plugins/sandbox-providers/novita/package.json b/packages/plugins/sandbox-providers/novita/package.json index d883d301cb2..42ffb4991d5 100644 --- a/packages/plugins/sandbox-providers/novita/package.json +++ b/packages/plugins/sandbox-providers/novita/package.json @@ -56,7 +56,7 @@ "devDependencies": { "@types/node": "^24.0.0", "typescript": "^7.0.2", - "vitest": "^4.1.8" + "vitest": "^5.1.2" }, "engines": { "node": ">=24.11.0" diff --git a/scripts/typecheck-sandbox-providers/pnpm-lock.yaml b/scripts/typecheck-sandbox-providers/pnpm-lock.yaml index 3afc058c3d5..748530e8ade 100644 --- a/scripts/typecheck-sandbox-providers/pnpm-lock.yaml +++ b/scripts/typecheck-sandbox-providers/pnpm-lock.yaml @@ -21,8 +21,8 @@ importers: specifier: ^7.0.2 version: 7.0.2 vitest: - specifier: ^4.1.8 - version: 4.1.12(@opentelemetry/api@1.10.0)(@types/node@24.19.2)(vite@7.3.7(@types/node@24.19.2)(yaml@2.9.1)) + specifier: ^5.1.2 + version: 5.1.2(@opentelemetry/api@1.10.0)(@types/node@24.19.2)(vite@7.3.7(@types/node@24.19.2)(yaml@2.9.1)) ../../packages/plugins/sandbox-providers/cloudflare: devDependencies: @@ -33,8 +33,8 @@ importers: specifier: ^7.0.2 version: 7.0.2 vitest: - specifier: ^4.1.8 - version: 4.1.12(@opentelemetry/api@1.10.0)(@types/node@24.19.2)(vite@7.3.7(@types/node@24.19.2)(yaml@2.9.1)) + specifier: ^5.1.2 + version: 5.1.2(@opentelemetry/api@1.10.0)(@types/node@24.19.2)(vite@7.3.7(@types/node@24.19.2)(yaml@2.9.1)) ../../packages/plugins/sandbox-providers/cloudflare/bridge-template: dependencies: @@ -49,11 +49,11 @@ importers: specifier: ^7.0.2 version: 7.0.2 vitest: - specifier: ^4.1.8 - version: 4.1.12(@opentelemetry/api@1.10.0)(@types/node@24.19.2)(vite@7.3.7(@types/node@24.19.2)(yaml@2.9.1)) + specifier: ^5.1.2 + version: 5.1.2(@opentelemetry/api@1.10.0)(@types/node@24.19.2)(vite@7.3.7(@types/node@24.19.2)(yaml@2.9.1)) wrangler: specifier: ^4.170.0 - version: 4.170.0(@cloudflare/workers-types@5.20261120.1)(@types/node@24.19.2)(vitest@4.1.12(@opentelemetry/api@1.10.0)(@types/node@24.19.2)(vite@7.3.7(@types/node@24.19.2)(yaml@2.9.1))) + version: 4.170.0(@cloudflare/workers-types@5.20261120.1)(@types/node@24.19.2)(vitest@5.1.2(@opentelemetry/api@1.10.0)(@types/node@24.19.2)(vite@7.3.7(@types/node@24.19.2)(yaml@2.9.1))) ../../packages/plugins/sandbox-providers/createos: dependencies: @@ -68,8 +68,8 @@ importers: specifier: ^7.0.2 version: 7.0.2 vitest: - specifier: ^4.1.8 - version: 4.1.12(@opentelemetry/api@1.10.0)(@types/node@24.19.2)(vite@7.3.7(@types/node@24.19.2)(yaml@2.9.1)) + specifier: ^5.1.2 + version: 5.1.2(@opentelemetry/api@1.10.0)(@types/node@24.19.2)(vite@7.3.7(@types/node@24.19.2)(yaml@2.9.1)) ../../packages/plugins/sandbox-providers/e2b: dependencies: @@ -84,8 +84,8 @@ importers: specifier: ^7.0.2 version: 7.0.2 vitest: - specifier: ^4.1.8 - version: 4.1.12(@opentelemetry/api@1.10.0)(@types/node@24.19.2)(vite@7.3.7(@types/node@24.19.2)(yaml@2.9.1)) + specifier: ^5.1.2 + version: 5.1.2(@opentelemetry/api@1.10.0)(@types/node@24.19.2)(vite@7.3.7(@types/node@24.19.2)(yaml@2.9.1)) ../../packages/plugins/sandbox-providers/exe-dev: devDependencies: @@ -96,8 +96,8 @@ importers: specifier: ^7.0.2 version: 7.0.2 vitest: - specifier: ^4.1.8 - version: 4.1.12(@opentelemetry/api@1.10.0)(@types/node@24.19.2)(vite@7.3.7(@types/node@24.19.2)(yaml@2.9.1)) + specifier: ^5.1.2 + version: 5.1.2(@opentelemetry/api@1.10.0)(@types/node@24.19.2)(vite@7.3.7(@types/node@24.19.2)(yaml@2.9.1)) ../../packages/plugins/sandbox-providers/kubernetes: dependencies: @@ -115,8 +115,8 @@ importers: specifier: ^7.0.2 version: 7.0.2 vitest: - specifier: ^4.1.8 - version: 4.1.12(@opentelemetry/api@1.10.0)(@types/node@24.19.2)(vite@7.3.7(@types/node@24.19.2)(yaml@2.9.1)) + specifier: ^5.1.2 + version: 5.1.2(@opentelemetry/api@1.10.0)(@types/node@24.19.2)(vite@7.3.7(@types/node@24.19.2)(yaml@2.9.1)) ../../packages/plugins/sandbox-providers/modal: dependencies: @@ -131,8 +131,8 @@ importers: specifier: ^7.0.2 version: 7.0.2 vitest: - specifier: ^4.1.8 - version: 4.1.12(@opentelemetry/api@1.10.0)(@types/node@24.19.2)(vite@7.3.7(@types/node@24.19.2)(yaml@2.9.1)) + specifier: ^5.1.2 + version: 5.1.2(@opentelemetry/api@1.10.0)(@types/node@24.19.2)(vite@7.3.7(@types/node@24.19.2)(yaml@2.9.1)) ../../packages/plugins/sandbox-providers/novita: dependencies: @@ -147,8 +147,8 @@ importers: specifier: ^7.0.2 version: 7.0.2 vitest: - specifier: ^4.1.8 - version: 4.1.12(@opentelemetry/api@1.10.0)(@types/node@24.19.2)(vite@7.3.7(@types/node@24.19.2)(yaml@2.9.1)) + specifier: ^5.1.2 + version: 5.1.2(@opentelemetry/api@1.10.0)(@types/node@24.19.2)(vite@7.3.7(@types/node@24.19.2)(yaml@2.9.1)) packages: @@ -621,6 +621,9 @@ packages: '@jridgewell/sourcemap-codec@1.6.0': resolution: {integrity: sha512-T7jf+5zgsZHwNJ4lvQ7/aezbyk0nNX+zJVWpmHA7VYsEx7a7qr5Rg5IbtJFqkgze5Y2sruq1RUY8Q837Od7iFw==} + '@jridgewell/trace-mapping@0.3.31': + resolution: {integrity: sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==} + '@jridgewell/trace-mapping@0.3.9': resolution: {integrity: sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==} @@ -819,18 +822,12 @@ packages: '@speed-highlight/core@1.2.24': resolution: {integrity: sha512-qeW2e1l78afw8VhRPfPQ1Gjj+KU5XFQ/OFV5ti6eTa9bruO7mJyZtA4vw0ofqmA3tKCkROE9xLk3VZoeRc98nw==} - '@standard-schema/spec@1.1.0': - resolution: {integrity: sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w==} - '@types/chai@5.2.3': resolution: {integrity: sha512-Mw558oeA9fFbv65/y4mHtXDs9bPnFMZAL/jxdPFUpOHHIXX91mcgEHbS5Lahr+pwZFR8A7GQleRWeI6cGFC2UA==} '@types/deep-eql@4.0.2': resolution: {integrity: sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw==} - '@types/estree@1.0.10': - resolution: {integrity: sha512-lTyOMnOcmRBzdCv6/4zUZCrEhV0xrqQiUZBZtVcbmLHBXKLnN8q89v/wKRF/Q0HbwVsqbIG3o5HDoFl9sduM+g==} - '@types/estree@1.0.11': resolution: {integrity: sha512-YBdNe5JcjYR0sPhJW1QIeRCmI11YhYvaRuGCs9+WCeTTb+Yhb2BE2XMe5/wAqF10FK5g3+q1PDhQABfT7aX0gg==} @@ -975,13 +972,10 @@ packages: cpu: [x64] os: [win32] - '@vitest/expect@4.1.12': - resolution: {integrity: sha512-vFlTt+YEu9WBpNjdGayNmlMVzrWPi1+sv853/7t2FU7hpO5gAFBKHzQmkCq5Xjpr+evegF2994LQT3hF3mRlqQ==} - - '@vitest/mocker@4.1.12': - resolution: {integrity: sha512-fKShNpKZzupWZuY0z7egydvL0sqW4INEZBEExMBMAa6izlENEVHwoXgdaTCaBZ5fwlr4xf2o1wXC83n9RpO+NA==} + '@vitest/mocker@5.1.2': + resolution: {integrity: sha512-UGc97wUIy0Ji2+9GxzHEJiOhiwkaukgE7VYcUNnjpX3sWnwQ8XogmNXX4WyOukxYgKb8Nh2XFa7KId0ZjpmVhQ==} peerDependencies: - msw: ^2.4.9 + msw: ^2.4.9 || ^3.0.0 vite: ^6.0.0 || ^7.0.0 || ^8.0.0 peerDependenciesMeta: msw: @@ -989,20 +983,8 @@ packages: vite: optional: true - '@vitest/pretty-format@4.1.12': - resolution: {integrity: sha512-XW9O8+Mxx4VpCtkYdMJLZQQwsVryP9wk7cPKDxtXFfwSak6yRh5+2fep/Y0XF/ElBvJHq8bcYdi6aeuai0opZA==} - - '@vitest/runner@4.1.12': - resolution: {integrity: sha512-NKlVKCr5QnCe8jijdMnmkpHHU+WTqiLFR6G0pHji9uRjXK9xJl1k1nTw6F3pOOj2PDcsDt2GKQMI7wIsaT491w==} - - '@vitest/snapshot@4.1.12': - resolution: {integrity: sha512-ko1y1Qgb/slzQ9mr+b89Cuqud8WG1TKtsPD8r7ZUBdvVOGt85Af2HwCqHujrhwJq95hs/9RM7fcAPg57o1vlzw==} - - '@vitest/spy@4.1.12': - resolution: {integrity: sha512-RGq9x4JNGNTZHEJxvN0oSiJjeSCExm0n2gZKKJZHY9cX5AVA6M7VJILBT3ZJ/tJ/0J9uWT7fETV9/btoi//vSg==} - - '@vitest/utils@4.1.12': - resolution: {integrity: sha512-Q3awXrwOfEV+qc3WmO5ONyE0yO7Q1gQ9/oyHxGLZ/pl7N3NO/ZztqQwKLuwMkV+CA1JYSIeO3gkHnRDIo4AVaA==} + '@vitest/spy@5.1.2': + resolution: {integrity: sha512-PQl0/3+p9GaY71+MHywN6oyHfLhVDD5kcbm7oNRldA2F0ExMU3S8RQdnpteJ9gFAdK5P6KCgE6LqCpUgy57KzA==} abort-controller-x@0.5.0: resolution: {integrity: sha512-yTt9CI0x+nRfX6BFMenEGP8ooPvErGH6AbFz20C2IeOLIlDsrw/VHpgne3GsCEuTA410IiFiaLVFKmgM4bKEPQ==} @@ -1141,9 +1123,6 @@ packages: compare-versions@6.1.1: resolution: {integrity: sha512-4hm4VPpIecmlg59CHXnRDnqGplJFrbLG4aFEl5vl6cK1u76ws3LLvX7ikFnTDl5vo39sjWD6AaDPYodJp/NNHg==} - convert-source-map@2.0.0: - resolution: {integrity: sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==} - cookie@1.1.1: resolution: {integrity: sha512-ei8Aos7ja0weRpFzJnEA9UHJ/7XQmqglbRwnf2ATjcB9Wq874VKH9kfjjirM6UhU2/E5fFYadylyhFldcqSidQ==} engines: {node: '>=18'} @@ -1344,8 +1323,8 @@ packages: resolution: {integrity: sha512-U4N8FgzmWxc8k1VH8Kr6lQg18U7Fjvby6wXHVRX/ZZ7IwWbRMgrRbP0Wrb5q5NVinryp4SQampHKdvtecItxUg==} engines: {node: 20 || >=22} - magic-string@0.30.21: - resolution: {integrity: sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==} + magic-string@1.4.5: + resolution: {integrity: sha512-oLLC2+YvQUfAa+vxoufE/yc1icb87M9iXIRqAoR/2EhE/8cb3SF/+Gi0c2By1B+5Vz2e2vQtUvHiu1+63Znh+w==} math-intrinsics@1.1.0: resolution: {integrity: sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==} @@ -1422,8 +1401,8 @@ packages: oauth4webapi@3.8.8: resolution: {integrity: sha512-8N28E+a/oxfXWBgOMt+ZP/JUf/XR+IFbvkAEPP3gznXOMv9BpAAwiIj0TFNz3tGTPc0ZQ8zmWBNgN1nAys0gng==} - obug@2.2.1: - resolution: {integrity: sha512-XrsrhT5sybtKI6wakr2SPOlGZWWYbUXZ7a0jT8/QOeAPau+1X/bSegNe5YR75oJmEZQbKningirmGOEJCIk61Q==} + obug@3.0.0: + resolution: {integrity: sha512-5vvB5+W7ePv+p3uqxi+RcW1XAzLW0/hxt3/4X4Lc4qHudzOhmBiBwOY6DRob4WnanAEGvNcLjF+KNOufrUoEQw==} engines: {node: '>=12.20.0'} once@1.4.0: @@ -1501,9 +1480,6 @@ packages: '@types/node': optional: true - siginfo@2.0.0: - resolution: {integrity: sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==} - smart-buffer@4.2.0: resolution: {integrity: sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==} engines: {node: '>= 6.0.0', npm: '>= 3.0.0'} @@ -1524,9 +1500,6 @@ packages: resolution: {integrity: sha512-pdUVfIWcK0kCgK831ibqkZDcL7I9zljjOu0TQFnA+fiQ6y1CYqYB7RkTOHHO45FGMg5P/Mvk/+4ToQ7gAYAL5Q==} engines: {node: '>=6.0.0'} - stackback@0.0.2: - resolution: {integrity: sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==} - std-env@4.3.0: resolution: {integrity: sha512-OtU/EgQ1kIm5KwqQpBC6ZEMXrZRui11w8zgfTWp8cdO9B8OaPsbA8bTHO2P+HNo1VlUTGMVBwPhydu6poeXiag==} @@ -1565,21 +1538,18 @@ packages: text-decoder@1.2.7: resolution: {integrity: sha512-vlLytXkeP4xvEq2otHeJfSQIRyWxo/oZGEbXrtEEF9Hnmrdly59sUbzZ/QgyWuLYHctCHxFF4tRQZNQ9k60ExQ==} - tinybench@2.9.0: - resolution: {integrity: sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==} + tinybench@6.2.5: + resolution: {integrity: sha512-b/8GRMdnY4cqkfCLyaFpTGIv1qwfi3oT0mWaepwT++6Z/ZrYehNfZZ2JDKVLKGhNoEkS3IIB1ELtCT0XS5DtOA==} + engines: {node: '>=20.0.0'} - tinyexec@1.3.1: - resolution: {integrity: sha512-GCvB3aoys96IuDFBMcTB46JOR6mdMtAToqwiW8JlWhsoh1mhHi/xn9ss/Dg7N555GiJyEt2qzoG/NHCwM6h1EA==} + tinyexec@1.4.0: + resolution: {integrity: sha512-PV6lIcJQh57aFeJDwx16JNHmgFRh5xguzallrDW1qe8nAghYgr5MKz2K5k7wEyV/ygZhdnIAP8+HZSarHPBCsg==} engines: {node: '>=18'} tinyglobby@0.2.17: resolution: {integrity: sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==} engines: {node: '>=12.0.0'} - tinyrainbow@3.2.0: - resolution: {integrity: sha512-LgO3D9yZJjApUiuUfl9iFAwrtaX4+lok3wJIqttGoKCHlWUqHqbQpnxCf82L8FjgKsh4iGo78hqJwgL8F6To2A==} - engines: {node: '>=14.0.0'} - tr46@0.0.3: resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==} @@ -1655,23 +1625,23 @@ packages: yaml: optional: true - vitest@4.1.12: - resolution: {integrity: sha512-5eWdz2yb3ajxWF3C8C4TjkXl7FGm3n2E/VlazALrQHzK7nYMSGFnCZto0bbPNl77AwkOZVLk0YnBAejUu0NiWA==} - engines: {node: ^20.0.0 || ^22.0.0 || >=24.0.0} + vitest@5.1.2: + resolution: {integrity: sha512-VIa2wXV208WraXUbzH+dQUrGcFpPuaiRA8HlhXS8R6/sy9cynw6OMqGj8fmAlH1hot7huTCtWUE14+FdXU3eLw==} + engines: {node: ^22.12.0 || ^24.0.0 || >=26.0.0} hasBin: true peerDependencies: '@edge-runtime/vm': '*' '@opentelemetry/api': ^1.9.0 - '@types/node': ^20.0.0 || ^22.0.0 || >=24.0.0 - '@vitest/browser-playwright': 4.1.12 - '@vitest/browser-preview': 4.1.12 - '@vitest/browser-webdriverio': ^4.1.11 - '@vitest/coverage-istanbul': 4.1.12 - '@vitest/coverage-v8': 4.1.12 - '@vitest/ui': 4.1.12 + '@types/node': ^22.0.0 || >=24.0.0 + '@vitest/browser-playwright': 5.1.2 + '@vitest/browser-preview': 5.1.2 + '@vitest/browser-webdriverio': ^5.0.0-beta.5 || >=5.0.0 + '@vitest/coverage-istanbul': 5.1.2 + '@vitest/coverage-v8': 5.1.2 + '@vitest/ui': 5.1.2 happy-dom: '*' jsdom: '*' - vite: ^6.0.0 || ^7.0.0 || ^8.0.0 + vite: ^6.4.0 || ^7.0.0 || ^8.0.0 peerDependenciesMeta: '@edge-runtime/vm': optional: true @@ -1706,9 +1676,9 @@ packages: whatwg-url@5.0.0: resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==} - why-is-node-running@2.3.0: - resolution: {integrity: sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w==} - engines: {node: '>=8'} + why-is-node-running@3.2.1: + resolution: {integrity: sha512-Tb2FUhB4vUsGQlfSquQLYkApkuPAFQXGFzxWKHHumVz2dK+X1RUm/HnID4+TfIGYJ1kTcwOaCk/buYCEJr6YjQ==} + engines: {node: '>=20.11'} hasBin: true workerd@1.20261129.1: @@ -1848,14 +1818,14 @@ snapshots: '@cloudflare/workers-types@5.20261120.1': {} - '@cloudflare/workers-utils@0.60.0(vitest@4.1.12(@opentelemetry/api@1.10.0)(@types/node@24.19.2)(vite@7.3.7(@types/node@24.19.2)(yaml@2.9.1)))': + '@cloudflare/workers-utils@0.60.0(vitest@5.1.2(@opentelemetry/api@1.10.0)(@types/node@24.19.2)(vite@7.3.7(@types/node@24.19.2)(yaml@2.9.1)))': dependencies: '@cspotcode/source-map-support': 0.8.1 chalk: 5.3.0 dotenv: 16.3.1 undici: 7.30.2 optionalDependencies: - vitest: 4.1.12(@opentelemetry/api@1.10.0)(@types/node@24.19.2)(vite@7.3.7(@types/node@24.19.2)(yaml@2.9.1)) + vitest: 5.1.2(@opentelemetry/api@1.10.0)(@types/node@24.19.2)(vite@7.3.7(@types/node@24.19.2)(yaml@2.9.1)) '@connectrpc/connect-web@2.0.0-rc.3(@bufbuild/protobuf@2.16.0)(@connectrpc/connect@2.0.0-rc.3(@bufbuild/protobuf@2.16.0))': dependencies: @@ -2092,6 +2062,11 @@ snapshots: '@jridgewell/sourcemap-codec@1.6.0': {} + '@jridgewell/trace-mapping@0.3.31': + dependencies: + '@jridgewell/resolve-uri': 3.1.3 + '@jridgewell/sourcemap-codec': 1.6.0 + '@jridgewell/trace-mapping@0.3.9': dependencies: '@jridgewell/resolve-uri': 3.1.3 @@ -2251,8 +2226,6 @@ snapshots: '@speed-highlight/core@1.2.24': {} - '@standard-schema/spec@1.1.0': {} - '@types/chai@5.2.3': dependencies: '@types/deep-eql': 4.0.2 @@ -2260,8 +2233,6 @@ snapshots: '@types/deep-eql@4.0.2': {} - '@types/estree@1.0.10': {} - '@types/estree@1.0.11': {} '@types/js-yaml@4.0.9': {} @@ -2349,46 +2320,16 @@ snapshots: '@typescript/typescript-win32-x64@7.0.2': optional: true - '@vitest/expect@4.1.12': + '@vitest/mocker@5.1.2(vite@7.3.7(@types/node@24.19.2)(yaml@2.9.1))': dependencies: - '@standard-schema/spec': 1.1.0 - '@types/chai': 5.2.3 - '@vitest/spy': 4.1.12 - '@vitest/utils': 4.1.12 - chai: 6.3.0 - tinyrainbow: 3.2.0 - - '@vitest/mocker@4.1.12(vite@7.3.7(@types/node@24.19.2)(yaml@2.9.1))': - dependencies: - '@vitest/spy': 4.1.12 + '@jridgewell/trace-mapping': 0.3.31 + '@vitest/spy': 5.1.2 estree-walker: 3.0.3 - magic-string: 0.30.21 + magic-string: 1.4.5 optionalDependencies: vite: 7.3.7(@types/node@24.19.2)(yaml@2.9.1) - '@vitest/pretty-format@4.1.12': - dependencies: - tinyrainbow: 3.2.0 - - '@vitest/runner@4.1.12': - dependencies: - '@vitest/utils': 4.1.12 - pathe: 2.0.3 - - '@vitest/snapshot@4.1.12': - dependencies: - '@vitest/pretty-format': 4.1.12 - '@vitest/utils': 4.1.12 - magic-string: 0.30.21 - pathe: 2.0.3 - - '@vitest/spy@4.1.12': {} - - '@vitest/utils@4.1.12': - dependencies: - '@vitest/pretty-format': 4.1.12 - convert-source-map: 2.0.0 - tinyrainbow: 3.2.0 + '@vitest/spy@5.1.2': {} abort-controller-x@0.5.0: {} @@ -2512,8 +2453,6 @@ snapshots: compare-versions@6.1.1: {} - convert-source-map@2.0.0: {} - cookie@1.1.1: {} debug@4.4.3: @@ -2606,7 +2545,7 @@ snapshots: estree-walker@3.0.3: dependencies: - '@types/estree': 1.0.10 + '@types/estree': 1.0.11 event-target-shim@5.0.1: {} @@ -2718,7 +2657,7 @@ snapshots: lru-cache@11.5.3: {} - magic-string@0.30.21: + magic-string@1.4.5: dependencies: '@jridgewell/sourcemap-codec': 1.6.0 @@ -2799,7 +2738,7 @@ snapshots: oauth4webapi@3.8.8: {} - obug@2.2.1: {} + obug@3.0.0: {} once@1.4.0: dependencies: @@ -2933,8 +2872,6 @@ snapshots: '@img/sharp-win32-x64': 0.35.5 '@types/node': 24.19.2 - siginfo@2.0.0: {} - smart-buffer@4.2.0: {} smol-toml@1.9.1: {} @@ -2954,8 +2891,6 @@ snapshots: source-map-js@1.3.0: {} - stackback@0.0.2: {} - std-env@4.3.0: {} stream-buffers@3.0.3: {} @@ -3025,17 +2960,15 @@ snapshots: transitivePeerDependencies: - react-native-b4a - tinybench@2.9.0: {} + tinybench@6.2.5: {} - tinyexec@1.3.1: {} + tinyexec@1.4.0: {} tinyglobby@0.2.17: dependencies: fdir: 6.5.0(picomatch@4.0.7) picomatch: 4.0.7 - tinyrainbow@3.2.0: {} - tr46@0.0.3: {} ts-error@1.0.6: {} @@ -3093,28 +3026,22 @@ snapshots: fsevents: 2.3.3 yaml: 2.9.1 - vitest@4.1.12(@opentelemetry/api@1.10.0)(@types/node@24.19.2)(vite@7.3.7(@types/node@24.19.2)(yaml@2.9.1)): + vitest@5.1.2(@opentelemetry/api@1.10.0)(@types/node@24.19.2)(vite@7.3.7(@types/node@24.19.2)(yaml@2.9.1)): dependencies: - '@vitest/expect': 4.1.12 - '@vitest/mocker': 4.1.12(vite@7.3.7(@types/node@24.19.2)(yaml@2.9.1)) - '@vitest/pretty-format': 4.1.12 - '@vitest/runner': 4.1.12 - '@vitest/snapshot': 4.1.12 - '@vitest/spy': 4.1.12 - '@vitest/utils': 4.1.12 + '@types/chai': 5.2.3 + '@vitest/mocker': 5.1.2(vite@7.3.7(@types/node@24.19.2)(yaml@2.9.1)) + chai: 6.3.0 es-module-lexer: 2.3.2 expect-type: 1.4.0 - magic-string: 0.30.21 - obug: 2.2.1 - pathe: 2.0.3 + magic-string: 1.4.5 + obug: 3.0.0 picomatch: 4.0.7 std-env: 4.3.0 - tinybench: 2.9.0 - tinyexec: 1.3.1 + tinybench: 6.2.5 + tinyexec: 1.4.0 tinyglobby: 0.2.17 - tinyrainbow: 3.2.0 vite: 7.3.7(@types/node@24.19.2)(yaml@2.9.1) - why-is-node-running: 2.3.0 + why-is-node-running: 3.2.1 optionalDependencies: '@opentelemetry/api': 1.10.0 '@types/node': 24.19.2 @@ -3130,10 +3057,7 @@ snapshots: tr46: 0.0.3 webidl-conversions: 3.0.1 - why-is-node-running@2.3.0: - dependencies: - siginfo: 2.0.0 - stackback: 0.0.2 + why-is-node-running@3.2.1: {} workerd@1.20261129.1: optionalDependencies: @@ -3143,11 +3067,11 @@ snapshots: '@cloudflare/workerd-linux-arm64': 1.20261129.1 '@cloudflare/workerd-windows-64': 1.20261129.1 - wrangler@4.170.0(@cloudflare/workers-types@5.20261120.1)(@types/node@24.19.2)(vitest@4.1.12(@opentelemetry/api@1.10.0)(@types/node@24.19.2)(vite@7.3.7(@types/node@24.19.2)(yaml@2.9.1))): + wrangler@4.170.0(@cloudflare/workers-types@5.20261120.1)(@types/node@24.19.2)(vitest@5.1.2(@opentelemetry/api@1.10.0)(@types/node@24.19.2)(vite@7.3.7(@types/node@24.19.2)(yaml@2.9.1))): dependencies: '@cloudflare/kv-asset-handler': 0.5.1 '@cloudflare/unenv-preset': 2.16.2(unenv@2.0.0-rc.24)(workerd@1.20261129.1) - '@cloudflare/workers-utils': 0.60.0(vitest@4.1.12(@opentelemetry/api@1.10.0)(@types/node@24.19.2)(vite@7.3.7(@types/node@24.19.2)(yaml@2.9.1))) + '@cloudflare/workers-utils': 0.60.0(vitest@5.1.2(@opentelemetry/api@1.10.0)(@types/node@24.19.2)(vite@7.3.7(@types/node@24.19.2)(yaml@2.9.1))) '@cspotcode/source-map-support': 0.8.1 '@types/yargs': 17.0.24 cloudflare: 5.2.0 From 054b4e1395b7f246e2c18d222b701595daf5522b Mon Sep 17 00:00:00 2001 From: Devin Foley Date: Fri, 4 Dec 2026 15:12:42 -0800 Subject: [PATCH 2/7] fix(ui): remove the Needs you description from the Inbox header (#23781) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work > - The Inbox shows the decisions that need a person, in the "Needs you" folder > - The Inbox header shows a line under the folder tabs: "Review open requests and decide what happens next." > - This line does not give new information. It adds noise to the header. > - This pull request removes that line from the "Needs you" folder only > - The benefit is a cleaner Inbox header. Waiting and History keep their helpful descriptions. ## Linked Issues or Issue Description **Is your feature request related to a problem? Please describe.** The Inbox header shows the text "Review open requests and decide what happens next." under the folder tabs. The text repeats what the "Needs you" tab already says. **Describe the solution you'd like** Remove the text from the "Needs you" folder. Do not show an empty paragraph. **Describe alternatives you've considered** Remove the descriptions of all folders. We did not do this, because the Waiting and History descriptions explain what those folders contain. ## What Changed - `CoordinatorNeedsYou.tsx`: the "Needs you" folder has no description. The description field is now optional, and the header shows the paragraph only when the folder has a description. - `CoordinatorNeedsYou.toolbar.test.tsx`: the test checks that "Needs you" shows no description and that "Waiting" still shows its description. ## Verification - `cd ui && npx vitest run src/components/coordinator/CoordinatorNeedsYou.toolbar.test.tsx` — 13/13 pass. - Red-green: with the old component, the new assertion fails (`expected 'Review open requests and decide what …' to be null`). With the fix, it passes. - `cd ui && npx tsc --noEmit -p .` reports no errors in the changed files. ## Risks - Low risk. This is a text-only UI change in one component. ## Model Used - Claude Opus 5.5 (`claude-opus-5-5`), via Claude Code with tool use and code execution. ## 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: devinfoley <139239+devinfoley@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 --- .../coordinator/CoordinatorNeedsYou.toolbar.test.tsx | 3 +++ ui/src/components/coordinator/CoordinatorNeedsYou.tsx | 8 ++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/ui/src/components/coordinator/CoordinatorNeedsYou.toolbar.test.tsx b/ui/src/components/coordinator/CoordinatorNeedsYou.toolbar.test.tsx index 2a210747810..f26886054ca 100644 --- a/ui/src/components/coordinator/CoordinatorNeedsYou.toolbar.test.tsx +++ b/ui/src/components/coordinator/CoordinatorNeedsYou.toolbar.test.tsx @@ -361,12 +361,15 @@ describe("Needs You keeps its toolbar between visits", () => { await vi.waitFor(() => expect(assignee().value).toBe("me")); await choose("Filter decisions by assignee", "Dotta"); await vi.waitFor(() => expect(cards()).toEqual(["dottas"])); + const folderDescription = () => container.querySelector("[data-inbox-folders] p")?.textContent ?? null; + expect(folderDescription()).toBeNull(); await choose("Filter decisions by agent", "Chief of Staff"); await choose("Filter decisions by project", "Website"); const waitingTab = [...container.querySelectorAll('[aria-label="Inbox views"] button')].find((button) => button.textContent?.startsWith("Waiting"))!; await act(async () => waitingTab.click()); await flush(); await vi.waitFor(() => expect(cards()).toEqual(["waiting-1"])); + expect(folderDescription()).toContain("snoozed"); const needsTab = [...container.querySelectorAll('[aria-label="Inbox views"] button')].find((button) => button.textContent === "Needs you")!; await act(async () => needsTab.click()); await flush(); diff --git a/ui/src/components/coordinator/CoordinatorNeedsYou.tsx b/ui/src/components/coordinator/CoordinatorNeedsYou.tsx index d95ea82fabf..3264fa2249c 100644 --- a/ui/src/components/coordinator/CoordinatorNeedsYou.tsx +++ b/ui/src/components/coordinator/CoordinatorNeedsYou.tsx @@ -50,11 +50,11 @@ import { CoordinatorNeedsYouSidePanel, needsYouReviewTab, needsYouReviewTabId, n import { ANALYTICS_MASK_CLASS } from "@/lib/analytics/privacy"; import { cn } from "@/lib/utils"; -const inboxFolders = [ - { value: "needs", label: "Needs you", description: "Review open requests and decide what happens next." }, +const inboxFolders: ReadonlyArray<{ value: "needs" | "waiting" | "history"; label: string; description?: string }> = [ + { value: "needs", label: "Needs you" }, { value: "waiting", label: "Waiting", description: "See what you’ve snoozed and which tasks are waiting for an automatic retry." }, { value: "history", label: "History", description: "Look back at past decisions and see what happened to failed runs." }, -] as const; +]; /** Rule 7: a card that cannot answer inline links to the exact control, named by its verb. */ function openLabel(item: AttentionItem) { @@ -437,7 +437,7 @@ export function CoordinatorNeedsYou() { return ; })} - {activeFolder &&

{activeFolder.description}

} + {activeFolder?.description &&

{activeFolder.description}

} ; const receipts = feed.data?.receipts ?? []; if (historyOpen) return
From 4ba596d2682d814e924c4fd327663569dafd5e21 Mon Sep 17 00:00:00 2001 From: Dotta <34892728+cryppadotta@users.noreply.github.com> Date: Fri, 4 Dec 2026 17:25:17 -0600 Subject: [PATCH 3/7] fix(slack): recognize pre-pool Cloud stacks in managed Slack setup (#23783) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work. > - The Slack chat connector supports managed one-click setup on Paperclip Cloud instances when `PAPERCLIP_SLACK_MANAGED_SETUP_ENABLED=true` is set. > - `createSlackManagerGrants` checked only `getCloudRuntimeIdentity()` to detect a Cloud instance. > - Pre-pool Cloud stacks have `isCloudManagedInstance() === true` (the canonical Cloud predicate used by `/api/health`) but do not have a persisted warm-pool runtime identity, so `getCloudRuntimeIdentity()` returns `null`. > - As a result, `/api/companies/:companyId/chat-slack/setup-options` returned `defaultMethod: "automatic"` and `managedAvailable: false` on those stacks, hiding managed Slack setup. > - This pull request checks `Boolean(getCloudRuntimeIdentity()) || isCloudManagedInstance()` in `manager-grants.ts` and adds unit tests for pre-pool Cloud stacks, self-hosted instances, and disabled flags. > - The benefit is that managed Slack setup works consistently across all Paperclip Cloud stacks while self-hosted instances remain completely excluded. ## Linked Issues or Issue Description **What happened?** On a Paperclip Cloud stack without a warm-pool runtime identity record, `GET /api/companies/:companyId/chat-slack/setup-options` returns `{"defaultMethod":"automatic","managedAvailable":false,"workspaces":[]}` even when `enableChatConnectors` is enabled, `PAPERCLIP_SLACK_MANAGED_SETUP_ENABLED=true` is set, and the Cloud Connector Broker advertises `slack.manager`. **Expected behavior** Any Paperclip Cloud stack where `isCloudManagedInstance()` is `true`, `PAPERCLIP_SLACK_MANAGED_SETUP_ENABLED=true`, and Cloud Connector Broker credentials are present should select `defaultMethod: "managed"` and query the broker for `slack.manager` availability. Self-hosted instances must continue to stay on `defaultMethod: "automatic"`. **Steps to reproduce** 1. Run a Paperclip Cloud stack that sets `PAPERCLIP_CLOUD_TENANT_SERVER_TOKEN` (or `PAPERCLIP_MANAGED_CONFIG`) without a persisted warm-pool `cloud-runtime-identity/v1` row. 2. Enable `enableChatConnectors` and set `PAPERCLIP_SLACK_MANAGED_SETUP_ENABLED=true` with valid `PAPERCLIP_CLOUD_CONNECTOR_*` credentials. 3. Call `GET /api/companies/:companyId/chat-slack/setup-options`. Observe `defaultMethod: "automatic"` and `managedAvailable: false`. **Paperclip version or commit** `306437a2a5` (and `7e025ae65f`) ## What Changed - Updated `server/src/services/connectors/slack/setup/manager-grants.ts` to compute `const isCloud = Boolean(getCloudRuntimeIdentity()) || isCloudManagedInstance();` instead of relying only on `getCloudRuntimeIdentity()`. - Added `server/src/services/connectors/slack/setup/manager-grants.test.ts` verifying that: - Pre-pool Cloud stacks (`isCloudManagedInstance()` true, no runtime identity) select `defaultMethod() === "managed"` when `PAPERCLIP_SLACK_MANAGED_SETUP_ENABLED=true`. - Self-hosted instances stay on `"automatic"` even if `PAPERCLIP_SLACK_MANAGED_SETUP_ENABLED=true` is set. - Cloud stacks stay on `"automatic"` when `PAPERCLIP_SLACK_MANAGED_SETUP_ENABLED` is not `"true"`. ## Verification - `pnpm --filter @paperclipai/server exec vitest run src/services/connectors/slack/setup/manager-grants.test.ts src/__tests__/slack-development-manager.test.ts` — 11/11 passed. - `pnpm --filter @paperclipai/server typecheck` — passed with 0 errors. ## Risks - Low risk: `isCloudManagedInstance()` is already the canonical Cloud predicate across the server (including `/api/health`). Self-hosted instances never set `PAPERCLIP_CLOUD_TENANT_SERVER_TOKEN` or `PAPERCLIP_MANAGED_CONFIG`, and managed Slack setup still requires `PAPERCLIP_SLACK_MANAGED_SETUP_ENABLED=true` plus valid `PAPERCLIP_CLOUD_CONNECTOR_*` credentials and an active broker `slack.manager` profile. ## Model Used - Google Gemini (Antigravity agent with tool use and code execution) ## 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 --- .../slack/setup/manager-grants.test.ts | 100 ++++++++++++++++++ .../connectors/slack/setup/manager-grants.ts | 6 +- 2 files changed, 104 insertions(+), 2 deletions(-) create mode 100644 server/src/services/connectors/slack/setup/manager-grants.test.ts diff --git a/server/src/services/connectors/slack/setup/manager-grants.test.ts b/server/src/services/connectors/slack/setup/manager-grants.test.ts new file mode 100644 index 00000000000..36edbdf450c --- /dev/null +++ b/server/src/services/connectors/slack/setup/manager-grants.test.ts @@ -0,0 +1,100 @@ +import { generateKeyPairSync } from "node:crypto"; +import { afterEach, describe, expect, it } from "vitest"; +import { createSlackManagerGrants } from "./manager-grants.js"; +import type { SlackRegistrationStore } from "./registration.js"; + +const ENV_KEYS = [ + "PAPERCLIP_CLOUD_TENANT_SERVER_TOKEN", + "PAPERCLIP_MANAGED_CONFIG", + "PAPERCLIP_SLACK_MANAGED_SETUP_ENABLED", + "PAPERCLIP_CLOUD_CONNECTOR_BASE_URL", + "PAPERCLIP_CLOUD_CONNECTOR_ENVIRONMENT", + "PAPERCLIP_CLOUD_CONNECTOR_INSTANCE_ID", + "PAPERCLIP_CLOUD_CONNECTOR_SIGN_PRIVATE_KEY", + "PAPERCLIP_CLOUD_CONNECTOR_SEAL_PRIVATE_KEY", +] as const; + +const savedEnv: Partial> = {}; + +function setEnv(values: Partial>) { + for (const key of ENV_KEYS) { + if (!(key in savedEnv)) savedEnv[key] = process.env[key]; + const next = values[key]; + if (next === undefined) delete process.env[key]; + else process.env[key] = next; + } +} + +function rawPrivateKey(type: "ed25519" | "x25519") { + const { privateKey } = type === "ed25519" ? generateKeyPairSync("ed25519") : generateKeyPairSync("x25519"); + return Buffer.from(privateKey.export({ format: "jwk" }).d as string, "base64url").toString("base64url"); +} + +function minimalStore(): SlackRegistrationStore { + return { + db: {} as SlackRegistrationStore["db"], + options: { + publicOrigin: () => "https://paperclip.paperclip.app", + webhookOrigin: () => "https://paperclip.paperclip.app", + withLock: async (_id: string, fn: (lease: { assertOwned: () => Promise }) => Promise) => fn({ assertOwned: async () => {} }), + }, + endpoint: async () => { throw new Error("unused"); }, + origin: (value: string) => new URL(value).origin, + api: async () => { throw new Error("unused"); }, + } as unknown as SlackRegistrationStore; +} + +afterEach(() => { + for (const key of ENV_KEYS) { + if (key in savedEnv) { + if (savedEnv[key] === undefined) delete process.env[key]; + else process.env[key] = savedEnv[key]; + delete savedEnv[key]; + } + } +}); + +describe("createSlackManagerGrants defaultMethod on Cloud vs self-hosted", () => { + it("selects managed setup on pre-pool Cloud stacks where isCloudManagedInstance is true without runtime identity", () => { + setEnv({ + PAPERCLIP_CLOUD_TENANT_SERVER_TOKEN: "tenant-token-fixture", + PAPERCLIP_SLACK_MANAGED_SETUP_ENABLED: "true", + PAPERCLIP_CLOUD_CONNECTOR_BASE_URL: "https://my.paperclip.app", + PAPERCLIP_CLOUD_CONNECTOR_ENVIRONMENT: "production", + PAPERCLIP_CLOUD_CONNECTOR_INSTANCE_ID: "stack-paperclip", + PAPERCLIP_CLOUD_CONNECTOR_SIGN_PRIVATE_KEY: rawPrivateKey("ed25519"), + PAPERCLIP_CLOUD_CONNECTOR_SEAL_PRIVATE_KEY: rawPrivateKey("x25519"), + }); + const grants = createSlackManagerGrants(minimalStore()); + expect(grants.defaultMethod()).toBe("managed"); + }); + + it("stays automatic on self-hosted instances even when managed env flag is set", () => { + setEnv({ + PAPERCLIP_CLOUD_TENANT_SERVER_TOKEN: undefined, + PAPERCLIP_MANAGED_CONFIG: undefined, + PAPERCLIP_SLACK_MANAGED_SETUP_ENABLED: "true", + PAPERCLIP_CLOUD_CONNECTOR_BASE_URL: "https://my.paperclip.app", + PAPERCLIP_CLOUD_CONNECTOR_ENVIRONMENT: "production", + PAPERCLIP_CLOUD_CONNECTOR_INSTANCE_ID: "self-hosted-1", + PAPERCLIP_CLOUD_CONNECTOR_SIGN_PRIVATE_KEY: rawPrivateKey("ed25519"), + PAPERCLIP_CLOUD_CONNECTOR_SEAL_PRIVATE_KEY: rawPrivateKey("x25519"), + }); + const grants = createSlackManagerGrants(minimalStore()); + expect(grants.defaultMethod()).toBe("automatic"); + }); + + it("stays automatic on Cloud stacks when PAPERCLIP_SLACK_MANAGED_SETUP_ENABLED is not true", () => { + setEnv({ + PAPERCLIP_CLOUD_TENANT_SERVER_TOKEN: "tenant-token-fixture", + PAPERCLIP_SLACK_MANAGED_SETUP_ENABLED: "false", + PAPERCLIP_CLOUD_CONNECTOR_BASE_URL: "https://my.paperclip.app", + PAPERCLIP_CLOUD_CONNECTOR_ENVIRONMENT: "production", + PAPERCLIP_CLOUD_CONNECTOR_INSTANCE_ID: "stack-paperclip", + PAPERCLIP_CLOUD_CONNECTOR_SIGN_PRIVATE_KEY: rawPrivateKey("ed25519"), + PAPERCLIP_CLOUD_CONNECTOR_SEAL_PRIVATE_KEY: rawPrivateKey("x25519"), + }); + const grants = createSlackManagerGrants(minimalStore()); + expect(grants.defaultMethod()).toBe("automatic"); + }); +}); diff --git a/server/src/services/connectors/slack/setup/manager-grants.ts b/server/src/services/connectors/slack/setup/manager-grants.ts index 3d902d9928e..030ad4ce155 100644 --- a/server/src/services/connectors/slack/setup/manager-grants.ts +++ b/server/src/services/connectors/slack/setup/manager-grants.ts @@ -3,6 +3,7 @@ import { and, eq, gt, like, sql } from "drizzle-orm"; import { chatEndpoints, chatSlackManagerGrants, chatSlackRegistrations, companySecrets, toolOauthStates } from "@paperclipai/db"; import { SLACK_MANAGER_SCOPES, type SlackSetupOptions as SetupChoices } from "@paperclipai/shared"; import { conflict, forbidden } from "../../../../errors.js"; +import { isCloudManagedInstance } from "../../../cloud-instance.js"; import { getCloudRuntimeIdentity } from "../../../cloud-runtime-identity.js"; import { createPaperclipCloudConnector, paperclipCloudConnectorConfigFromEnv, type SealedConnectorCredentials } from "../../../paperclip-cloud-connector.js"; import { instanceSettingsService } from "../../../instance-settings.js"; @@ -19,12 +20,13 @@ export function createSlackManagerGrants(store: SlackRegistrationStore) { type Database = Parameters[0]; function broker(): SlackManagerClient | null { if (options.managed) return options.managed.enabled ? options.managed.broker : null; - if (!getCloudRuntimeIdentity()) { + const isCloud = Boolean(getCloudRuntimeIdentity()) || isCloudManagedInstance(); + if (!isCloud) { const development = developmentSlackManager(() => origin(options.publicOrigin())); if (development) return development; } // Open-source instances never contact a hosted service to discover this path. - if (!getCloudRuntimeIdentity() || process.env.PAPERCLIP_SLACK_MANAGED_SETUP_ENABLED !== "true") return null; + if (!isCloud || process.env.PAPERCLIP_SLACK_MANAGED_SETUP_ENABLED !== "true") return null; const config = paperclipCloudConnectorConfigFromEnv(); return config ? createPaperclipCloudConnector({ config }) : null; } From 14f23fef03289ca7b66b7545ac6ce8a9c74c6332 Mon Sep 17 00:00:00 2001 From: Dotta <34892728+cryppadotta@users.noreply.github.com> Date: Fri, 4 Dec 2026 17:26:31 -0600 Subject: [PATCH 4/7] fix(plugins): offer direct Buffer setup when Composio has no sign-in link (#23782) ## Thinking Path > - Paperclip helps people manage AI agents for work. > - Plugins lets people connect tools to their agents. > - Some tool connections use the Composio gateway. > - Buffer requires a custom OAuth app in the Composio project that serves the session. > - When that gateway returns no sign-in link, Plugins can help the user open Buffer's own MCP setup. > - This pull request opens the existing connection form with the Buffer name and endpoint filled in. ## Linked Issues or Issue Description **What happened?** Plugins showed a generic error when Composio returned no Buffer sign-in link. **Expected behavior** The user can open the direct Buffer setup from the error. For other apps, the user can open Composio's app settings. **Steps to reproduce** In Plugins, select Buffer and choose a saved Composio gateway without a configured Buffer OAuth app. Select Continue. **Additional context** [Buffer's MCP setup](https://developers.buffer.com/guides/integrations/other-ai-tools.html) accepts a Buffer API key. [Composio's Buffer setup](https://composio.dev/toolkits/buffer) requires a custom OAuth app. [Composio auth configs belong to one project](https://docs.composio.dev/kb/guide/dashboard-auth-configs-navigation). Related prior work: Refs #19408. ## What Changed - Return a machine-readable code when Composio returns no sign-in link. - Offer the direct Buffer MCP form with its official address. Offer a link to Composio app settings for other toolkits. - Clear the old sign-in link when the user requests a new one. Keep the link if the completion check fails. - Document the setup options. Refresh the shared SDK test input pins. ## Verification - Reproduced the missing-link API response with an embedded database and a Composio response fixture. The new test failed on the old server. - Passed 13 focused tests across the Composio route, Plugins setup dialog, and the MCP URL prefill flow. The replacement-link test reproduced the stale link before the fix. A second test checks that the sign-in link stays available after a failed completion check. - Sent an unauthenticated MCP initialize request to Buffer's documented endpoint and confirmed that it requires authentication. A real Buffer consent or API-key test needs a Buffer account with access. ## Risks - Low risk. The new action opens the existing MCP setup page. The user chooses the credentials and access before Paperclip creates the connection. - A valid Composio sign-in link still takes the user through Composio. ## Model Used - OpenAI GPT-6 (Codex), with repository, test, and GitHub tools. ## 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 described the issue in-PR following the relevant issue template - [x] I have not referenced internal/instance-local Paperclip issues or links - [x] My branch name describes the change - [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 - [ ] I will address all Greptile and reviewer comments before requesting merge --------- Co-authored-by: Paperclip --- .../tracks/local-and-aggregators.md | 1 + packages/shared/src/composio-app-setup.ts | 2 + packages/shared/src/index.ts | 2 +- .../composio-add-account-link.test.ts | 18 +++ .../catalog/aggregator-accounts.ts | 8 +- .../runner-e2e/source-sdk-public-inputs.json | 4 +- ui/src/pages/apps/ComposioAppSetup.test.tsx | 105 ++++++++++++++++++ ui/src/pages/apps/ComposioAppSetup.tsx | 23 +++- 8 files changed, 153 insertions(+), 10 deletions(-) create mode 100644 ui/src/pages/apps/ComposioAppSetup.test.tsx diff --git a/doc/connections/tracks/local-and-aggregators.md b/doc/connections/tracks/local-and-aggregators.md index 7e4958b0f22..21dc9932e4d 100644 --- a/doc/connections/tracks/local-and-aggregators.md +++ b/doc/connections/tracks/local-and-aggregators.md @@ -32,5 +32,6 @@ Paperclip combines native `AppDefinition` entries with public aggregator snapsho - **Observations are not grants:** `tool_connection_app_snapshots` and `tool_connection_app_syncs` store read-only account observations scoped to `(company, gateway, viewing human, effective credential version)` via `/api/tool-connections/:connectionId/aggregator/apps` (`/sync`, `/refresh`). They are never executable connections or authorization grants. - **Explicit human choice for fallback:** `connections_search` owns next-step instructions. Falling back to an external aggregator requires an explicit `ask_user_questions` answer (`providerQuestion`) persisted and validated via `selectionInteractionId` in `connection_request`. A decline stays effective across continuations. - **Direct Composio app setup vs. Arcade task draft:** Composio calls `COMPOSIO_MANAGE_CONNECTIONS` directly from the board (no task created, hosted auth link not persisted in audit/results; management console at `https://dashboard.composio.dev/~/org/connect/apps`). Arcade opens a task draft (`navigateOnCreate`) so the assigned agent verifies tools and requests human authorization via `connection_request` with frozen `toolNames`. +- If Composio cannot return a sign-in link for Buffer, Plugins offers direct setup with Buffer's MCP server. Use a Buffer API key from **Settings → API** and select **Key or token** in Paperclip. To connect through Composio, configure a custom Buffer OAuth app in a Composio Platform project and use a session from that project. [Buffer MCP setup](https://developers.buffer.com/guides/integrations/other-ai-tools.html) · [Composio's Buffer requirements](https://composio.dev/toolkits/buffer) · [Composio Platform auth configs](https://docs.composio.dev/kb/guide/dashboard-auth-configs-navigation) - **Managed inventory bounds:** Arcade discovery paginates its admin account list using a separate user-owned project key (never substituting an OAuth gateway token). Executor reads its MCP integration inventory or fixed read-only `connections.list`/`integrations.list` calls — never arbitrary generated code. - **Acceptance fixtures:** `server/src/__tests__/aggregator-app-discovery.test.ts`, `server/src/__tests__/aggregator-app-sync.test.ts`, `ui/src/pages/apps/Browse.test.tsx`, `tests/aggregator-accounts/test-drive.ts`. diff --git a/packages/shared/src/composio-app-setup.ts b/packages/shared/src/composio-app-setup.ts index 75f544f5647..dfefc5aded0 100644 --- a/packages/shared/src/composio-app-setup.ts +++ b/packages/shared/src/composio-app-setup.ts @@ -1,5 +1,7 @@ import { z } from "zod"; +export const COMPOSIO_SIGN_IN_LINK_MISSING = "composio_sign_in_link_missing"; + export const composioAppSetupSchema = z.discriminatedUnion("action", [ z.object({ action: z.literal("start") }).strict(), z.object({ action: z.literal("status") }).strict(), diff --git a/packages/shared/src/index.ts b/packages/shared/src/index.ts index 076c2aba16f..12c7f22a6b3 100644 --- a/packages/shared/src/index.ts +++ b/packages/shared/src/index.ts @@ -10,7 +10,7 @@ export * from "./responsibility-dashboard.js"; export * from "./responsibility-metrics.js"; export * from "./responsibility-runs.js"; export * from "./responsibility-status-reports.js"; -export { composioAppSetupSchema, composioAppsRefreshSchema, composioAppsSyncSchema, composioAppAccountSchema, type ComposioAppSetupInput, type ComposioAppSetupResult, type ComposioAppAccountInput, type ComposioAppAccount, type ComposioAppSnapshot, type ComposioAppSyncState, type ComposioAppsResponse } from "./composio-app-setup.js"; +export { COMPOSIO_SIGN_IN_LINK_MISSING, composioAppSetupSchema, composioAppsRefreshSchema, composioAppsSyncSchema, composioAppAccountSchema, type ComposioAppSetupInput, type ComposioAppSetupResult, type ComposioAppAccountInput, type ComposioAppAccount, type ComposioAppSnapshot, type ComposioAppSyncState, type ComposioAppsResponse } from "./composio-app-setup.js"; export { agentAdapterTypeSchema, optionalAgentAdapterTypeSchema } from "./adapter-type.js"; export { RUNNER_GOAL_MAX_OBJECTIVE_CHARS, diff --git a/server/src/__tests__/composio-add-account-link.test.ts b/server/src/__tests__/composio-add-account-link.test.ts index 303f8c32a83..6335ec3af81 100644 --- a/server/src/__tests__/composio-add-account-link.test.ts +++ b/server/src/__tests__/composio-add-account-link.test.ts @@ -225,6 +225,24 @@ const support = await getEmbeddedPostgresTestSupport(); expect((await f.access.getEffectiveProfilesForAgent(f.company.id, f.agent.id)).allowedTools).toEqual([]); }); + it("identifies a missing Buffer sign-in link in the Plugins setup flow", async () => { + const f = await setupComposioRouteFixture((id) => Response.json({ + jsonrpc: "2.0", + id, + result: { + structuredContent: { data: { results: { buffer: { toolkit: "buffer", accounts: [] } } } }, + }, + })); + + const response = await request(f.app) + .post(`/api/tool-connections/${f.connection.id}/composio/apps/buffer/setup`) + .send({ action: "start" }); + + expect(response.status).toBe(422); + expect(response.body.details).toEqual({ code: "composio_sign_in_link_missing" }); + expect(f.operations).toEqual([{ name: "buffer", action: "list" }, { name: "buffer", action: "add" }]); + }); + it("returns 422 and failed telemetry when Composio returns no trusted link or reports a provider error", async () => { const missingLink = await setupComposioRouteFixture((id) => Response.json({ diff --git a/server/src/services/tool-access/catalog/aggregator-accounts.ts b/server/src/services/tool-access/catalog/aggregator-accounts.ts index 732591d122b..d802c041463 100644 --- a/server/src/services/tool-access/catalog/aggregator-accounts.ts +++ b/server/src/services/tool-access/catalog/aggregator-accounts.ts @@ -6,7 +6,7 @@ import { AGGREGATOR_NAMES, isAppAggregator, type AggregatorAppsResponse, type Ar import { resolveAggregatorApp, type AppCatalogAggregator } from "@paperclipai/shared/aggregator-app-catalog"; import { AggregatorDiscoveryUnavailableError, discoverArcadeApps, discoverExecutorApps, type DiscoveredApp } from "../../aggregator-app-discovery.js"; import { COMPOSIO_APP_TOOLKITS, findComposioCatalogApp } from "@paperclipai/shared/aggregator-app-catalog"; -import type { ComposioAppAccount, ComposioAppAccountInput, ComposioAppSetupInput, ComposioAppSetupResult, ComposioAppSnapshot, ComposioAppsResponse } from "@paperclipai/shared"; +import { COMPOSIO_SIGN_IN_LINK_MISSING, type ComposioAppAccount, type ComposioAppAccountInput, type ComposioAppSetupInput, type ComposioAppSetupResult, type ComposioAppSnapshot, type ComposioAppsResponse } from "@paperclipai/shared"; import { composioAddAccountLink, composioAppAccounts, composioAppSetupResult } from "../../composio-app-setup.js"; import { createHash, randomUUID } from "node:crypto"; import { and, asc, desc, eq, inArray, isNull, lt, lte, ne, or, sql } from "drizzle-orm"; @@ -454,7 +454,11 @@ export function createAggregatorAccounts(db: Db, { options, secrets, audit, cred result = composioAppSetupResult(await opened.manage([{ name: toolkit, action: "list" }]), toolkit); if (input.action === "start" && result.status !== "connected") { result = composioAppSetupResult(await opened.manage([{ name: toolkit, action: "add" }]), toolkit); - if (result.status === "not_connected") throw unprocessable("Composio did not return a sign-in link for this app. Manage it in Composio to check its setup requirements."); + if (result.status === "not_connected") { + throw unprocessable("Composio did not return a sign-in link for this app. Manage it in Composio to check its setup requirements.", { + code: COMPOSIO_SIGN_IN_LINK_MISSING, + }); + } } } catch (error) { requested("failed"); diff --git a/tests/runner-e2e/source-sdk-public-inputs.json b/tests/runner-e2e/source-sdk-public-inputs.json index 5868503f5ec..af82e40c0b1 100644 --- a/tests/runner-e2e/source-sdk-public-inputs.json +++ b/tests/runner-e2e/source-sdk-public-inputs.json @@ -221,7 +221,7 @@ "packages/shared/src/cloud-inference.ts": "e91bb2e8d732a9935bbfc36a693de4b910184937", "packages/shared/src/company-import-transfer.test.ts": "213169db79a3f4b6788f4107d6a7b49cd0beb6b9", "packages/shared/src/company-import-transfer.ts": "376482a8c28feba53b1e4973db0ba2e158b65b41", - "packages/shared/src/composio-app-setup.ts": "75f544f5647f227214b8a9d0f61d0196bcbbab55", + "packages/shared/src/composio-app-setup.ts": "dfefc5aded0e4a437d929c355e6ce968f4d10004", "packages/shared/src/composio-search-catalog.json": "483d391b1dbd68f46848dffa83f2e735375835c1", "packages/shared/src/config-schema.test.ts": "5810f2c152e612326bc377aa47f23f623b206ec8", "packages/shared/src/config-schema.ts": "f9c8d41cb09fbc51c3e7a038089b54376cc9150c", @@ -290,7 +290,7 @@ "packages/shared/src/home-paths.ts": "fa4f1c440653b76b3dbb7a51026d557287deb45d", "packages/shared/src/humanize-connection.test.ts": "ba9e90a44c63452b0bf9f733adb90241921e8eca", "packages/shared/src/humanize-connection.ts": "fbd414476a0ef7106a7c80d8572208781b091699", - "packages/shared/src/index.ts": "076c2aba16fcb05907198379862d8bbe47825778", + "packages/shared/src/index.ts": "12c7f22a6b31768d27ebe225f5f1ff4f2b89ec91", "packages/shared/src/issue-activity-identity.test.ts": "3dc294640f54c2be67943e3e0149cf4eff2c95ca", "packages/shared/src/issue-activity-identity.ts": "1b0f07ec3fe0506aaaf80a4fa9893f3baf8f0075", "packages/shared/src/issue-attribution.test.ts": "84563685e7f3c48029243cf1cc24a3a09ee3cde9", diff --git a/ui/src/pages/apps/ComposioAppSetup.test.tsx b/ui/src/pages/apps/ComposioAppSetup.test.tsx new file mode 100644 index 00000000000..bdf3f13b62c --- /dev/null +++ b/ui/src/pages/apps/ComposioAppSetup.test.tsx @@ -0,0 +1,105 @@ +// @vitest-environment jsdom +import { act } from "react"; +import { createRoot } from "react-dom/client"; +import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; +import { COMPOSIO_SIGN_IN_LINK_MISSING, type ToolConnection } from "@paperclipai/shared"; +import { describe, expect, it, vi } from "vitest"; +import { ComposioAppSetup } from "./ComposioAppSetup"; + +const { setup } = vi.hoisted(() => ({ setup: vi.fn() })); +vi.mock("@/api/tools", () => ({ toolsApi: { setupComposioApp: setup } })); +vi.mock("@/api/companies-query", () => ({ useAccountIdentity: () => ({ userId: "user", settled: true }) })); +vi.mock("@/context/ToastContext", () => ({ useToast: () => ({ pushToast: vi.fn() }) })); +vi.mock("@/lib/router", () => ({ + Link: ({ to, children }: { to: string; children: React.ReactNode }) => {children}, +})); + +async function clickButton(container: HTMLElement, label: string) { + const button = [...container.querySelectorAll("button")].find(button => button.textContent === label); + if (!button) throw new Error(`Could not find the "${label}" button`); + await act(async () => button.click()); +} + +async function submit(toolkit: string, inspect: (container: HTMLElement) => void | Promise) { + const container = document.createElement("div"); + const root = createRoot(container); + const queries = new QueryClient(); + try { + await act(async () => root.render( + + + , + )); + await clickButton(container, "Continue"); + expect(setup).toHaveBeenLastCalledWith("saved", toolkit, { action: "start" }); + await inspect(container); + } finally { + act(() => root.unmount()); + queries.clear(); + } +} + +describe("Composio app setup recovery", () => { + const missingLink = { + status: 422, + body: { error: "Composio did not return a sign-in link for this app.", details: { code: COMPOSIO_SIGN_IN_LINK_MISSING } }, + }; + + it("opens the existing MCP setup with Buffer's official endpoint when Composio has no link", async () => { + setup.mockRejectedValueOnce(missingLink); + await submit("buffer", container => { + expect(container.querySelector('[role="alert"]')?.textContent).toContain("custom OAuth app"); + const link = new URL(container.querySelector("a")!.href); + expect(link.pathname).toBe("/apps/byo"); + expect(link.searchParams.get("name")).toBe("Buffer"); + expect(link.searchParams.get("link")).toBe("https://mcp.buffer.com/mcp"); + }); + }); + + it("keeps a valid Buffer sign-in link in the Composio flow", async () => { + const authorizationUrl = "https://connect.composio.dev/link/buffer-example"; + setup.mockResolvedValueOnce({ status: "authorization_required", authorizationUrl }); + await submit("buffer", container => { + expect(container.querySelector('[role="alert"]')).toBeNull(); + expect(container.querySelector("a")?.href).toBe(authorizationUrl); + }); + }); + + it("removes the previous sign-in link when Composio cannot issue a replacement", async () => { + const authorizationUrl = "https://connect.composio.dev/link/old-buffer"; + setup.mockResolvedValueOnce({ status: "authorization_required", authorizationUrl }) + .mockRejectedValueOnce(missingLink); + await submit("buffer", async container => { + expect(container.querySelector("a")?.href).toBe(authorizationUrl); + await clickButton(container, "Get a new link"); + expect(setup).toHaveBeenLastCalledWith("saved", "buffer", { action: "start" }); + expect(container.querySelector('[role="status"]')).toBeNull(); + expect([...container.querySelectorAll("a")].map(link => link.textContent)) + .toEqual(["Connect directly to Buffer"]); + expect([...container.querySelectorAll("button")].map(button => button.textContent)).toContain("Continue"); + }); + }); + + it("keeps the current sign-in link when the completion check fails", async () => { + const authorizationUrl = "https://connect.composio.dev/link/buffer-example"; + setup.mockResolvedValueOnce({ status: "authorization_required", authorizationUrl }) + .mockRejectedValueOnce({ + status: 409, + body: { error: "Finish connecting this app in Composio, then check again" }, + }); + await submit("buffer", async container => { + await clickButton(container, "I’ve connected it"); + expect(setup).toHaveBeenLastCalledWith("saved", "buffer", { action: "complete" }); + expect(container.querySelector('[role="alert"]')).not.toBeNull(); + expect(container.querySelector("a")?.href).toBe(authorizationUrl); + }); + }); + + it("links to Composio management for other apps when there is no sign-in link", async () => { + setup.mockRejectedValueOnce(missingLink); + await submit("gmail", container => { + expect(container.querySelector("a")?.href).toBe("https://dashboard.composio.dev/~/org/connect/apps"); + }); + }); +}); diff --git a/ui/src/pages/apps/ComposioAppSetup.tsx b/ui/src/pages/apps/ComposioAppSetup.tsx index d9ea4d7b50e..5ea8c8b28f8 100644 --- a/ui/src/pages/apps/ComposioAppSetup.tsx +++ b/ui/src/pages/apps/ComposioAppSetup.tsx @@ -1,14 +1,16 @@ import { useState } from "react"; import { useQueryClient } from "@tanstack/react-query"; import { ExternalLink } from "lucide-react"; -import type { ComposioAppSetupInput, ComposioAppSetupResult, ToolConnection } from "@paperclipai/shared"; +import { COMPOSIO_SIGN_IN_LINK_MISSING, type ComposioAppSetupInput, type ComposioAppSetupResult, type ToolConnection } from "@paperclipai/shared"; import { toolsApi } from "@/api/tools"; import { useAccountIdentity } from "@/api/companies-query"; import { queryKeys } from "@/lib/queryKeys"; import { Button } from "@/components/ui/button"; import { Label } from "@/components/ui/label"; import { useToast } from "@/context/ToastContext"; -import { describeError } from "@/api/errors"; +import { describeError, errorCodes } from "@/api/errors"; +import { COMPOSIO_APP_MANAGEMENT_URL } from "@/lib/aggregator-app-setup"; +import { Link } from "@/lib/router"; import { cn } from "@/lib/utils"; import { ANALYTICS_MASK_CLASS } from "@/lib/analytics/privacy"; @@ -24,14 +26,16 @@ export function ComposioAppSetup({ name, toolkit, connections, onClose, onBack, const connectionId = selectedConnectionId ?? connections[0]?.id ?? "__new__"; const [result, setResult] = useState(null); const [busy, setBusy] = useState(false); - const [error, setError] = useState(null); + const [error, setError] = useState<{ message: string; missingSignInLink: boolean } | null>(null); const connection = connections.find(candidate => candidate.id === connectionId); + const offerDirectBuffer = error?.missingSignInLink && toolkit === "buffer"; async function submit(input: ComposioAppSetupInput) { if (busy || !connection || !settled) return; setConnectionId(connection.id); setBusy(true); setError(null); + if (input.action === "start") setResult(null); try { const next = await toolsApi.setupComposioApp(connection.id, toolkit, input); setResult(next); @@ -42,7 +46,7 @@ export function ComposioAppSetup({ name, toolkit, connections, onClose, onBack, onClose(); } } catch (cause) { - setError(describeError(cause).body); + setError({ message: describeError(cause).body, missingSignInLink: errorCodes(cause).includes(COMPOSIO_SIGN_IN_LINK_MISSING) }); } finally { setBusy(false); } } @@ -56,7 +60,16 @@ export function ComposioAppSetup({ name, toolkit, connections, onClose, onBack, - {error ?

{error}

: null} + {error ?
+

{offerDirectBuffer + ? "Buffer requires a custom OAuth app in Composio. To connect directly, create a key in Buffer Settings → API, then choose Key or token in Paperclip." + : error.message}

+ {offerDirectBuffer ? : error.missingSignInLink ? : null} +
: null} {result ?

Finish connecting {name} in Composio, then return here.

: null} {result?.authorizationUrl ? : null; const Trigger = mobile ? DialogTrigger : PopoverTrigger; @@ -280,7 +320,7 @@ export function ComposerRunSettingsPicker({ onChange={(event) => { const nextEffort = Number(event.target.value) === 0 ? null : choices[Number(event.target.value) - 1]!; rememberComposerEffort(companyId, nextEffort); - onSettingsChange({ ...selected, effort: nextEffort }); + saveSelection({ ...selected, effort: nextEffort }, model); }} className="composer-run-effort-range mt-3 w-full" style={{ "--fill": `${effortIndex / choices.length * 100}%` } as CSSProperties} /> : null} diff --git a/ui/src/components/task-chat/TaskChatComposer.test.tsx b/ui/src/components/task-chat/TaskChatComposer.test.tsx index 651c54f6d3f..3b79a3ff507 100644 --- a/ui/src/components/task-chat/TaskChatComposer.test.tsx +++ b/ui/src/components/task-chat/TaskChatComposer.test.tsx @@ -14,7 +14,7 @@ import { parseSwarmCommand, planSubmission, swarmRunSettingsRefusal } from "./co import { ComposerAddMenu } from "./ComposerAddMenu"; import { QuestionForm } from "./QuestionForm"; import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; -import type { Agent, HeartbeatRun, IssueWorkMode } from "@paperclipai/shared"; +import type { Agent, HeartbeatRun, IssueAssigneeAdapterOverrides, IssueWorkMode } from "@paperclipai/shared"; import { agentsApi } from "@/api/agents"; import { instanceSettingsApi } from "@/api/instanceSettings"; import { CoordinatorPresentation } from "@/components/coordinator/CoordinatorPresentation"; @@ -32,6 +32,8 @@ import { ApiError } from "../../api/api-error"; import { queryKeys } from "../../lib/queryKeys"; import { useAccountBoundMutation } from "../../hooks/useAccountBoundMutation"; import { waitForStoppedRuns } from "../../lib/wait-for-stopped-runs"; +import { getLastComposerEffort } from "../../lib/recent-composer-effort"; +import type { ComposerRunSettings } from "./composer-run-settings"; // The session lookup never answers on its own; tests set the account directly. vi.mock("../../api/auth", async (importOriginal) => { @@ -2916,6 +2918,159 @@ describe("TaskChatComposer", () => { } }); + it("restores the last model and effort in a fresh task composer for the same agent", async () => { + vi.stubGlobal("ResizeObserver", class { observe() {} disconnect() {} }); + const availableModels = [ + { id: "claude-sonnet-4-6", label: "Claude Sonnet 4.6" }, + { id: "claude-sonnet-4-5", label: "Claude Sonnet 4.5" }, + ]; + const catalog = vi.spyOn(agentsApi, "adapterModels").mockResolvedValue(availableModels); + let client = new QueryClient({ defaultOptions: { queries: { retry: false } } }); + const agent = { id: "task-agent", name: "Mira", adapterType: "claude_local", adapterConfig: { model: "claude-sonnet-4-5" } } as unknown as Agent; + const otherAgent = { ...agent, id: "other-agent", name: "Tess" }; + const onSubmit = vi.fn().mockResolvedValue(undefined); + const onAdd = vi.fn().mockResolvedValue(undefined); + function Draft({ assignee = agent, initialSettings = null, overrides }: { + assignee?: Agent; + initialSettings?: ComposerRunSettings | null; + overrides?: IssueAssigneeAdapterOverrides; + }) { + const [settings, setSettings] = useState(initialSettings); + const value = `agent:${assignee.id}`; + return ; + } + const paint = (key: string, props?: ComponentProps) => + render(); + const paintConversation = () => + render( + + ); + const click = async (selector: string) => + act(async () => document.querySelector(selector)!.click()); + const chooseModel = async (label: string) => { + await click('[aria-label="Select model and effort"]'); + await click('[aria-label="Choose exact model"]'); + const option = [...document.querySelectorAll('button[role="option"]')] + .find((item) => item.textContent?.startsWith(label))!; + await act(async () => option.click()); + }; + const resetCatalog = () => { + render(<>); + client.clear(); + client = new QueryClient({ defaultOptions: { queries: { retry: false } } }); + }; + const waitForEffort = () => vi.waitFor(async () => { + await flushAsync(); + expect(container.querySelector('[aria-label="Select model and effort"]')?.textContent).toContain("High"); + }); + try { + paint("first"); + await flushAsync(); + await chooseModel("Claude Sonnet 4.6"); + const range = document.querySelector('input[aria-label="Effort"]')!; + await act(async () => { + Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, "value")!.set!.call(range, "3"); + range.dispatchEvent(new Event("change", { bubbles: true })); + range.dispatchEvent(new Event("input", { bubbles: true })); + }); + + expect(getLastComposerEffort("task-company")).toBe("high"); + resetCatalog(); + paintConversation(); + await waitForEffort(); + expect(container.querySelector('[data-testid="task-chat-composer-model-label"]')?.textContent).toBe("Claude Sonnet 4.5"); + typeText("Continue the conversation"); + await act(async () => sendButton().click()); + expect(onAdd).toHaveBeenLastCalledWith("Continue the conversation", undefined, undefined, undefined, + expect.any(String), { model: null, effort: "high", fast: false }); + + paint("other", { assignee: otherAgent }); + await waitForEffort(); + expect(container.querySelector('[data-testid="task-chat-composer-model-label"]')?.textContent).toBe("Claude Sonnet 4.5"); + await act(async () => sendButton().click()); + expect(onSubmit).toHaveBeenLastCalledWith("Start a task", "standard", { model: null, effort: "high", fast: false }); + + resetCatalog(); + let finishDiscovery!: (models: typeof availableModels) => void; + catalog.mockImplementation(() => new Promise((resolve) => { finishDiscovery = resolve; })); + paint("second"); + expect(container.querySelector('[data-testid="task-chat-composer-model-label"]')?.textContent).toBe("claude-sonnet-4-6"); + await act(async () => sendButton().click()); + expect(onSubmit).toHaveBeenLastCalledWith("Start a task", "standard", { model: "claude-sonnet-4-6", effort: "high", fast: false }); + + paint("inherited", { overrides: { adapterConfig: { model: "claude-sonnet-4-5" } } }); + expect(container.querySelector('[data-testid="task-chat-composer-model-label"]')?.textContent).toBe("claude-sonnet-4-5"); + await act(async () => sendButton().click()); + expect(onSubmit).toHaveBeenLastCalledWith("Start a task", "standard", null); + + const explicit = { model: "claude-sonnet-4-5", effort: "low", fast: false }; + paint("recovered", { initialSettings: explicit }); + await act(async () => sendButton().click()); + expect(onSubmit).toHaveBeenLastCalledWith("Start a task", "standard", explicit); + + paint("pending-model-choice"); + await chooseModel("Use agent default"); + expect(document.querySelector('[data-testid="selected-effort"]')).toBeNull(); + await act(async () => finishDiscovery(availableModels)); + await vi.waitFor(async () => { + await flushAsync(); + expect(document.querySelector('[data-testid="selected-effort"]')?.textContent).toBe("High"); + }); + + resetCatalog(); + catalog.mockImplementation(() => new Promise(() => {})); + paint("reload-before-discovery"); + await act(async () => sendButton().click()); + expect(onSubmit).toHaveBeenLastCalledWith("Start a task", "standard", { model: null, effort: "high", fast: false }); + + resetCatalog(); + catalog.mockResolvedValue(availableModels); + paint("after-pending-model-choice"); + await waitForEffort(); + await act(async () => sendButton().click()); + expect(onSubmit).toHaveBeenLastCalledWith("Start a task", "standard", { model: null, effort: "high", fast: false }); + + await chooseModel("Claude Sonnet 4.6"); + + resetCatalog(); + catalog.mockResolvedValue(availableModels.slice(1)); + paint("limited-catalog"); + await flushAsync(); + expect(container.querySelector('[data-testid="task-chat-composer-model-label"]')?.textContent).toBe("claude-sonnet-4-6"); + await act(async () => sendButton().click()); + expect(onSubmit).toHaveBeenLastCalledWith("Start a task", "standard", { model: "claude-sonnet-4-6", effort: "high", fast: false }); + + paint("reset"); + await click('[aria-label="Select model and effort"]'); + await click('[aria-label="Reset to agent default"]'); + expect(getLastComposerEffort("task-company")).toBeNull(); + paint("after-reset"); + await act(async () => sendButton().click()); + expect(onSubmit).toHaveBeenLastCalledWith("Start a task", "standard", null); + + catalog.mockResolvedValue(availableModels); + paintConversation(); + await flushAsync(); + typeText("Continue with defaults"); + await act(async () => sendButton().click()); + expect(onAdd.mock.calls.at(-1)?.slice(5)).toEqual([]); + } finally { + render(<>); + client.clear(); + catalog.mockRestore(); + vi.unstubAllGlobals(); + } + }); + describe("paused task takeover", () => { it("allows only standalone /new to resume a paused conversation through the normal composer", async () => { const onAdd = vi.fn().mockResolvedValue(undefined); diff --git a/ui/src/components/task-chat/TaskChatComposer.tsx b/ui/src/components/task-chat/TaskChatComposer.tsx index 58d1bbdc433..9177b9a6626 100644 --- a/ui/src/components/task-chat/TaskChatComposer.tsx +++ b/ui/src/components/task-chat/TaskChatComposer.tsx @@ -1641,6 +1641,7 @@ export function TaskChatComposer({ agents={modelAgents} overrides={assigneeAdapterOverrides} settings={runSettings} + rememberTaskSettings={Boolean(creation)} onSettingsChange={setRunSettings} onAssigneeChange={updatePendingAssignee} allowAssigneeChange={showAssignee && !conversationMode} diff --git a/ui/src/lib/recent-composer-effort.ts b/ui/src/lib/recent-composer-effort.ts index ce45aeb58d6..8d45c05cc61 100644 --- a/ui/src/lib/recent-composer-effort.ts +++ b/ui/src/lib/recent-composer-effort.ts @@ -1,21 +1,51 @@ const STORAGE_KEY = "paperclip:composer-effort"; -/** Undefined means no preference; null is the user's explicit Default choice. */ -export function getLastComposerEffort(companyId: string): string | null | undefined { +type RememberedTaskRunSettings = { model: string | null; effort: string | null; effortModel: string }; + +function readPreference(key: string): unknown { try { - const raw = localStorage.getItem(`${STORAGE_KEY}:${companyId}`); - if (raw === null) return undefined; - const value: unknown = JSON.parse(raw); - return value === null || typeof value === "string" ? value : undefined; + const raw = localStorage.getItem(key); + return raw === null ? undefined : JSON.parse(raw); } catch { return undefined; } } -export function rememberComposerEffort(companyId: string, effort: string | null): void { +function writePreference(key: string, value: RememberedTaskRunSettings | string | null): void { try { - localStorage.setItem(`${STORAGE_KEY}:${companyId}`, JSON.stringify(effort)); + localStorage.setItem(key, JSON.stringify(value)); } catch { // The current run setting still works without persistent storage. } } + +/** Undefined means no preference; null is the user's explicit Default choice. */ +export function getLastComposerEffort(companyId: string): string | null | undefined { + const value = readPreference(`${STORAGE_KEY}:${companyId}`); + return value === null || typeof value === "string" ? value : undefined; +} + +export function rememberComposerEffort(companyId: string, effort: string | null): void { + writePreference(`${STORAGE_KEY}:${companyId}`, effort); +} + +export function readRecentTaskRunSettings(scope: string): RememberedTaskRunSettings | undefined { + const value = readPreference(`paperclip:task-run-settings:${scope}`) as Partial | null; + if (value && (value.model === null || typeof value.model === "string") + && (value.effort === null || typeof value.effort === "string") && typeof value.effortModel === "string") { + return { model: value.model, effort: value.effort, effortModel: value.effortModel }; + } +} + +export function rememberTaskRunSettings(scope: string, model: string | null, effort: string | null, effortModel: string): void { + writePreference(`paperclip:task-run-settings:${scope}`, { model, effort, effortModel }); +} + +export function confirmTaskEffortModel(scope: string, remembered: RememberedTaskRunSettings, effortModel: string): void { + if (remembered.effortModel === effortModel) return; + const current = readRecentTaskRunSettings(scope); + // Discovery can finish after another composer has saved a newer choice. + if (current?.model === remembered.model && current.effort === remembered.effort && current.effortModel === remembered.effortModel) { + rememberTaskRunSettings(scope, current.model, current.effort, effortModel); + } +} diff --git a/ui/src/lib/recent-selections.test.ts b/ui/src/lib/recent-selections.test.ts index 5e9ddd6c4fa..d614ed3604c 100644 --- a/ui/src/lib/recent-selections.test.ts +++ b/ui/src/lib/recent-selections.test.ts @@ -7,7 +7,7 @@ import { trackRecentAssigneeUser, } from "./recent-assignees"; import { getLastProjectId, getRecentProjectIds, trackRecentProject } from "./recent-projects"; -import { getLastComposerEffort, rememberComposerEffort } from "./recent-composer-effort"; +import { confirmTaskEffortModel, getLastComposerEffort, readRecentTaskRunSettings, rememberComposerEffort, rememberTaskRunSettings } from "./recent-composer-effort"; import { orderItemsBySelectedAndRecent } from "./recent-selections"; describe("recent selection ordering", () => { @@ -92,6 +92,32 @@ describe("recent selection ordering", () => { expect(getLastComposerEffort("company-1")).toBeUndefined(); }); + it("reads scoped model and effort choices and ignores incomplete or corrupt records", () => { + const scope = "company-1:agent-1"; + const key = `paperclip:task-run-settings:${scope}`; + rememberTaskRunSettings(scope, "model-a", "high", "model-a"); + expect(readRecentTaskRunSettings(scope)).toEqual({ model: "model-a", effort: "high", effortModel: "model-a" }); + expect(readRecentTaskRunSettings("company-1:agent-2")).toBeUndefined(); + rememberTaskRunSettings(scope, null, null, "model-a"); + expect(readRecentTaskRunSettings(scope)).toEqual({ model: null, effort: null, effortModel: "model-a" }); + localStorage.setItem(key, '{"model":"model-a","effort":"high"}'); + expect(readRecentTaskRunSettings(scope)).toBeUndefined(); + localStorage.setItem(key, "broken json"); + expect(readRecentTaskRunSettings(scope)).toBeUndefined(); + }); + + it("records late effort validation without replacing a newer choice", () => { + const scope = "company-1:agent-1"; + rememberTaskRunSettings(scope, "new-model", "high", "previous-model"); + const pending = readRecentTaskRunSettings(scope)!; + confirmTaskEffortModel(scope, pending, "new-model"); + expect(readRecentTaskRunSettings(scope)).toEqual({ model: "new-model", effort: "high", effortModel: "new-model" }); + + rememberTaskRunSettings(scope, "new-model", null, "new-model"); + confirmTaskEffortModel(scope, pending, "new-model"); + expect(readRecentTaskRunSettings(scope)?.effort).toBeNull(); + }); + it("tracks recent user and agent assignee selections with prefixed ids", () => { trackRecentAssignee("agent-1"); trackRecentAssigneeUser("user-1");