Skip to content

feat(settings): Replicas connection card with environment setup - #149

Merged
khaliqgant merged 2 commits into
mainfrom
feat/replicas-settings-card
Nov 17, 2026
Merged

khaliqgant merged 2 commits into
mainfrom
feat/replicas-settings-card

Conversation

@agent-relay-code

@agent-relay-code agent-relay-code Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Replaces the generic remote-connection card for the Replicas provider with a dedicated settings card built on the existing Control routes. No new backend contract; the dashboard only reads and writes what Control already serves.

What the card shows

  • Connection: the one-step flow stays. The person pastes a Replicas API key (connect or replace); the key is cleared on submit and never shown again. Disconnect keeps the existing warning that it revokes every replica's Relay access. Non-managers see the same prompt as for the other providers.
  • Status line: organization already connected elsewhere, key refused (with the date), missing or departed responsible member, failed automatic setup, pending setup, or configured, always followed by "N of M environments configured".
  • Responsible member: a select over the organization's members labelled Name (email) so same-name members can be told apart, with "No default principal" and a disabled "Former member" option when the stored principal left. Apply Relay setup stores the choice and then runs an environment sync.
  • Environments: one row per environment with its status (Configured, Pending, Registration unconfirmed, Not listed by Replicas, Key refused, Opted out, Disabled, plus "stale connection"), bound count, unmapped creators, and Opt out / Enable / Retry buttons. Errors are shown on the row they belong to.
  • Replica bindings: every spawn with its agent or replica id, state, error and rejected / uncertain / retrying message counts.

Every write re-reads the policies and spawns, so a conflict leaves the newer server state on screen.

Files

  • src/admin/remote-agent-api.ts: replicasApi (workspace spawns, environment policies, sync, environment update, principal) with tolerant zod schemas (status strings open, unknown fields stripped).
  • src/admin/replicas-settings.tsx: the card.
  • src/admin/remote-agents.tsx, src/admin/settings.tsx: route the replicas provider to the new card and pass the organization id for the member list.
  • src/admin/replicas-settings.test.tsx: six tests (responsible-member listing with duplicate names, apply then sync ordering, opt out / retry / enable writes, binding list with errors and counts, connect without leaking the key, non-manager view with no controls and no Replicas reads).

Checks

npm run lint, vitest run src/admin/replicas-settings.test.tsx src/admin/remote-agents.test.tsx (25 passed) and npm run build all pass locally on this head.

Opened with merge-train:hold: no merge, image cut or deploy without a direct OK.

🤖 Generated with Claude Code


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

View guided diff

Replace the generic remote-connection card for the Replicas provider with
a card that drives the existing Control routes: connection status, the
member responsible for Replicas agents (name and email so same-name
members stay distinguishable), Apply Relay setup (set principal, then
sync), per-environment opt-out, enable and retry, and the replica
binding list with errors and message counts. The one-step flow is kept:
the person pastes a Replicas API key and nobody handles a workspace key.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 5b4042d2-998a-49f9-a080-c7dd00d2899d

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@greptile-apps

greptile-apps Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; both previous findings are addressed.

Summary

Adds a dedicated Replicas settings card with responsible-member selection, environment setup, and replica bindings.

  • Replicas now has its own connection card in workspace settings.
  • Managers can choose who joins Relay and control each environment.
  • Managers can inspect the state and message counts for each replica binding.

Reviews (2) · Last reviewed commit: "fix(replicas): gate the setup panel on m..." · Reviewed by Greptile

Comment thread src/admin/replicas-settings.tsx Resolved
Comment thread src/admin/replicas-settings.tsx Resolved
…ate with the connection form

Control refuses every Replicas route to non-owner/admin members, so the
setup panel now mounts only for managers and members see the owner/admin
prompt whether or not a connection exists. The connection form and the
setup panel share one busy signal: Disconnect/Replace are disabled while a
setup write runs and setup writes are refused while the connection is being
replaced or disconnected.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@khaliqgant
khaliqgant merged commit 95c7fb0 into main Nov 17, 2026
6 checks passed
@khaliqgant
khaliqgant deleted the feat/replicas-settings-card branch November 17, 2026 03:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant