Skip to content

fix(quorum): prefer slash-path providers.json so Daintree slots are visible#165

Merged
jobordu merged 1 commit into
mainfrom
fix/quorum-preflight-prefer-slash-path
May 13, 2026
Merged

fix(quorum): prefer slash-path providers.json so Daintree slots are visible#165
jobordu merged 1 commit into
mainfrom
fix/quorum-preflight-prefer-slash-path

Conversation

@jobordu
Copy link
Copy Markdown

@jobordu jobordu commented May 13, 2026

Summary

/nf:quorum silently omitted Daintree-imported slots from the team. Reported live today — a fresh-session quorum run dispatched 5 slots (codex-1, gemini-1, opencode-1, copilot-1, claude-1) when 7 were available (claude-z-ai, claude-minimax missing from the team JSON).

Root cause

quorum-preflight.cjs --team reads providers.json from one of:

  1. __dirname/providers.json (= ~/.claude/nf-bin/)
  2. ~/.claude/nf-bin/providers.json (same as 1 in installed state)

But /nf:link-daintree writes preset-cloned slots to ~/.claude/nf/bin/providers.json (slash) — which is also what mcpServers' UNIFIED_PROVIDERS_CONFIG references and the canonical runtime source. The dash path lags behind for fan-out additions.

So the preflight saw 5 slots, never the 7 the user actually had.

Fix

Both quorum-preflight.cjs and call-quorum-slot.cjs:

  • Prefer the slash path in findProviders().
  • Skip empty files (the shipped repo source is empty by design) so resolution falls through to the next candidate instead of returning an empty list.

Verified live

$ node ~/.claude/nf-bin/quorum-preflight.cjs --team | jq 'keys'
# Before: ["codex-1","gemini-1","opencode-1","copilot-1","claude-1"]  (5)
# After:  ["codex-1","gemini-1","opencode-1","copilot-1","claude-1","claude-z-ai","claude-minimax"]  (7) ✓

Test plan

  • npm run test:ci — 1550 pass, 0 fail
  • Live: --team now returns all 7 slots
  • After merge + install + Claude Code restart: /nf:quorum <q> includes claude-z-ai/claude-minimax in available slots

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes

    • Refined provider discovery to better identify available providers through improved path detection and file validation.
    • Enhanced health probing with type-specific handling—HTTP providers receive full API health checks while non-HTTP providers use simplified probing.
  • Improvements

    • Provider configuration files with missing or empty provider definitions are now skipped during discovery.

Review Change Stack

…isible

quorum-preflight.cjs and call-quorum-slot.cjs both searched for providers.json
at __dirname (nf-bin/) first, then ~/.claude/nf-bin/. But /nf:link-daintree
writes preset-cloned slots to the slash path (~/.claude/nf/bin/) — which is
also what mcpServers UNIFIED_PROVIDERS_CONFIG references and the canonical
runtime source. The dash path lags behind for Daintree fan-out additions.

Result: every quorum run silently omitted Daintree-imported slots. Reported
live today — /nf:quorum dispatched 5 slots (codex-1, gemini-1, opencode-1,
copilot-1, claude-1) when 7 were available (claude-z-ai and claude-minimax
missing from the team JSON).

Fix: prefer the slash path in both findProviders helpers. Also skip empty
files (the shipped repo source is empty by design) so resolution falls
through to the next candidate instead of returning a no-slots list.

Verified: `quorum-preflight.cjs --team` now returns all 7 slots after
syncing the fix; previously returned 5.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 13, 2026 07:28
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot wasn't able to review any files in this pull request.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 13, 2026

Walkthrough

Both bin/call-quorum-slot.cjs and bin/quorum-preflight.cjs are updated to prefer a canonical ~/.claude/nf/bin/providers.json path and validate non-empty provider arrays. Additionally, health probing in quorum-preflight.cjs is constrained to HTTP-type slots only, with related terminology adjustments in comments and logs.

Changes

Provider discovery and health probing

Layer / File(s) Summary
Provider discovery path precedence and validation
bin/call-quorum-slot.cjs, bin/quorum-preflight.cjs
Both scripts update findProviders() to check ~/.claude/nf/bin/providers.json first, then fall back to existing paths. Validation now requires the parsed providers field to be a non-empty array; files with missing or empty providers are skipped and the search continues.
Health probing constraints to HTTP slots and terminology updates
bin/quorum-preflight.cjs
probeHealth() Layer 2 upstream probing is limited to HTTP-type slots; non-HTTP providers are marked as having no upstream API probe available. Tier-ordering and dedup comments, plus one log message, are updated to reflect "CLI primary" instead of "CLI/CCR primary" and distinguish "CLI/HTTP" instead of "CCR/API" terminology.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • nForma-AI/nForma#150: Both PRs modify the providers.json discovery/handling contract—main PR adjusts findProviders() to prefer ~/.claude/nf/bin/providers.json and skip empty providers arrays, while the retrieved PR syncs/synthesizes providers.json into that same path when the repo file is empty.

  • nForma-AI/nForma#158: Both PRs are tied to Daintree/CCR slot health signaling: the main PR adjusts provider discovery and quorum preflight health probing to correctly include/handle Daintree slot providers, while the retrieved PR changes unified-mcp-server.mjs to always register health_check for ccr/subprocess providers (and adds a smoke probe to verify it).

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: preferring the slash-path providers.json to ensure Daintree slots are visible in quorum.
Description check ✅ Passed The description provides comprehensive coverage of the problem, root cause, fix, and verification, though some template sections are incomplete or omitted.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/quorum-preflight-prefer-slash-path

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

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

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
bin/quorum-preflight.cjs (1)

297-310: ⚡ Quick win

Layer 2 constraint correctly isolates HTTP probing; update outdated documentation.

Layer 2 is correctly constrained to HTTP-only slots. Non-HTTP (CLI/CCR) slots skip Layer 2 with reason: 'no upstream API' and remain healthy/unhealthy based on Layer 1 (binary probe) and Layer 3 (inference history from quorum-failures.json). No existing workflows are broken—health detection for all slot types is intact.

However, the file header comment (line 22) still documents Layer 2 as "Upstream API probe — GET /models for ccr-backed slots," which contradicts the implementation. Update it to reflect that Layer 2 is HTTP-only.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@bin/quorum-preflight.cjs` around lines 297 - 310, Update the file header
comment that currently reads "Upstream API probe — GET /models for ccr-backed
slots" to accurately reflect the implementation that Layer 2 is HTTP-only: note
that Layer 2 probes use baseUrl/apiKey for HTTP slots (isHttp true), and
non-HTTP slots are skipped (layer2Promise resolves with { ok: true, skipped:
true, reason: 'no upstream API' } or 'baseUrl not configured'). Mention that
Layer 2 is skipped for CLI/CCR slots and that health for those slots is
determined by Layer 1 and Layer 3 (binary probe and
quorum-failures.json/inference history), so the header comment aligns with the
behavior around isHttp, layer2Promise, baseUrl and apiKey.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@bin/quorum-preflight.cjs`:
- Around line 297-310: Update the file header comment that currently reads
"Upstream API probe — GET /models for ccr-backed slots" to accurately reflect
the implementation that Layer 2 is HTTP-only: note that Layer 2 probes use
baseUrl/apiKey for HTTP slots (isHttp true), and non-HTTP slots are skipped
(layer2Promise resolves with { ok: true, skipped: true, reason: 'no upstream
API' } or 'baseUrl not configured'). Mention that Layer 2 is skipped for CLI/CCR
slots and that health for those slots is determined by Layer 1 and Layer 3
(binary probe and quorum-failures.json/inference history), so the header comment
aligns with the behavior around isHttp, layer2Promise, baseUrl and apiKey.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 757e981e-19f0-4c9c-84ec-b11bfeea3c9a

📥 Commits

Reviewing files that changed from the base of the PR and between 8ef5eca and dea618b.

📒 Files selected for processing (2)
  • bin/call-quorum-slot.cjs
  • bin/quorum-preflight.cjs

@jobordu jobordu merged commit b8c5a14 into main May 13, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants