Skip to content

refactor(inference): retire the dead CLI-logins add-provider group (#2394) - #2398

Open
oxoxDev wants to merge 3 commits into
tinyhumansai:mainfrom
oxoxDev:fix/2394-retire-cli-logins-group
Open

oxoxDev wants to merge 3 commits into
tinyhumansai:mainfrom
oxoxDev:fix/2394-retire-cli-logins-group

Conversation

@oxoxDev

@oxoxDev oxoxDev commented Sep 18, 2026

Copy link
Copy Markdown
Collaborator

Summary

The LLM/Providers page's Add a provider dialog rendered a "CLI logins" group that was permanently empty and unselectable — CLI_LOGINS_REACHABLE was pinned false, so the category was handed [] and showed "Not available on this host." A group named after exactly the thing an operator wants, greyed out, reads as "ACP is switched off here" — while GET {scope}/harnesses already reports claude and codex as detected: true, runsHere: true on a desktop build.

This retires the group rather than finishing it. There is nothing a company-level row could ever hold for a CLI login: no key, no endpoint, and — per the External Harnesses design — deliberately no stored "connected" flag, since that would be a second source of truth that could disagree with the CLI actually being installed. Binding is per teammate and already works today from an agent's Model tab, so the dialog links there instead.

First of four PRs implementing #2394's rollout. Independent of the rest, in both directions.

API Or Behavior Changes

  • The add-provider dialog offers two categories (Cloud, Local runtimes) instead of three. It gains a line pointing at the roster: "Claude Code and Codex are bound per teammate, on an agent's Model tab. Open the roster" → #/company/agents, which closes the dialog on the way out.
  • One deletion covers both mount sites — the Providers page and the first-run wizard's self-managed connect step, which mounts the same dialog.
  • CLI_LOGINS_REACHABLE and CLI_LOGINS_UNAVAILABLE are deleted. Both lost their only consumer with the group; a false flag nothing reads is the same second-source-of-truth shape the category was retired for. The reasoning moves onto addOptions' surviving cli field, which stays populated because the self-managed step resolves an already-connected CLI row's label through it.
  • Category's now-unused emptyNote prop removed.
  • No backend behavior change. The cli_login refusal stays exactly as it was; only its comment changes, from implying a future delegated-credential fix to stating the refusal is permanent by design.
  • Category::Cli, CLI_LOGINS, ProviderRef::ClaudeCode and the has_category routing guard are all untouched — still load-bearing.
  • No copy string changed on either side, so catalogue_tests_mirror.rs passes unmodified.

Tests

New: frontend/test/unit/inference-add-cli-group-retired.test.ts — asserts no #inference-add-cli control, no "CLI logins" or "Not available on this host." text in the dialog, and that the roster link carries #/company/agents and closes the dialog when taken. Verified this fails (2/2) against the pre-change sources before passing, rather than passing vacuously.

  • npm run typecheck
  • npm run typecheck:unit
  • npm run typecheck:e2e
  • npx vitest run over the new test plus inference-add-dialog-close, inference-connect, setup-wizard-self-managed-step1 — 60 passed
  • scripts/ci/assert-setup-inference-imports.sh
  • scripts/ci/assert-design-tokens.sh
  • cargo fmt -p opencompany-core --check
  • cargo check -p opencompany-core
  • cargo clippy -p opencompany-core --no-deps --all-targets -- -D warnings
  • cargo test — N/A, no Rust behavior changed (comment only)

Manual verification in the running console (dev server against a live host): the dialog shows Cloud and Local runtimes only, with the pointer line beneath; clicking Open the roster navigates to the Agents roster and closes the dialog.

Documentation

No spec change needed here. docs/spec/runtime/external-harnesses-ui.md describes the External Harnesses settings surface, which this PR does not touch — it is updated in the PR that folds that page into a per-harness detail view.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Changes
    • The provider setup dialog now shows cloud and local provider options.
    • CLI login is no longer available as an add-provider option.
    • Added guidance explaining that Claude Code and Codex connections are managed per teammate.
    • Added an “Open the roster” link for quickly accessing teammate connection settings.
    • Simplified the empty state message when all available provider options are already connected.

…inyhumansai#2394)

The group was rendered permanently empty and unselectable, which reads as
"ACP is switched off on this host" — while the backend already reports
claude and codex as detected and runnable.

It is retired rather than finished because there is nothing a company-level
row could ever hold: a CLI login has no key and no endpoint, and a stored
"connected" flag would be a second source of truth that could disagree with
the CLI actually being installed. Binding is per teammate and already works
from an agent's Model tab, so the dialog links there instead.
…nyhumansai#2394)

Both lost their only consumer when the add-provider dialog stopped rendering
the category. A `false` flag nothing reads is the same second-source-of-truth
shape the category was retired for, so the reasoning moves onto the `cli`
field that survives — still populated, because the self-managed setup step
resolves an already-connected CLI row's label through it.
tinyhumansai#2394)

The comment implied the handler would start accepting these once a delegated
credential existed. It will not: there is no key and no endpoint to store, so
the refusal is the design rather than a gap waiting to be filled.
@coderabbitai

coderabbitai Bot commented Sep 18, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 003a2df2-a62b-44c1-a525-eaace348ff00

📥 Commits

Reviewing files that changed from the base of the PR and between 92a5755 and 88eec6f.

📒 Files selected for processing (4)
  • crates/opencompany-core/src/server/ops/inference/providers.rs
  • frontend/src/inference/AddProviderDialog.tsx
  • frontend/src/inference/connect.ts
  • frontend/test/unit/inference-add-cli-group-retired.test.ts

Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review.


📝 Walkthrough

Walkthrough

The add-provider dialog now exposes cloud and local providers only. It directs Claude Code and Codex binding to the teammate roster. CLI connection constants and related empty-state behavior were removed, and tests verify the updated dialog.

Changes

CLI login retirement

Layer / File(s) Summary
Connection policy and refusal behavior
frontend/src/inference/connect.ts, crates/opencompany-core/src/server/ops/inference/providers.rs
CLI logins retain label lookup but expose no add-provider flow. The server comment documents the permanent refusal behavior.
Add-provider dialog and validation
frontend/src/inference/AddProviderDialog.tsx, frontend/test/unit/inference-add-cli-group-retired.test.ts
The dialog removes the CLI category, adds a link to #/company/agents, simplifies empty-state text, and verifies the updated categories and link behavior.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~15 minutes

Change: Bug fix

Suggested reviewers: graycyrus

Merge Risk: ⚪ Minimal · up to 88eec

The dialog now removes an unavailable provider path and directs users to the teammate roster. No actionable merge risk remains.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 9 functions across 4 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: retiring the unused CLI-logins add-provider group from inference setup.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI

I’m a rabbit with a tidy tray,
Cloud and local hop into play.
CLI paths rest beyond the gate,
Roster links now show their place.
Tests give two quick thumps of cheer,
The teammate trail is bright and clear.

Comment @coderabbitai help to get the list of available commands.

@oxoxDev
oxoxDev marked this pull request as ready for review September 18, 2026 13:58
@tinysweeper

tinysweeper Bot commented Sep 18, 2026

Copy link
Copy Markdown

Tiny Sweeper review

Reviewed 4 files; 1 finding. _The code index is behind this pull request (indexed at `93d1768791d8`), so retrieved context may be out of date._ _Memory was unavailable (model: cortex: v1/recall: timed out after 10s), so this review ran without it._

State: Ready for maintainer review
Priority: medium
Reviewed head: 88eec6f9146a
Updated: 1789740777 (Unix time)

Review snapshot

Change surface Files Review signal Count
Production 3 Active findings 1
Tests 1 Noted findings 0
Documentation 0 Resolved findings 0
Configuration 0 Pending checks/questions 0

Completeness: Complete
Test assessment: Test coverage is assessed from changed tests and lane evidence; execution is not claimed without trusted check data.

What changed

- Removed the CLI-logins category from the add-provider dialog, including the `CLI_LOGINS_REACHABLE` export and `CLI_LOGINS_UNAVAILABLE` constant.
- Replaced the CLI category with a harness hint paragraph and a link to the roster (`#/company/agents`).
- Updated doc comments across the dialog and connect module to reflect two categories (cloud, local) instead of three.
- Updated the backend comment in `providers.rs` to reflect that CLI login rejection is permanent by design, not a placeholder.
- Added a new unit test file covering the removal and the replacement hint.

Features

  • Internal refactor — Backend comment update: The comment explaining CLI rejection was updated to clarify permanence, but no backend behavior changed. (crates/opencompany-core/src/server/ops/inference/providers.rs#fn plan_add()

Tests

  • new — Verifies the add-provider dialog has no CLI-logins group and that the harness hint is present and closes the dialog when clicked.: The behavioral change is verified — the CLI group is absent, the hint is present, and clicking the link closes the dialog. (frontend/test/unit/inference-add-cli-group-retired.test.ts)

Findings

  • medium · e2e · Cover the add-provider dialog removal with an end-to-end test — The PR removes the CLI logins group from the `AddProviderDialog`, a change visible to every user who opens the dialog. No end-to-end test exercises this dialog to verify the absenc (frontend/src/inference/AddProviderDialog\.tsx:98)

Before merge

None.

How this fits together

flowchart LR
  n0["plan_add<br/>changed"]:::changed
  n1["AddProviderDialog<br/>changed<br/>1 finding"]:::flagged
  n2["Category<br/>changed<br/>1 finding"]:::flagged
  n3["addOptions<br/>changed"]:::changed
  n4["cloud_provider"]:::impacted
  n5["options"]:::impacted
  n6["endpointHost"]:::impacted
  n7["isConnected"]:::impacted
  n8["Provider"]:::impacted
  n9["format"]:::impacted
  n0 -->|calls| n4
  n0 -->|calls| n9
  n1 -->|uses| n2
  n1 -->|uses| n5
  n1 -->|uses| n8
  n2 -->|uses| n5
  n3 -->|calls| n6
  n3 -->|calls| n7
  n3 -->|uses| n8
  n5 -->|calls| n3
  n7 -->|uses| n8
  classDef changed fill:#0d4429,stroke:#238636,color:#e6edf3
  classDef impacted fill:#161b22,stroke:#6e7681,color:#c9d1d9
  classDef flagged fill:#5a1e02,stroke:#d93f0b,color:#ffffff
  classDef blocking fill:#67060c,stroke:#f85149,color:#ffffff
Loading
Agent review details

critique

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Positive: Reviewed 4 files; 1 finding.
  • Lane summary: Reviewed 4 files; 1 finding. _The code index is behind this pull request (indexed at `93d1768791d8`), so retrieved context may be out of date._ _Memory was unavailable (model: cortex: v1/recall: timed out after 10s), so this review ran without it._

security

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Lane summary: Reviewed 4 files; 0 findings. _The code index is behind this pull request (indexed at `93d1768791d8`), so retrieved context may be out of date._ _Memory was unavailable (model: cortex: v1/recall: timed out after 10s), so this review ran without it._

tests

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Positive: Removes the CLI-logins category from the add-provider dialog, replacing it with a harness hint that points to the roster. The new test asserts the CLI group is absent, the hint is present, and clicking the hint closes the dialog — the behavioural change is verified.
  • Lane summary: Removes the CLI-logins category from the add-provider dialog, replacing it with a harness hint that points to the roster. The new test asserts the CLI group is absent, the hint is present, and clicking the hint closes the dialog — the behavioural change is verified. _The code index is behind this pull request (indexed at `93d1768791d8`), so retrieved context may be out of date._ _Memory was unavailable (model: cortex: v1/recall: timed out after 10s), so this review ran without it._

commits

  • Conclusion: Neutral
  • Scope reviewed: all assigned evidence
  • Positive: Nothing sensitive found in what this pull request commits.
  • Lane summary: Nothing sensitive found in what this pull request commits.

description

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Positive: The change retires the dead CLI-logins group from the add-provider dialog, replacing it with a roster link pointing teammates to their per-agent Model tab. No correctness issues are introduced; the deletions and additions are self-consistent, the new test covers the expected behavior, and the backend comment is updated to match the permanent design intent. Safe to merge.
  • Lane summary: The change retires the dead CLI-logins group from the add-provider dialog, replacing it with a roster link pointing teammates to their per-agent Model tab. No correctness issues are introduced; the deletions and additions are self-consistent, the new test covers the expected behavior, and the backend comment is updated to match the permanent design intent. Safe to merge. _The code index is behind this pull request (indexed at `93d1768791d8`), so retrieved context may be out of date._ _Memory was unavailable (model: cortex: v1/recall: timed out after 10s), so this review ran without it._

e2e

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Lane summary: Removes the CLI logins group from the add-provider dialog, replacing it with a pointer to the roster. The change is unit-tested but not covered by any end-to-end test, leaving the UI surface unreached by the e2e suite. 3 end-to-end jobs passed on this head. _The code index is behind this pull request (indexed at `93d1768791d8`), so retrieved context may be out of date._ _Memory was unavailable (model: cortex: v1/recall: timed out after 10s), so this review ran without it._
  • Evidence: frontend/src/inference/AddProviderDialog\.tsx — Cover the add-provider dialog removal with an end-to-end test
Evidence and run details
  • Models: ladder/vectors, gpt-5.6-luna, deepseek/deepseek-v4-flash
  • Spend: $0.012636
  • Tokens: 210863 input · 11550 output · 8031 cached · 595 embedding
Head State Pass summary
88eec6f9146a ready for maintainer review 1 active finding(s), 0 resolved finding(s) (at 1789740777)

tinysweeper 0.1.0

@tinysweeper tinysweeper Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tinysweeper found nothing blocking. Approving.

             $0.0126 · 210,863 in / 11,550 out · 8,031 cached (4%) · ladder/vectors, gpt-5.6-luna, deepseek/deepseek-v4-flash · 595 embedded
critique:    $0.0050 · 91,939 in  / 3,436 out  · 6,169 cached (7%) · gpt-5.6-luna, deepseek/deepseek-v4-flash
security:    $0.0038 · 71,338 in  / 1,638 out  · 1,862 cached (3%) · gpt-5.6-luna
tests:       $0.0018 · 15,562 in  / 2,278 out  · 0 cached (0%)     · deepseek/deepseek-v4-flash
description: $0.0004 · 7,235 in   / 83 out     · 0 cached (0%)     · deepseek/deepseek-v4-flash
e2e:         $0.0012 · 19,754 in  / 2,640 out  · 0 cached (0%)     · deepseek/deepseek-v4-flash

emptyNote={CLI_LOGINS_UNAVAILABLE}
onChoose={onChoose}
/>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

priority medium e2e confident

Cover the add-provider dialog removal with an end-to-end test

The PR removes the CLI logins group from the AddProviderDialog, a change visible to every user who opens the dialog. No end-to-end test exercises this dialog to verify the absence of the group or the presence of the new harness hint. A unit test was added, but the external surface (the rendered dialog) is not driven by any e2e suite. Without e2e coverage, a regression that re-introduces the group or breaks the hint would go unnoticed in CI.

[RULE] e2e-uncovered ·

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Acknowledged: the AddProviderDialog e2e coverage gap is fair to flag. However, this PR is scoped to retire the CLI-logins group; adding a new e2e test for the dialog itself expands scope beyond the card's boundaries and belongs as a follow-up feature request to the console's e2e suite, not in this PR. The change is validated by the unit test added here (the absence of the group in the rendered state) and by manual verification during development. Coverage of the full dialog surface (including harness hint rendering) is reasonable follow-up work for the e2e suite.

@tinysweeper tinysweeper Bot added the priority: p2 Soon. Real but survivable — a rough edge, a gap, a thing that will bite later. label Sep 18, 2026
@oxoxDev
oxoxDev requested a review from senamakel September 18, 2026 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority: p2 Soon. Real but survivable — a rough edge, a gap, a thing that will bite later.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant