@delegance/claude-autopilot 5.0.3 → 5.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,6 +3,16 @@ import { GuardrailError } from "../../core/errors.js";
3
3
  import { classifyError } from "../review-engine/prompt-builder.js";
4
4
  const SYSTEM_PROMPT = `You are a technical advisor reviewing a software design decision. Evaluate the provided context and question critically. Be direct and specific. Surface tradeoffs, risks, and your recommendation.`;
5
5
  const MAX_OUTPUT_TOKENS = 2048;
6
+ // Models that ONLY work via the Responses API (not chat.completions).
7
+ // Codex variants and the o-series reasoning models all 404 on chat.completions.
8
+ // Without this branch, putting `gpt-5.3-codex` (the typical default) in
9
+ // council.models throws model_not_found, AND the synthesizer (also typically
10
+ // gpt-5.3-codex) fails the same way — so the whole council returns `partial`
11
+ // with no synthesis. That regression made the marketed multi-model differentiator
12
+ // unusable for any user who only had OPENAI_API_KEY.
13
+ function isResponsesOnlyModel(model) {
14
+ return /codex|^o[1-9]|^gpt-5\.3-/i.test(model);
15
+ }
6
16
  export function makeOpenAICouncilAdapter(model, label) {
7
17
  return {
8
18
  label,
@@ -12,27 +22,36 @@ export function makeOpenAICouncilAdapter(model, label) {
12
22
  throw new GuardrailError('OPENAI_API_KEY not set', { code: 'auth', provider: 'openai' });
13
23
  }
14
24
  const client = new OpenAI({ apiKey });
15
- let response;
25
+ const userInput = `## Context\n\n${context}\n\n## Question\n\n${prompt}`;
16
26
  try {
17
- response = await client.chat.completions.create({
27
+ if (isResponsesOnlyModel(model)) {
28
+ const response = await client.responses.create({
29
+ model,
30
+ instructions: SYSTEM_PROMPT,
31
+ input: userInput,
32
+ max_output_tokens: MAX_OUTPUT_TOKENS,
33
+ });
34
+ return response.output_text ?? '';
35
+ }
36
+ const response = await client.chat.completions.create({
18
37
  model,
19
38
  max_tokens: MAX_OUTPUT_TOKENS,
20
39
  messages: [
21
40
  { role: 'system', content: SYSTEM_PROMPT },
22
- { role: 'user', content: `## Context\n\n${context}\n\n## Question\n\n${prompt}` },
41
+ { role: 'user', content: userInput },
23
42
  ],
24
43
  });
44
+ return response.choices[0]?.message?.content ?? '';
25
45
  }
26
46
  catch (err) {
27
47
  const message = err instanceof Error ? err.message : String(err);
28
48
  const code = classifyError(message);
29
- throw new GuardrailError(`OpenAI council call failed: ${message}`, {
49
+ throw new GuardrailError(`OpenAI council call failed (model=${model}): ${message}`, {
30
50
  code,
31
51
  provider: 'openai',
32
52
  retryable: code === 'rate_limit',
33
53
  });
34
54
  }
35
- return response.choices[0]?.message?.content ?? '';
36
55
  },
37
56
  };
38
57
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@delegance/claude-autopilot",
3
- "version": "5.0.3",
3
+ "version": "5.0.4",
4
4
  "type": "module",
5
5
  "description": "Autonomous development pipeline for Claude Code: brainstorm → spec → plan → implement → migrate → validate → PR → review → merge. Multi-model, local-first, every phase a skill you can intervene in.",
6
6
  "keywords": [
@@ -33,3 +33,15 @@ chunking:
33
33
  pipeline:
34
34
  runReviewOnStaticFail: true
35
35
  runReviewOnTestFail: false
36
+ # Optional: multi-model council. Uncomment + set ANTHROPIC_API_KEY and/or
37
+ # OPENAI_API_KEY. Models are dispatched in parallel; the synthesizer reads
38
+ # their responses and writes the consensus. Both APIs supported (chat-completions
39
+ # and Responses API for codex/o-series models — auto-detected by name).
40
+ # Usage: claude-autopilot council --prompt "..." --context-file <path>
41
+ # council:
42
+ # models:
43
+ # - { adapter: claude, model: claude-opus-4-7, label: opus }
44
+ # - { adapter: openai, model: gpt-5.3-codex, label: codex }
45
+ # synthesizer: { adapter: claude, model: claude-sonnet-4-6, label: synth }
46
+ # timeout_ms: 30000
47
+ # min_successful_responses: 1