ai-consultants 4.0.1 → 4.0.3

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.
package/.env.example CHANGED
@@ -188,13 +188,17 @@ QWEN3_CMD=qwen
188
188
  # is installed; the xAI API is selected when the CLI is unavailable and a key
189
189
  # exists. A failed CLI launch also falls back to the API at runtime.
190
190
  # GROK_USE_API=false
191
+ # Grok OAuth concurrency: shared keeps one runner-owned credential generation
192
+ # so parallel consultants can safely reuse refresh rotation. serialized holds
193
+ # the adapter lock for the full CLI call and is intended for diagnostics.
194
+ # GROK_OAUTH_MODE=shared
191
195
 
192
196
  # =============================================================================
193
197
  # API-ONLY AND FALLBACK CONFIGURATION
194
198
  # =============================================================================
195
199
 
196
200
  # GLM - The Methodologist
197
- GLM_MODEL=glm-5.3
201
+ GLM_MODEL=glm-5.3-flash
198
202
  GLM_TIMEOUT=180
199
203
  GLM_API_MAX_TOKENS=16384
200
204
  GLM_API_URL=https://api.z.ai/api/coding/paas/v4/chat/completions
@@ -205,6 +209,7 @@ GROK_CMD=grok
205
209
  GROK_MODEL=grok-4.6
206
210
  GROK_TIMEOUT=180
207
211
  GROK_MAX_TURNS=4
212
+ GROK_OAUTH_MODE=shared
208
213
  GROK_API_MAX_TOKENS=4096
209
214
  GROK_API_URL=https://api.x.ai/v1/chat/completions
210
215
  # GROK_REASONING_EFFORT= # max_quality sets xhigh (Grok Build maximum)
package/CLAUDE.md CHANGED
@@ -6,7 +6,7 @@ AI Consultants is a multi-model coverage system that queries up to 10 AI consult
6
6
 
7
7
  **Self-Exclusion**: The invoking agent is automatically excluded from both the panel and synthesis. Claude Code won't query or synthesize with Claude, Codex CLI won't query or synthesize with Codex, etc.
8
8
 
9
- **Version**: 4.0.1
9
+ **Version**: 4.0.3
10
10
 
11
11
  ## Distribution
12
12
 
@@ -393,7 +393,7 @@ All consultants now use premium models by default:
393
393
  | Codex | gpt-5.6-sol |
394
394
  | Mistral | CLI: mistral-medium-3.5; API: mistral-large-3 |
395
395
  | DeepSeek | deepseek-v4-pro |
396
- | GLM | glm-5.3 |
396
+ | GLM | glm-5.3-flash |
397
397
  | Grok | grok-4.6 |
398
398
  | Qwen3 | qwen3.7-max |
399
399
  | Kimi | kimi-code/k3 |
@@ -760,6 +760,27 @@ curl -fsSL https://raw.githubusercontent.com/matteoscurati/ai-consultants/main/s
760
760
 
761
761
  ## Changelog
762
762
 
763
+ ### v4.0.3
764
+
765
+ - **GLM's active catalog target moves from `glm-5.3` to `glm-5.3-flash` without changing transport or tier semantics.** `scripts/config.sh:189` changes the clean-install default, and the maximum/premium/standard branches at `scripts/config.sh:626-656` select the same exact provider ID. `max_quality` still supplies `GLM_REASONING_EFFORT=max`; economy deliberately remains `glm-4-flash`.
766
+ - **Existing managed installs advance without rewriting explicit choices.** `scripts/configure.sh:310-318` migrates the two exact historical generated defaults, `glm-5.2` and `glm-5.3`, to Flash and records `# ai-consultants:default`. A `# ai-consultants:pin` survives, including an explicit old `glm-5.3`; `scripts/test_configure.sh:449-461` covers both current-default migration and pin preservation.
767
+ - **Identity and pricing stay honest.** The OpenAI-compatible adapter sends `glm-5.3-flash`, `reasoning_effort=max`, and the 16,384-token GLM budget; the synthetic transport test requires provider-reported identity and requested-model metadata (`scripts/test_api_transport.sh:253-263`). `docs/cost_rates.json` marks Flash unpriced and retains a zero/unpriced entry for legacy `glm-5.3` pins, avoiding the generic fallback rate.
768
+ - **The exact ai-consultants transport completed one authorized no-retry live smoke.** Z.AI returned HTTP 200 and provider-reported `glm-5.3-flash` in about 12 seconds with 37 measured input tokens and 308 output tokens. The provider accepted max effort but returned near-structured text rather than the requested JSON; the adapter preserved `PONG` through its explicit unstructured fallback with confidence 5, so strict schema adherence is not claimed. PR #15 CI, the post-bump 23-suite gate, 452 core checks, configure 94/94, API transport 88/88, and ShellCheck are green.
769
+
770
+ Deliberately unchanged: `delegation-kit` remained read-only; its Claude-to-Z.AI gate and runner were not copied into this API-only consultant. Installation does not silently edit personal configuration, so an existing unpinned `.env` advances when the user runs `configure`; explicit pins remain user-owned. The separate `agent/model-defaults-4.1.0-wip` branch is not part of this patch release.
771
+
772
+ ### v4.0.2
773
+
774
+ - **The Grok adapter used to copy a rotating OAuth credential into a disposable HOME and delete any refreshed token at exit.** Parallel calls amplified the race: both could seed from one refresh token, one rotation vanished with its temp directory, and the ambient session could be left stale. `scripts/lib/grok_oauth.sh` now owns a durable generation under the XDG data root and `scripts/query_grok.sh` defaults to `GROK_OAUTH_MODE=shared`.
775
+ - **Shared means credential state only.** Every invocation still has a private HOME, workspace, prompt file, output, capability-probe HOME, permission mode, strict sandbox, empty tool surface, model, and effort. Concurrent processes use one runner-owned `GROK_HOME`, allowing Grok Build's native auth lock to coordinate refresh while inference remains outside the ai-consultants lock.
776
+ - **Publication is optimistic and atomic.** A recoverable directory lock bounds seed, bootstrap, inventory, and publication; valid rotation is staged mode 600 and renamed into the ambient `auth.json`. The marker binds generation and last-synced SHA-256. If a concurrent external `grok login` changes the ambient digest, that login wins, the consultation fails temporarily, and no API fallback occurs.
777
+ - **Malformed and obsolete state fails closed but recovers forward.** Corrupt credentials never replace ambient auth; dead locks are reclaimed; unpersistible refreshes publish no answer. A later run reseeds from valid ambient state. Generations carrying the exact legacy runner-owned `config.toml` signature are superseded without modification or deletion.
778
+ - **Grok 1.0.4 required exact-transport fixes beyond the reference implementation.** Its pristine-home bootstrap lazily creates metadata/cache/DB state; capability probes must use a separate credential-free HOME; authenticated inventory is bounded and coordinated. Provider-owned `config.toml` cannot be replaced before each inventory, and the display sentence “You are logged in with grok.com.” is not stable enough to be an auth gate. Exit 0, a still-valid credential, and the requested inventory model are the attestation.
779
+ - **Secrets remain private.** The prompt and tokens never enter argv. Grok dispatch uses redacted `run_query` errors, so token-shaped provider stderr is absent from stdout, normal logs, error envelopes, and artifacts. Forced API mode remains stateless; missing/auth-unavailable CLI fallback and post-dispatch fallback suppression are unchanged.
780
+ - **Verification closes both concurrency layers.** The adapter suite grows to 88 checks and covers simultaneous fake dispatch, rotation/reuse, external-login CAS, corrupt state, dead locks, atomic policy reconciliation, legacy migration, stateless API mode, serialized mode, and token leakage. A real two-process `grok-4.6`/`xhigh` smoke returned structured `PONG` twice with exit 0, no workspace changes, no API fallback, and fully aligned ambient/generation/marker state. Full gate: 23/23 suites, 452/452 core checks, ShellCheck and PR #14 CI green.
781
+
782
+ Deliberate residuals: superseded generations are retained because deleting one that an active process still references would be unsafe. Real forced refresh rotation and a real concurrent `grok login` were not induced; those conflict paths are verified with controlled fakes. The separate local 4.1.0 model-default WIP is not part of this release.
783
+
763
784
  ### v4.0.1
764
785
 
765
786
  - **The installer's first line of user-visible output was six major/minor generations stale.** `scripts/install.sh:53` printed `AI Consultants v2.10 - Installation` even while the public binary, package metadata, npm registry, active checkout, and doctor all reported v4.0.0. That did not change installed bytes or runtime behavior, but it made a successful v4 install look wrong at the exact moment users were deciding whether to trust it.
package/README.md CHANGED
@@ -1,8 +1,8 @@
1
- # AI Consultants v4.0.1
1
+ # AI Consultants v4.0.3
2
2
 
3
3
  > **Coverage, not a single guess.** A panel of up to 10 frontier models from different vendors fans out on your question in parallel and hands you the *union* of what they collectively see — the risks, edge cases, and approaches a single model misses.
4
4
 
5
- [![Version](https://img.shields.io/badge/version-4.0.1-blue.svg)](https://github.com/matteoscurati/ai-consultants)
5
+ [![Version](https://img.shields.io/badge/version-4.0.3-blue.svg)](https://github.com/matteoscurati/ai-consultants)
6
6
  [![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)
7
7
  [![Claude Code Skill](https://img.shields.io/badge/Claude%20Code-Skill-orange.svg)](https://docs.anthropic.com/en/docs/claude-code/skills)
8
8
  [![GitHub stars](https://img.shields.io/github/stars/matteoscurati/ai-consultants?style=social)](https://github.com/matteoscurati/ai-consultants)
@@ -389,7 +389,16 @@ Grok uses Grok Build with `grok-4.6` in an isolated, tool-free sandbox. Prompts
389
389
  are passed through a private file rather than process arguments. It falls back
390
390
  to the xAI API only when the CLI is missing, cannot launch, or has no usable
391
391
  authentication and `GROK_API_KEY` is configured; post-launch request failures
392
- are surfaced without a silent API charge. Qwen3 and MiniMax can also switch
392
+ are surfaced without a silent API charge. Grok CLI OAuth defaults to concurrent
393
+ `shared` mode: HOME, workspace, prompt, output, permissions, and agent state
394
+ remain isolated per invocation, while processes share one runner-owned
395
+ persistent `GROK_HOME` so the CLI's own auth lock can coordinate refresh.
396
+ Credential adoption/publication uses a short lock and digest CAS, so an
397
+ external `grok login` wins and the affected run fails without overwriting it or
398
+ falling back to the API. Set `GROK_OAUTH_MODE=serialized` only for diagnostic
399
+ full-run serialization. A new generation performs one locked inventory
400
+ bootstrap because Grok 1.0.4 lazily initializes home metadata; inference is
401
+ never serialized by that bootstrap. Qwen3 and MiniMax can also switch
393
402
  from their CLI to API transport. Gemini, Codex, Claude, and Mistral are
394
403
  CLI/API switchable. Gemini, Grok, and Kimi verify the requested model
395
404
  against the CLI inventory before dispatch when that inventory exists. Grok and
@@ -402,7 +411,7 @@ the observed version is response provenance only.
402
411
 
403
412
  | Consultant | Default Model | Persona | Focus |
404
413
  |------------|---------------|---------|-------|
405
- | **GLM** | glm-5.3 | The Methodologist | Structured approaches |
414
+ | **GLM** | glm-5.3-flash | The Methodologist | Structured approaches |
406
415
  | **DeepSeek** | deepseek-v4-pro | The Code Specialist | Algorithms, code generation |
407
416
 
408
417
  ### Installing Consultant CLIs
@@ -474,7 +483,7 @@ detail instead of reducing every consultant to its summary.
474
483
  | Mistral CLI | mistral-medium-3.5 | mistral-medium-3.5 | mistral-medium-3.5 | devstral-small-2 |
475
484
  | Mistral API | mistral-large-3 | mistral-large-3 | mistral-large-3 | mistral-large-3 |
476
485
  | DeepSeek | deepseek-v4-pro | deepseek-v4-pro | deepseek-v4-flash | deepseek-v4-flash |
477
- | GLM | glm-5.3 | glm-5.3 | glm-5.3 | glm-4-flash |
486
+ | GLM | glm-5.3-flash | glm-5.3-flash | glm-5.3-flash | glm-4-flash |
478
487
  | Grok | grok-4.6 | grok-4.6 | grok-4.5 | grok-4.5 |
479
488
  | Qwen3 | qwen3.8-max when Token Plan is configured; otherwise qwen3.7-max | qwen3.7-max | qwen3.6-35b-a3b | qwen3-32b |
480
489
  | Kimi | kimi-code/k3-256k | kimi-code/k3 | kimi-code/k3 | kimi-code/k3 |
package/SKILL.md CHANGED
@@ -5,10 +5,10 @@ license: MIT
5
5
  compatibility: Requires bash, jq, and at least 2 AI CLI tools (agy, codex, vibe, etc.). macOS and Linux.
6
6
  metadata:
7
7
  author: matteoscurati
8
- version: 4.0.1
8
+ version: 4.0.3
9
9
  ---
10
10
 
11
- # AI Consultants v4.0.1 - AI Expert Panel
11
+ # AI Consultants v4.0.3 - AI Expert Panel
12
12
 
13
13
  **Coverage, not a single guess.** Convene a panel of AI "consultants" from different vendors for coding questions: they fan out in parallel and you get the *union* of what they collectively see — the risks, edge cases, and approaches a single model misses. Each consultant has a **configurable persona** that decorrelates its analysis.
14
14
 
@@ -88,6 +88,14 @@ Configuration (presets, strategies, features, personas, API keys) can be managed
88
88
 
89
89
  **CLI/API Mode**: Gemini, Codex, Claude, Mistral, Qwen, Grok, and MiniMax can switch between CLI and API mode via `*_USE_API` environment variables. Grok is CLI-first on Grok Build with `grok-4.6` and falls back to the xAI API when the CLI cannot run. Gemini auto-selects API mode when `GEMINI_API_KEY` is set (no `agy` install needed) and the CLI otherwise. Mistral keeps separate API (`MISTRAL_MODEL`) and Vibe (`MISTRAL_CLI_MODEL`) identifiers.
90
90
 
91
+ Grok CLI OAuth defaults to `GROK_OAUTH_MODE=shared`: concurrent invocations
92
+ share one runner-owned persistent `GROK_HOME` so the vendor auth lock can
93
+ coordinate refresh, while HOME, workspace, prompt, output, permissions, and
94
+ agent state remain isolated per invocation. A short adapter lock publishes a
95
+ valid rotated credential atomically; an external `grok login` wins the CAS and
96
+ makes the affected run fail without API fallback. `serialized` remains an
97
+ explicit diagnostic mode. Forced API mode stays stateless.
98
+
91
99
  Grok and Kimi are compatible by capability rather than by CLI version. Before
92
100
  dispatch, their adapters verify the required headless arguments, requested
93
101
  model, and structured-output surface. Compatible version changes are accepted;
@@ -1,4 +1,4 @@
1
- # Cost Rates - AI Consultants v4.0.1
1
+ # Cost Rates - AI Consultants v4.0.3
2
2
 
3
3
  This page documents the per-token rates used by the cost tracking system.
4
4
 
@@ -45,7 +45,8 @@ models programmatically.
45
45
  | gemini-3-flash | Legacy | $0.0005 | Removed Cursor consultant |
46
46
  | deepseek-v4-pro | Premium | $0.000435 | DeepSeek |
47
47
  | deepseek-v4-flash | Standard/Economy | $0.00014 | DeepSeek |
48
- | glm-5.3 | Maximum/Premium/Standard | Unpriced | GLM coding-plan endpoint |
48
+ | glm-5.3-flash | Maximum/Premium/Standard | Unpriced | GLM coding-plan endpoint |
49
+ | glm-5.3 | Legacy pins | Unpriced | GLM coding-plan endpoint |
49
50
  | glm-4-flash | Economy | $0.001 | GLM |
50
51
  | grok-4.6 | Maximum/Premium | $0.002 | Grok |
51
52
  | grok-4.5 | Standard/Economy | $0.002 | Grok |
@@ -86,7 +87,8 @@ models programmatically.
86
87
  | gemini-3-flash | Legacy | $0.003 | Removed Cursor consultant |
87
88
  | deepseek-v4-pro | Premium | $0.00087 | DeepSeek |
88
89
  | deepseek-v4-flash | Standard/Economy | $0.00028 | DeepSeek |
89
- | glm-5.3 | Maximum/Premium/Standard | Unpriced | GLM coding-plan endpoint |
90
+ | glm-5.3-flash | Maximum/Premium/Standard | Unpriced | GLM coding-plan endpoint |
91
+ | glm-5.3 | Legacy pins | Unpriced | GLM coding-plan endpoint |
90
92
  | glm-4-flash | Economy | $0.003 | GLM |
91
93
  | grok-4.6 | Maximum/Premium | $0.006 | Grok |
92
94
  | grok-4.5 | Standard/Economy | $0.006 | Grok |
@@ -174,7 +176,8 @@ the providers' official pricing pages: [Anthropic](https://platform.claude.com/d
174
176
  [MiniMax](https://platform.minimax.io/docs/guides/pricing-paygo). Gemini 3.7's
175
177
  listed rate is the promotion effective through December 31, 2026.
176
178
 
177
- `glm-5.3`, `qwen3.8-max`, and `kimi-code/k3-256k` are explicitly unpriced on
179
+ `glm-5.3-flash`, legacy-pinned `glm-5.3`, `qwen3.8-max`, and
180
+ `kimi-code/k3-256k` are explicitly unpriced on
178
181
  the transports used here. Their zero catalog entries prevent the estimator from
179
182
  inventing a dollar figure; session reports disclose their exclusion rather than
180
183
  presenting them as free.
package/docs/SETUP.md CHANGED
@@ -396,6 +396,17 @@ INVOKING_AGENT=codex ./scripts/consult_all.sh "Question"
396
396
 
397
397
  Seven consultants can switch between CLI mode (using local CLI tools) and API mode (direct API calls): **Gemini, Codex, Claude, Mistral, Qwen3, Grok, and MiniMax**. Grok is CLI-first and runs in an isolated, tool-free strict sandbox. It falls back automatically only when Grok Build is missing, cannot launch, or lacks usable authentication and a key is available; request failures after launch are surfaced without an API fallback.
398
398
 
399
+ Grok's normal OAuth mode is `GROK_OAUTH_MODE=shared`, which is safe for the
400
+ parallel panel: each call gets a private HOME/workspace/prompt/output, while a
401
+ runner-owned persistent `GROK_HOME` lets Grok Build coordinate token refresh
402
+ with its own lock. A short ai-consultants lock atomically seeds and publishes
403
+ valid generations; a concurrent external `grok login` wins the CAS and makes
404
+ the affected run fail without an API fallback. Use
405
+ `GROK_OAUTH_MODE=serialized` only as a diagnostic fallback. Forced API mode is
406
+ stateless and does not read or create the shared OAuth generation. A newly
407
+ created shared generation runs one locked inventory bootstrap to let Grok 1.0.4
408
+ initialize its home metadata; the lock is released before inference.
409
+
399
410
  ### Why Use API Mode?
400
411
 
401
412
  - **No CLI installation required**: Use API keys without installing CLI tools
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "4.0.1",
2
+ "version": "4.0.3",
3
3
  "updated": "2026-08-23",
4
4
  "models": {
5
5
  "_comment_units": "All rates are USD per 1,000 tokens (per-1K). lib/costs.sh computes cost as (token_count / 1000) * rate, so every value here MUST be a per-1K rate = (provider $/1M price) / 1000. Do NOT paste $/MTok figures directly.",
@@ -402,6 +402,10 @@
402
402
  "input": 0,
403
403
  "output": 0
404
404
  },
405
+ "glm-5.3-flash": {
406
+ "input": 0,
407
+ "output": 0
408
+ },
405
409
  "kimi-code/k3-256k": {
406
410
  "input": 0,
407
411
  "output": 0
@@ -411,6 +415,7 @@
411
415
  "qwen3.8-max",
412
416
  "qwen3.8-max-preview",
413
417
  "glm-5.3",
418
+ "glm-5.3-flash",
414
419
  "kimi-code/k3-256k"
415
420
  ],
416
421
  "consultant_fallbacks": {
@@ -420,7 +425,7 @@
420
425
  "codex": "gpt-5.6-sol",
421
426
  "mistral": "mistral-large-3",
422
427
  "deepseek": "deepseek-v4-pro",
423
- "glm": "glm-5.3",
428
+ "glm": "glm-5.3-flash",
424
429
  "grok": "grok-4.6",
425
430
  "qwen3": "qwen3.7-max",
426
431
  "kimi": "kimi-code/k3",
@@ -434,7 +439,7 @@
434
439
  "codex": "gpt-5.6-sol",
435
440
  "mistral": "mistral-medium-3.5",
436
441
  "deepseek": "deepseek-v4-pro",
437
- "glm": "glm-5.3",
442
+ "glm": "glm-5.3-flash",
438
443
  "grok": "grok-4.6",
439
444
  "qwen3": "qwen3.8-max",
440
445
  "kimi": "kimi-code/k3-256k",
@@ -446,7 +451,7 @@
446
451
  "codex": "gpt-5.6-sol",
447
452
  "mistral": "mistral-medium-3.5",
448
453
  "deepseek": "deepseek-v4-pro",
449
- "glm": "glm-5.3",
454
+ "glm": "glm-5.3-flash",
450
455
  "grok": "grok-4.6",
451
456
  "qwen3": "qwen3.7-max",
452
457
  "kimi": "kimi-code/k3",
@@ -458,7 +463,7 @@
458
463
  "codex": "gpt-5.6-terra",
459
464
  "mistral": "mistral-medium-3.5",
460
465
  "deepseek": "deepseek-v4-flash",
461
- "glm": "glm-5.3",
466
+ "glm": "glm-5.3-flash",
462
467
  "grok": "grok-4.5",
463
468
  "qwen3": "qwen3.6-35b-a3b",
464
469
  "kimi": "kimi-code/k3",
@@ -0,0 +1,98 @@
1
+ # Release v4.0.2
2
+
3
+ **Date:** 2026-08-28
4
+
5
+ **Type:** Patch — concurrency-safe Grok OAuth
6
+
7
+ **Previous:** v4.0.1
8
+
9
+ ## Highlights
10
+
11
+ - Parallel Grok Build consultations can now share rotating OAuth safely without sharing agent state.
12
+ - Refreshed credentials survive temporary HOME cleanup and are published atomically to the ambient session.
13
+ - A concurrent external `grok login` always wins; the affected consultation fails without overwriting it or creating an API charge.
14
+ - A real two-process `grok-4.6` smoke returned two structured `PONG` responses with exit 0.
15
+
16
+ ## What's New
17
+
18
+ ### Shared OAuth by default
19
+
20
+ `GROK_OAUTH_MODE=shared` is now the normal Grok CLI path. The runner maintains one persistent credential generation under:
21
+
22
+ ```text
23
+ $XDG_DATA_HOME/ai-consultants/grok-shared-oauth
24
+ ```
25
+
26
+ Only `GROK_HOME` is shared. Each consultation still receives an independent HOME, workspace, private prompt, output, capability-probe environment, strict sandbox, empty tool surface, model, and effort.
27
+
28
+ Grok Build's own auth lock coordinates token refresh between concurrent processes. The ai-consultants lock is used only for bounded seed, first-use bootstrap, authenticated inventory, and publication — never for inference.
29
+
30
+ ### Atomic refresh publication and CAS
31
+
32
+ The shared marker binds the active generation to the SHA-256 of the credential last synchronized with ambient `~/.grok/auth.json`.
33
+
34
+ After a run:
35
+
36
+ - unchanged valid credentials require no write;
37
+ - a valid rotation is copied into a mode-600 candidate and atomically renamed;
38
+ - malformed rotation fails closed;
39
+ - a changed ambient digest means an external login won, so the run fails temporarily and publishes no successful answer;
40
+ - a publication failure never triggers the separately billed xAI API fallback.
41
+
42
+ `GROK_OAUTH_MODE=serialized` remains available for diagnostic comparison and holds the runner lock across the complete CLI call.
43
+
44
+ ### Provider-owned configuration
45
+
46
+ Grok 1.0.4 lazily creates provider-required metadata, caches, DBs, and `config.toml`. ai-consultants therefore preserves that file and stores its own atomic contract in `.ai-consultants-policy.json`. The effective agent restrictions remain pinned through the invocation arguments.
47
+
48
+ Generations produced by the earlier development runner are recognized from their exact legacy config signature and superseded without deletion or mutation.
49
+
50
+ ### Sanitized failures
51
+
52
+ Grok requests use redacted retry logging. Token-shaped provider stderr remains only in ephemeral private storage and never reaches argv, stdout, logs, error envelopes, or consultation artifacts.
53
+
54
+ ## Breaking Changes
55
+
56
+ None. `shared` replaces the unsafe disposable-copy behavior for CLI OAuth, but model, effort, permissions, sandbox, response schema, API transport, and fallback classification remain unchanged.
57
+
58
+ Users who need full-run serialization for diagnosis can set:
59
+
60
+ ```bash
61
+ GROK_OAUTH_MODE=serialized
62
+ ```
63
+
64
+ ## Upgrade Guide
65
+
66
+ ```bash
67
+ # npx, after npm publishes 4.0.2
68
+ npx ai-consultants@4.0.2 version
69
+
70
+ # active git-clone installation
71
+ cd ~/.claude/skills/ai-consultants && git pull
72
+ ```
73
+
74
+ No login or configuration migration is required. The first shared run seeds from the existing ambient Grok credential. No API key is copied or created.
75
+
76
+ ## Verification
77
+
78
+ - Grok adapter: 88/88 checks
79
+ - Configurator: 91/91 checks
80
+ - Core gate: 452/452 checks
81
+ - Full local gate: 23/23 suites
82
+ - ShellCheck, JSON validation, npm tarball, and `git diff --check`: passed
83
+ - PR #14 CI on exact head `883fad7`: passed
84
+ - Real concurrent smoke: two exit-0 structured `PONG` responses, CLI transport, `grok-4.6`, `xhigh`, no workspace/runtime/lock residue, no API fallback, valid and hash-aligned ambient/generation/marker state
85
+
86
+ ## Provider-Specific Residuals
87
+
88
+ - Real token rotation during concurrent inference was not forced; rotation/reuse is verified synthetically.
89
+ - A real concurrent external `grok login` was not induced; external-login precedence is verified synthetically.
90
+ - Superseded generations are retained to avoid deleting state still referenced by an active process.
91
+
92
+ ## Commits
93
+
94
+ - `6c9e4b2` Merge pull request #14
95
+
96
+ ## Contributors
97
+
98
+ - @matteoscurati
@@ -0,0 +1,62 @@
1
+ # Release v4.0.3
2
+
3
+ **Date:** 2026-08-29
4
+ **Type:** Patch — upgrade the GLM consultant to GLM-5.3-Flash
5
+ **Previous:** v4.0.2
6
+
7
+ ## Highlights
8
+
9
+ - GLM uses `glm-5.3-flash` in maximum, premium, and standard tiers.
10
+ - `max_quality` continues to request GLM's `max` reasoning effort; the economy tier remains `glm-4-flash`.
11
+ - Existing managed GLM defaults migrate forward while explicit model pins survive.
12
+ - A real single-attempt Z.AI smoke confirmed the exact model and API transport.
13
+
14
+ ## What's New
15
+
16
+ ### GLM-5.3-Flash default
17
+
18
+ New installations and runs without a GLM model override now request `glm-5.3-flash`. The same exact identifier is selected by the maximum, premium, and standard model tiers. This release does not change the Z.AI OpenAI-compatible endpoint, response budget, panel composition, routing affinities, or GLM's Methodologist persona.
19
+
20
+ `max_quality` still sends `reasoning_effort=max` and a 16,384-token response budget. The economy preset remains on `glm-4-flash`.
21
+
22
+ ### Managed migration and cost disclosure
23
+
24
+ When `ai-consultants configure` rewrites a configuration, the exact historical generated values `glm-5.2` and `glm-5.3` advance to `glm-5.3-flash`. Values marked `# ai-consultants:pin` remain untouched.
25
+
26
+ GLM-5.3-Flash is explicitly listed as unpriced on the Coding Plan transport. The catalog also keeps legacy `glm-5.3` pins unpriced, preventing the estimator from presenting a fabricated fallback dollar rate.
27
+
28
+ ### Exact-transport verification
29
+
30
+ One authorized live smoke used the shipped `query_glm.sh` adapter, the Z.AI OpenAI-compatible endpoint, `glm-5.3-flash`, max effort, a single attempt, and no retry. It completed with HTTP 200 and exit 0 in about 12 seconds; the response reported the exact requested model and measured 37 input plus 308 output tokens.
31
+
32
+ The model returned near-structured text rather than the requested JSON. The adapter handled that response as designed: it retained the `PONG` content, labeled the answer as an unstructured-provider fallback, reduced confidence to 5, and disclosed the format caveat. This smoke therefore attests transport, authentication, model identity, max-effort acceptance, token accounting, and fallback behavior; it does not claim strict JSON adherence from every GLM-5.3-Flash response.
33
+
34
+ ## Breaking Changes
35
+
36
+ None — this release is backwards-compatible. Explicit GLM model pins are preserved.
37
+
38
+ ## Upgrade Guide
39
+
40
+ ```bash
41
+ # npx (no install)
42
+ npx ai-consultants "question"
43
+
44
+ # git clone install
45
+ cd ~/.claude/skills/ai-consultants && git pull
46
+
47
+ # curl | bash install
48
+ curl -fsSL https://raw.githubusercontent.com/matteoscurati/ai-consultants/main/scripts/install.sh | bash
49
+ ```
50
+
51
+ New installations use GLM-5.3-Flash automatically. Existing installations with an unpinned managed GLM value should run:
52
+
53
+ ```bash
54
+ ai-consultants configure --force
55
+ ```
56
+
57
+ Alternatively, set `GLM_MODEL=glm-5.3-flash` explicitly. A value marked `# ai-consultants:pin` will not be migrated.
58
+
59
+ ## Commits
60
+
61
+ - `fc6aa85` feat: upgrade GLM default to 5.3 Flash
62
+ - `b2690c3` Merge pull request #15 from matteoscurati/agent/glm-5.3-flash
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai-consultants",
3
- "version": "4.0.1",
3
+ "version": "4.0.3",
4
4
  "description": "A cross-vendor panel of up to 10 AI models that returns the coverage union of their distinct perspectives",
5
5
  "bin": {
6
6
  "ai-consultants": "bin/ai-consultants"
@@ -252,13 +252,14 @@ KIMI_MODEL=kimi-code/k3
252
252
  QWEN3_MODEL=qwen3.7-max
253
253
  QWEN3_MAX_QUALITY_TIMEOUT=600
254
254
  QWEN3_API_MAX_TOKENS=16384
255
- GLM_MODEL=glm-5.3
255
+ GLM_MODEL=glm-5.3-flash
256
256
  GLM_API_MAX_TOKENS=16384
257
257
  GLM_REASONING_EFFORT= # max_quality sets max
258
258
  GROK_MODEL=grok-4.6
259
259
  GROK_MAX_TURNS=4
260
260
  GROK_API_MAX_TOKENS=4096
261
261
  GROK_REASONING_EFFORT= # max_quality sets xhigh (Grok Build maximum)
262
+ GROK_OAUTH_MODE=shared # shared (parallel default) | serialized (diagnostic)
262
263
  DEEPSEEK_MODEL=deepseek-v4-pro
263
264
  DEEPSEEK_API_MAX_TOKENS=16384
264
265
  DEEPSEEK_MAX_QUALITY_TIMEOUT=600
@@ -285,6 +286,28 @@ Set `GROK_USE_API=true` only to force the API path. The adapter accepts any CLI
285
286
  version that exposes the complete required headless interface and requested
286
287
  model; `metadata.cli_version` is provenance, not a version pin.
287
288
 
289
+ `GROK_OAUTH_MODE=shared` is the normal CLI path because ai-consultants launches
290
+ consultants in parallel. Each Grok invocation keeps a private HOME, workspace,
291
+ prompt, output, permissions, and tool-free agent policy. Concurrent Grok
292
+ processes share only a runner-owned persistent `GROK_HOME` generation under
293
+ `$XDG_DATA_HOME/ai-consultants/grok-shared-oauth` (or the standard XDG data
294
+ fallback). Grok Build's own auth lock coordinates refreshes inside that shared
295
+ generation; a short ai-consultants lock protects seeding, adoption, atomic
296
+ runner-policy reconciliation, and atomic publication back to the ambient
297
+ `~/.grok/auth.json`. An external `grok login` always wins the digest-based CAS:
298
+ the affected consultation fails temporarily and never overwrites the new login
299
+ or falls back to a separately billed API request. Malformed credentials and
300
+ unpersisted refreshes fail closed. Use `GROK_OAUTH_MODE=serialized` only to hold
301
+ the adapter lock across the complete CLI run for diagnostic comparison. Forced
302
+ API mode is stateless and never creates or reads the shared OAuth generation.
303
+ Each new generation also performs exactly one model-inventory bootstrap under
304
+ the short lock because Grok 1.0.4 lazily initializes home metadata; all later
305
+ inventory probes and every inference remain concurrent.
306
+ Grok 1.0.4 retains ownership of its generated `config.toml`; ai-consultants does
307
+ not replace provider-required sections. Instead it atomically reconciles a
308
+ separate `.ai-consultants-policy.json`, while the actual enforced surface stays
309
+ pinned by the per-invocation CLI arguments.
310
+
288
311
  `max_quality` sets `GROK_REASONING_EFFORT=xhigh` (the highest value accepted by
289
312
  Grok Build),
290
313
  `GLM_REASONING_EFFORT=max`, and `DEEPSEEK_REASONING_EFFORT=max`. Grok passes
package/scripts/config.sh CHANGED
@@ -186,7 +186,7 @@ QWEN3_FORMAT="${QWEN3_FORMAT:-qwen}"
186
186
  # GLM CONFIGURATION - The Code Specialist (API-based)
187
187
  # =============================================================================
188
188
 
189
- GLM_MODEL="${GLM_MODEL:-glm-5.3}"
189
+ GLM_MODEL="${GLM_MODEL:-glm-5.3-flash}"
190
190
  GLM_TIMEOUT_SECONDS="${GLM_TIMEOUT:-180}"
191
191
  GLM_API_MAX_TOKENS="${GLM_API_MAX_TOKENS:-16384}"
192
192
  GLM_API_URL="${GLM_API_URL:-https://api.z.ai/api/coding/paas/v4/chat/completions}"
@@ -202,6 +202,7 @@ GROK_MODEL="${GROK_MODEL:-grok-4.6}"
202
202
  GROK_TIMEOUT_SECONDS="${GROK_TIMEOUT:-180}"
203
203
  GROK_API_MAX_TOKENS="${GROK_API_MAX_TOKENS:-4096}"
204
204
  GROK_MAX_TURNS="${GROK_MAX_TURNS:-4}"
205
+ GROK_OAUTH_MODE="${GROK_OAUTH_MODE:-shared}"
205
206
  GROK_API_URL="${GROK_API_URL:-https://api.x.ai/v1/chat/completions}"
206
207
  GROK_FORMAT="${GROK_FORMAT:-openai}"
207
208
  # Grok Build's official credential name is XAI_API_KEY. Keep the historical
@@ -221,7 +222,7 @@ if [[ -z "${GROK_USE_API+x}" ]]; then
221
222
  GROK_USE_API=false
222
223
  fi
223
224
  fi
224
- export GROK_USE_API
225
+ export GROK_USE_API GROK_OAUTH_MODE
225
226
 
226
227
  # =============================================================================
227
228
  # DEEPSEEK CONFIGURATION - The Methodologist (API-based)
@@ -622,7 +623,7 @@ get_model_for_tier() {
622
623
  codex) echo "gpt-5.6-sol" ;;
623
624
  mistral) [[ "$transport" == "api" ]] && echo "mistral-large-3" || echo "mistral-medium-3.5" ;;
624
625
  deepseek) echo "deepseek-v4-pro" ;;
625
- glm) echo "glm-5.3" ;;
626
+ glm) echo "glm-5.3-flash" ;;
626
627
  grok) echo "grok-4.6" ;;
627
628
  qwen3) echo "qwen3.8-max" ;;
628
629
  kimi) echo "kimi-code/k3-256k" ;;
@@ -637,7 +638,7 @@ get_model_for_tier() {
637
638
  codex) echo "gpt-5.6-sol" ;;
638
639
  mistral) [[ "$transport" == "api" ]] && echo "mistral-large-3" || echo "mistral-medium-3.5" ;;
639
640
  deepseek) echo "deepseek-v4-pro" ;;
640
- glm) echo "glm-5.3" ;;
641
+ glm) echo "glm-5.3-flash" ;;
641
642
  grok) echo "grok-4.6" ;;
642
643
  qwen3) echo "qwen3.7-max" ;;
643
644
  kimi) echo "kimi-code/k3" ;;
@@ -652,7 +653,7 @@ get_model_for_tier() {
652
653
  codex) echo "gpt-5.6-terra" ;;
653
654
  mistral) [[ "$transport" == "api" ]] && echo "mistral-large-3" || echo "mistral-medium-3.5" ;;
654
655
  deepseek) echo "deepseek-v4-flash" ;;
655
- glm) echo "glm-5.3" ;; # Same as premium (no mid-tier GLM)
656
+ glm) echo "glm-5.3-flash" ;; # Same as premium (no mid-tier GLM)
656
657
  grok) echo "grok-4.5" ;;
657
658
  qwen3) echo "qwen3.6-35b-a3b" ;; # Open-weight MoE (35B total, 3B active)
658
659
  kimi) echo "kimi-code/k3" ;;
@@ -1010,4 +1011,4 @@ EOF
1010
1011
  # VERSION
1011
1012
  # =============================================================================
1012
1013
 
1013
- AI_CONSULTANTS_VERSION="4.0.1"
1014
+ AI_CONSULTANTS_VERSION="4.0.3"
@@ -307,11 +307,14 @@ if [[ "$(read_value "$WORK_FILE" GEMINI_MODEL 2>/dev/null || true)" == "Gemini 3
307
307
  echo "Migrated managed Gemini CLI default: Gemini 3.1 Pro (High) -> Gemini 3.7 Flash (High)" >&2
308
308
  fi
309
309
 
310
- if [[ "$(read_value "$WORK_FILE" GLM_MODEL 2>/dev/null || true)" == "glm-5.2" ]] \
311
- && ! has_value_marker "$WORK_FILE" GLM_MODEL "$PIN_MARKER"; then
312
- set_value GLM_MODEL "glm-5.3 $DEFAULT_MARKER"
313
- echo "Migrated managed GLM default: glm-5.2 -> glm-5.3" >&2
314
- fi
310
+ case "$(read_value "$WORK_FILE" GLM_MODEL 2>/dev/null || true)" in
311
+ glm-5.2|glm-5.3)
312
+ if ! has_value_marker "$WORK_FILE" GLM_MODEL "$PIN_MARKER"; then
313
+ set_value GLM_MODEL "glm-5.3-flash $DEFAULT_MARKER"
314
+ echo "Migrated managed GLM default to glm-5.3-flash" >&2
315
+ fi
316
+ ;;
317
+ esac
315
318
 
316
319
  if [[ "$(read_value "$WORK_FILE" GROK_MODEL 2>/dev/null || true)" == "grok-4.5" ]] \
317
320
  && ! has_value_marker "$WORK_FILE" GROK_MODEL "$PIN_MARKER"; then
@@ -221,7 +221,9 @@ run_query() {
221
221
 
222
222
  # Error handling
223
223
  local error_msg=""
224
- [[ -f "$error_file" ]] && error_msg=$(head -5 "$error_file" 2>/dev/null)
224
+ if [[ "${RUN_QUERY_REDACT_ERRORS:-false}" != "true" && -f "$error_file" ]]; then
225
+ error_msg=$(head -5 "$error_file" 2>/dev/null)
226
+ fi
225
227
 
226
228
  # First line of the CLI's own stderr — the actual reason (auth error,
227
229
  # command not found, etc.). Kept for the final failure message so it