Skip to content

Commit 219c9b0

Browse files
author
Manish
committed
fix(consensus): clean up intelephense warnings, force init re-prompt
- consensus.php: drop unused $baseTimeout param from synthesize() and analyze_differences() (and their call sites); remove deprecated curl_close() calls (no-op in PHP 8+). - init skill: add explicit instruction that Step 5 runs on every /mots:init, including re-runs — previous behavior short-circuited with "already configured" and skipped the consensus re-check.
1 parent 5576ef1 commit 219c9b0

2 files changed

Lines changed: 4 additions & 6 deletions

File tree

bin/consensus.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,6 @@ function fan_out(string $prompt, array $keys, int $timeout, ?string $logFile = n
242242
$curlError = $curlErrno !== CURLE_OK ? (curl_strerror($curlErrno) ?: curl_error($ch)) : curl_error($ch);
243243

244244
curl_multi_remove_handle($mh, $ch);
245-
curl_close($ch);
246245

247246
if ($curlError !== '') {
248247
$reason = match ($curlErrno) {
@@ -314,7 +313,6 @@ function call_claude_judge(string $prompt, string $apiKey, string $model, int $t
314313
$raw = curl_exec($ch);
315314
$httpCode = (int) curl_getinfo($ch, CURLINFO_HTTP_CODE);
316315
$curlError = curl_error($ch);
317-
curl_close($ch);
318316

319317
if ($curlError !== '') {
320318
stderr("Judge cURL error: {$curlError}", $logFile);
@@ -332,7 +330,7 @@ function call_claude_judge(string $prompt, string $apiKey, string $model, int $t
332330

333331
// ─── Synthesis ──────────────────────────────────────────────────────────────
334332

335-
function synthesize(array $responses, string $originalPrompt, string $phaseName, string $judgeModel, string $anthropicKey, int $baseTimeout, ?string $logFile = null): ?string {
333+
function synthesize(array $responses, string $originalPrompt, string $phaseName, string $judgeModel, string $anthropicKey, ?string $logFile = null): ?string {
336334
$sections = build_response_sections($responses);
337335

338336
$metaPrompt = <<<PROMPT
@@ -393,7 +391,7 @@ function synthesize(array $responses, string $originalPrompt, string $phaseName,
393391

394392
// ─── Differences analysis ───────────────────────────────────────────────────
395393

396-
function analyze_differences(array $responses, string $originalPrompt, string $judgeModel, string $anthropicKey, int $baseTimeout, ?string $logFile = null): ?string {
394+
function analyze_differences(array $responses, string $originalPrompt, string $judgeModel, string $anthropicKey, ?string $logFile = null): ?string {
397395
$succeeded = array_filter($responses, fn($r) => $r !== null);
398396
if (count($succeeded) < 2) {
399397
stderr('Need at least 2 responses to analyze differences.', $logFile);
@@ -624,7 +622,6 @@ function main(array $argv): int {
624622
$phase,
625623
$judgeModel,
626624
$keys['ANTHROPIC_API_KEY'] ?? '',
627-
$fanoutTimeout,
628625
$logFile
629626
);
630627

@@ -645,7 +642,6 @@ function main(array $argv): int {
645642
$prompt,
646643
$judgeModel,
647644
$keys['ANTHROPIC_API_KEY'] ?? '',
648-
$fanoutTimeout,
649645
$logFile
650646
);
651647

skills/init/SKILL.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ Set up motspilot in the current project directory.
2727

2828
5. **Set up consensus (interactive — must block and wait):**
2929

30+
This step runs on EVERY `/mots:init`, including re-runs on an already-configured project. Do NOT short-circuit with "config is already configured, nothing to do" — the whole point of re-running `/mots:init` is usually that the user just added keys and wants consensus enabled. Always perform the checks below, always re-evaluate `CONSENSUS`, and always prompt via `AskUserQuestion` when keys are missing.
31+
3032
Check if consensus can run:
3133
- Run `php --version` — is PHP 8.0+ available?
3234
- Check process env for `$ANTHROPIC_API_KEY`, `$OPENAI_API_KEY`, `$GEMINI_API_KEY`.

0 commit comments

Comments
 (0)