Repository navigation
fix(setup): activate saved credentials against committed config shape - #170165
crwvrosenblum wants to merge 1 commit into
Conversation
When setup installs a provider plugin, the config commit moves pending install records into the plugin index and strips them from authored config. The post-commit credential check compared the committed state against a route projection that still carried the pending records, so install-mediated credential activation reported false owner drift, failed activation, and rolled back through a write the config guard rejected. Compare against the committed shape instead so activation succeeds, and extend the install-owner coverage to a saved credential: the prior fixture returned no auth profiles, so the activation path never ran. Opening the mock to importOriginal passthrough also removes its stale closed-mock baseline row. Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs real behavior proof before merge. What this changesThis PR compares credential activation against the config shape produced after pending plugin installation records are committed. Example: Setup installs fixture-provider and verifies fixture-provider/fixture-model using a saved API-key credential.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 1 item remains Keep open: this PR repairs a concrete current-main setup failure with a focused change; no introduced correctness defect was found. Priority: P1 Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherThe shared setup coordinator prepares and verifies an inference route, commits config and plugin installation records through their owners, and then activates the selected saved credential. flowchart LR
A[Provider selection] --> B[Credential staging]
B --> C[Inference verification]
C --> D[Config commit owner]
D --> E[Canonical plugin index]
D --> F[Activation revalidation]
F --> G[Credential promotion]
Technical reviewBest possible solution: Retain the focused committed-shape comparison while preserving existing route, artifact, consent, and credential ownership checks. Do we have a high-confidence way to reproduce the issue? Current-main source establishes the deterministic mismatch between pending and committed install-record shapes; the contributor reports a matching base-fail/head-pass regression, which was not executed during this read-only review. Is this the best way to solve the issue? The repair addresses the mismatched representation at the existing activation owner without introducing another installer, changing provider selection, or weakening the separate artifact and credential checks. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against f472deb0efd2. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +5, Tests +26, Other -1. Total +30 across 3 files. Added test files: 0. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 12, 2026, 3:36 PM ET / 19:36 UTC. |
Related: #92232, #166965
What Problem This Solves
Fixes: setup fails to activate a saved sign-in whenever the setup flow also installed a provider plugin — the post-commit ownership check reports false configuration drift and activation fails.
User Impact
After plugin-mediated setup (for example, onboarding a provider that the app installs on demand), the user's verified credential could not be activated: the saved sign-in stayed inactive and setup reported a spurious "connection changed" failure instead of completing.
Why This Change Was Made
When setup installs a provider, the config commit moves pending install records into the canonical plugin index and strips them from authored config. The credential-activation revalidation compared the committed snapshot against a route projection still carrying the pending records, so every such activation read as concurrent drift. The comparison now runs against the committed configuration shape, matching how installation-record ownership already normalizes the post-commit view.
This was split out of #166965 so the fix can land independently of the catalog-admission decision pending there. It repairs activation for any installed provider, including the existing external catalog entry.
Evidence
authProfiles: [], so no credential was ever saved and the activation path never ran. Supplying a real auth profile reproduces the bug on this base:replace during probe: falsefails with the false-drift activation error (the failed rollback additionally trips the config write guard:size-drop:1355->641). With the fix, both cases pass — the saved credential is promoted (itssetupmarker cleared), the install record lands in the canonical index, and authored config is committed withoutplugins.installsremnants.replace during probe: truecase still fails at the intended earlier boundary (artifact substitution detected during verification) and passes.importOriginalpassthrough is required by the newly exercised save path (applyProviderPluginAuthMethodResultConfig) and removes the stale closed-mock baseline row.node scripts/run-vitest.mjs src/system-agent/setup-inference.provider-install-owner.test.ts --maxWorkers=1: 2/2 pass; shard wall time 36s (tests 11.5s).oxfmt,oxlint(0 warnings/errors),git diff --check, and all core-test tsgo shards pass.check:test-mock-exports --pruneregenerated the shrink-only baseline (9814 → 9813 rows).