Move provider state into provider bridge contract - #1879
Conversation
|
🚨 SLOP COP 🚨 · I am SlopCop. I am reviewing this pull request for security, quality, performance, architecture, duplication, and end-to-end behavior. |
There was a problem hiding this comment.
🚨 SLOP COP 🚨 · review
Plain English summary: This change lets each AI provider report its install, sign-in, version, health, and usage state through one bridge contract. The server uses those reports in onboarding, the composer, Settings, the SDK, and the CLI.
I found two P1 issues and three P2 issues:
- P1: The committed SDK and template declarations are stale. This mismatch now makes the package test and check jobs fail.
- P1: A fresh machine can hide all provider install choices when Pi reports
unauthenticated. The user cannot install a usable provider in onboarding. - P2: Plugin bridges can show Install or Update buttons without a matching host action.
- P2: The server accepts plugin usage reports, but Settings shows only three fixed providers.
- P2: Provider state and usage checks start unlimited parallel work. The maintenance runtime also keeps each bridge process until shutdown or invalidation.
The security review found no security issue. The host daemon protocol version has the correct change from 135 to 136.
I started the development app and tested the changed user paths. Provider state and usage routes returned HTTP 200.
The composer selected a ready provider. Usage Settings showed Codex, Claude Code, and Cursor data. Onboarding showed seven providers and advanced to project selection.
The first provider state and usage requests each took about 11.5 seconds. One request left seven bridge workers after the page closed.
The provider bridge test groups passed 672 tests. The focused runtime tests passed 14 tests. The server, host daemon, and app type checks passed.
git diff --check passed. The current GitHub package test and check jobs fail because the generated declarations are stale.
I also checked for repeated code and possible shared helpers. I found repeated executable, version, percentage, and credential helpers across provider packages.
These helpers are small. Provider isolation makes a shared module optional, so I did not report this repetition as a defect.
b101602 to
4265572
Compare
4265572 to
2e10f19
Compare
What was wrong
Provider readiness, usage, installation, and update state was assembled in onboarding/server/daemon code even though generic product paths—including the root composer and Settings—also depend on it. That mislabeled shared provider behavior as onboarding behavior and forced every provider-specific maintenance change into core host and server code.
What changed
provider/health,provider/usage,provider/installation/status, andprovider/installation/run.HOST_DAEMON_PROTOCOL_VERSIONto 139 for the provider-scoped installation RPCs and documented the experimental plugin/bridge contract indocs/api_to_audit.mdanddocs/provider-bridge-protocol.md.How you verified
origin/maincompleted without conflicts.git diff --checkpassed.Related to #1620