johns-harness 2026.11.11 → 2026.11.14

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.
Files changed (47) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/dist/auth-profiles-5CHn7vq1.js +1 -1
  3. package/dist/channels/plugins/actions/telegram.js +1 -1
  4. package/dist/compact-B247y5Qt.js +9 -1
  5. package/dist/config-koj5M_EO.js +1 -1
  6. package/dist/daemon-cli.js +1 -1
  7. package/dist/model-selection-BGlGpPgM.js +1 -1
  8. package/dist/model-selection-BU6wl1le.js +1 -1
  9. package/dist/model-selection-L7RMwsG-.js +1 -1
  10. package/dist/pi-embedded-C6ITuRXf.js +9 -1
  11. package/dist/pi-embedded-DoQsYfIY.js +9 -1
  12. package/dist/plugin-sdk/config-4Fgm-yEH.js +1 -1
  13. package/dist/plugin-sdk/config-Di-lyCdh.js +1 -1
  14. package/dist/plugin-sdk/discord.js +1 -1
  15. package/dist/plugin-sdk/dispatch-BP0viZiL.js +9 -1
  16. package/dist/plugin-sdk/dispatch-CQsjmw7g.js +9 -1
  17. package/dist/plugin-sdk/dispatch-Cerq29sy.js +9 -1
  18. package/dist/plugin-sdk/dispatch-Cndjtt0g.js +9 -1
  19. package/dist/plugin-sdk/dispatch-UogiJYul.js +9 -1
  20. package/dist/plugin-sdk/mattermost.js +1 -1
  21. package/dist/plugin-sdk/model-auth-CX9cPHdC.js +1 -1
  22. package/dist/plugin-sdk/model-auth-Ciehz0x5.js +1 -1
  23. package/dist/plugin-sdk/model-auth-DVyo6JSX.js +1 -1
  24. package/dist/plugin-sdk/model-auth-kiHYHGrs.js +1 -1
  25. package/dist/plugin-sdk/model-selection-Dbj4jDYM.js +1 -1
  26. package/dist/plugin-sdk/reply-DbZnH8-h.js +9 -1
  27. package/dist/plugin-sdk/thinking-B-rIrY_n.js +1 -1
  28. package/dist/plugin-sdk/thinking-CopbP_Cn.js +1 -1
  29. package/dist/plugin-sdk/thinking-WQ4Zq8Nl.js +1 -1
  30. package/dist/plugin-sdk/thinking-WXqkGljb.js +1 -1
  31. package/dist/plugin-sdk/thinking-_uXqFaFO.js +1 -1
  32. package/dist/plugin-sdk/thinking-pTdxk2dr.js +1 -1
  33. package/dist/reply-C5LKjXcC.js +9 -1
  34. package/dist/subscription-call-auth.js +193 -0
  35. package/dist/thinking-B5B36ffe.js +1 -1
  36. package/dist/thinking-BYwvlJ3S.js +1 -1
  37. package/dist/thinking-CAzdgmNV.js +1 -1
  38. package/dist/thinking-DykY2Fzj.js +1 -1
  39. package/docs/MODELS.md +23 -0
  40. package/docs/PATCHES.md +23 -0
  41. package/models/models.json +8 -5
  42. package/node_modules/@mariozechner/pi-ai/dist/models.generated.js +2 -1
  43. package/node_modules/@mariozechner/pi-ai/dist/providers/google.js +1 -1
  44. package/package.json +1 -1
  45. package/scripts/models-sync.mjs +3 -1
  46. package/vendor/patched-deps/@mariozechner/pi-ai/dist/models.generated.js +2 -1
  47. package/vendor/patched-deps/@mariozechner/pi-ai/dist/providers/google.js +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,31 @@
1
1
  # Changelog
2
2
 
3
+ ## 2026.11.14
4
+
5
+ ### Sub-agents and swarms return to the subscription mid-run; status names the profile that served each call
6
+
7
+ - **Cause:** a run chose its auth profile once, at start, and never moved back. A sub-agent or swarm member is one run of hundreds of model calls, so one that started while the Claude subscription was cooling after a rate limit stayed on the paid API key until it ended (seven hours and 470 calls in the reported case). The main session re-picked every turn, which is why it looked fine. Sub-agents that started on a healthy subscription were already served by it.
8
+ - **Fix (Family 98):** the profile is chosen before every model call. A run on the API key moves back to the subscription on the first call after it is usable again. Leaving the subscription is still only the existing failure-driven fallback, and a run holds off 1, 5, 25 then 60 minutes before returning after the subscription fails inside it. User-locked profiles and other providers are unchanged.
9
+ - **Status:** every assistant record in the transcript now carries the profile that served it (`authProfileId`, `authMode`, and the fallback reason when a paid key served). `/status` reads that record, so a card for a run still in flight shows what its last call used, for example `api-key (anthropic:default) [API fallback: subscription in cooldown]`, and adds per-profile call counts when a run used both.
10
+ - The stamp is transcript metadata only. It is never sent to a provider and adds nothing to the context.
11
+ - **Not changed:** calls made while the subscription is rate limited or cooling still go to the API key.
12
+ - **Validation:** isolated gateway with a real spawned sub-agent and a two-member swarm against a mock Anthropic endpoint with fixture credentials: the unpatched tree stays on `x-api-key` for every call; this release goes `x-api-key, x-api-key, Bearer, Bearer` per run once the cooldown ends, and Bearer from the first call when spawned healthy. No live Anthropic call was made with the real subscription credential.
13
+ - **Gates:** verifier **597 pass, 0 fail**; full suite **1,398 pass, 0 fail, 5 skip** (1,403 tests); packed-artifact check passed.
14
+ - **Rollback:** `npm i -g johns-harness@2026.11.13`.
15
+
16
+ ## 2026.11.13
17
+
18
+ ### Gemini 4 Hydrogen native chat and xhigh
19
+
20
+ - Added generally available `google/gemini-4-hydrogen` (November 12) through the native Google GenerateContent streaming adapter: unified **1,048,576-token context** and **65,536 ordinary output tokens** shared by thinking and final output. Native text/image/video/audio/PDF input; the harness agent surface remains text/image. Text output only, not image generation.
21
+ - Thinking **low / medium / high / xhigh**, default **high**. Extended generic master validation to accept native Google xhigh; existing SDK serializes the master-generated `XHIGH` unchanged. `/think xhigh` is enabled only for the new card; Carbon/Argon still cap at high and default medium. Thinking cannot be disabled: off/omitted uses high, none/minimal map to low. Manual budgets and explicit cache handles are refused; custom sampling is omitted.
22
+ - Standard pricing is flat across the full context: **$1.50 input / $7.50 output including thinking / $0.075 implicit cached input** per MTok, no prompt-length tier. Batch/Flex **$0.75 / $3.75 / $0.0375**; Priority **$2.70 / $13.50 / $0.135**, documented only (no service-tier implementation). March 2026 knowledge cutoff. No sibling price audit or changes.
23
+ - Per the newest-shorthand rule, **`gemini`, `flash`, `gemini-flash` → Hydrogen**. Added **`gemini4-carbon`** and **`flash38`**; Argon remains on `gemini4-argon`, all prior model IDs and other aliases remain reachable. Image aliases/defaults and subscription-only image routing are unchanged.
24
+ - No long-decode/background/continuation implementation or 1M-output claim. No live config/auth/default-model edits, global install/restart, or fleet changes. Model facts/rules/aliases are master-only; generated blocks come from synchronization. Added real-adapter and SDK/SSE regressions for native xhigh, default high, cap refusal, tools, thought signatures and token costs.
25
+ - **Official sources checked 2026-11-13:** [model specifications](https://aistudio.google.com/docs/models/gemini-4-hydrogen), [API and migration guide](https://aistudio.google.com/docs/whats-new-gemini-4-hydrogen), [native thinking controls](https://aistudio.google.com/docs/thinking?generate-content=true), [pricing](https://aistudio.google.com/docs/pricing#gemini-4-hydrogen), [DeepMind model card and cutoff](https://deepmind.google/models/model-cards/gemini-4-hydrogen/).
26
+ - **Validation:** master check **811 cards, 0 problems**; sync **0 stale**; verifier **591 pass, 0 fail**; full suite **1,391 pass, 0 fail, 5 skip** (1,396 tests). One real repo-adapter xhigh call returned HTTP200 and `OK`, wire `XHIGH`, accepting the 65,536 cap while using 40 input / 51 thinking-plus-output tokens ($0.0004425). No paid OpenAI inference.
27
+ - **Rollback:** `npm i -g johns-harness@2026.11.11`.
28
+
3
29
  ## 2026.11.11
4
30
 
5
31
  ### Gemini 4 Carbon
@@ -5162,7 +5162,7 @@ Object.assign(DEFAULT_MODEL_ALIASES, {
5162
5162
  grok46: "xai/grok-4.6"
5163
5163
  });
5164
5164
  /* JOHNNESS_MODELS_MASTER:BEGIN aliases (generated from models/models.json by scripts/models-sync.mjs; edit the master, not this block) */
5165
- const JOHNNESS_MASTER_ALIASES = {"deepseek":"deepseek/deepseek-flash","deepseek-pro":"deepseek/deepseek-v4-pro","gemini-lite":"google/gemini-3.5-flash-lite","muse":"meta/muse-spark-1.3","muse-spark":"meta/muse-spark-1.3","opus46":"anthropic/claude-opus-4-6","sonnet46":"anthropic/claude-sonnet-4-6","gpt-mini":"openai/gpt-5-mini","gemini":"google/gemini-4-carbon","gemini4-argon":"google/gemini-4-argon","gemini31":"google/gemini-3.1-pro-preview","gemini-flash":"google/gemini-3.8-flash","gemini-flash-lite":"google/gemini-2.5-flash-lite","flash":"google/gemini-3.8-flash","banana":"google/gemini-nano-banana-2.1","nano-banana":"google/gemini-nano-banana-2.1","nano-banana-pro":"google/gemini-3-pro-image","nano-banana-pro-preview":"google/gemini-3-pro-image-preview","nano-banana-lite":"google/gemini-3.1-flash-lite-image","grok-image":"xai/grok-imagine-image-2.0","image-sunburst25":"openai-codex/gpt-image-2.5-sunburst","image-flare25":"openai-codex/gpt-image-2.5-flare","image2":"openai-codex/gpt-image-2","sonnet5":"anthropic/claude-sonnet-5","opus5":"anthropic/claude-opus-5","fable51":"anthropic/claude-fable-5-1","haiku45":"anthropic/claude-haiku-4-5","sol6":"openai-codex/gpt-6-sol","sol56":"openai-codex/gpt-5.6-sol","luna56":"openai-codex/gpt-5.6-luna","grok46":"xai/grok-4.6","terra56":"openai-codex/gpt-5.6-terra","image":"openai-codex/gpt-image-2.6-sunburst","image-sunburst":"openai-codex/gpt-image-2.6-sunburst","image-flare":"openai-codex/gpt-image-2.6-flare","opus":"anthropic/claude-opus-5-5","sonnet":"anthropic/claude-sonnet-5-5","fable":"anthropic/claude-fable-5-2","haiku":"anthropic/claude-haiku-5-5","gpt":"openai-codex/gpt-6.1-sol","sol":"openai-codex/gpt-6.1-sol","luna":"openai-codex/gpt-6-luna","astra":"openai-codex/gpt-6-astra","terra":"openai-codex/gpt-6.1-terra","grok":"xai/grok-4.7"};
5165
+ const JOHNNESS_MASTER_ALIASES = {"deepseek":"deepseek/deepseek-flash","deepseek-pro":"deepseek/deepseek-v4-pro","gemini-lite":"google/gemini-3.5-flash-lite","muse":"meta/muse-spark-1.3","muse-spark":"meta/muse-spark-1.3","opus46":"anthropic/claude-opus-4-6","sonnet46":"anthropic/claude-sonnet-4-6","gpt-mini":"openai/gpt-5-mini","gemini":"google/gemini-4-hydrogen","gemini4-argon":"google/gemini-4-argon","gemini31":"google/gemini-3.1-pro-preview","gemini-flash":"google/gemini-4-hydrogen","gemini-flash-lite":"google/gemini-2.5-flash-lite","flash":"google/gemini-4-hydrogen","banana":"google/gemini-nano-banana-2.1","nano-banana":"google/gemini-nano-banana-2.1","nano-banana-pro":"google/gemini-3-pro-image","nano-banana-pro-preview":"google/gemini-3-pro-image-preview","nano-banana-lite":"google/gemini-3.1-flash-lite-image","grok-image":"xai/grok-imagine-image-2.0","image-sunburst25":"openai-codex/gpt-image-2.5-sunburst","image-flare25":"openai-codex/gpt-image-2.5-flare","image2":"openai-codex/gpt-image-2","sonnet5":"anthropic/claude-sonnet-5","opus5":"anthropic/claude-opus-5","fable51":"anthropic/claude-fable-5-1","haiku45":"anthropic/claude-haiku-4-5","sol6":"openai-codex/gpt-6-sol","sol56":"openai-codex/gpt-5.6-sol","luna56":"openai-codex/gpt-5.6-luna","grok46":"xai/grok-4.6","terra56":"openai-codex/gpt-5.6-terra","gemini4-carbon":"google/gemini-4-carbon","flash38":"google/gemini-3.8-flash","image":"openai-codex/gpt-image-2.6-sunburst","image-sunburst":"openai-codex/gpt-image-2.6-sunburst","image-flare":"openai-codex/gpt-image-2.6-flare","opus":"anthropic/claude-opus-5-5","sonnet":"anthropic/claude-sonnet-5-5","fable":"anthropic/claude-fable-5-2","haiku":"anthropic/claude-haiku-5-5","gpt":"openai-codex/gpt-6.1-sol","sol":"openai-codex/gpt-6.1-sol","luna":"openai-codex/gpt-6-luna","astra":"openai-codex/gpt-6-astra","terra":"openai-codex/gpt-6.1-terra","grok":"xai/grok-4.7"};
5166
5166
  for (const [alias, ref] of Object.entries(JOHNNESS_MASTER_ALIASES)) DEFAULT_MODEL_ALIASES[alias] = ref;
5167
5167
  /* JOHNNESS_MODELS_MASTER:END */
5168
5168
  const DEFAULT_MODEL_COST = {
@@ -2132,7 +2132,7 @@ const XHIGH_MODEL_REFS = [
2132
2132
  "github-copilot/gpt-5.2"
2133
2133
  ];
2134
2134
  /* JOHNNESS_MODELS_MASTER:BEGIN xhigh refs (generated from models/models.json by scripts/models-sync.mjs; edit the master, not this block) */
2135
- XHIGH_MODEL_REFS.splice(0, XHIGH_MODEL_REFS.length, ...['deepseek/deepseek-flash','deepseek/deepseek-v4-pro','meta/muse-spark-1.3','meta/muse-spark-1.2','anthropic/claude-fable-5-2','anthropic/claude-fable-5-1','anthropic/claude-sonnet-5-5','anthropic/claude-opus-5-5','anthropic/claude-haiku-5-5','anthropic/claude-opus-5','anthropic/claude-sonnet-5','anthropic/claude-fable-5','anthropic/claude-opus-4-6','azure-openai-responses/gpt-5.2','azure-openai-responses/gpt-5.2-chat-latest','azure-openai-responses/gpt-5.2-codex','azure-openai-responses/gpt-5.2-pro','azure-openai-responses/gpt-5.3-codex','azure-openai-responses/gpt-5.3-codex-spark','github-copilot/claude-opus-4.6','github-copilot/gpt-5.2','github-copilot/gpt-5.2-codex','openai/gpt-5.2','openai/gpt-5.2-chat-latest','openai/gpt-5.2-codex','openai/gpt-5.2-pro','openai/gpt-5.3-codex','openai/gpt-5.3-codex-spark','openai/gpt-6-astra','openai/gpt-6.1-sol','openai/gpt-6-sol','openai/gpt-6-luna','openai/gpt-5.6-sol','openai/gpt-5.6-terra','openai/gpt-5.6-luna','openai/gpt-6.1-terra','openai-codex/gpt-5.2','openai-codex/gpt-5.2-codex','openai-codex/gpt-5.3-codex','openai-codex/gpt-5.3-codex-spark','openai-codex/gpt-6.1-sol','openai-codex/gpt-6-sol','openai-codex/gpt-6-luna','openai-codex/gpt-6-astra','openai-codex/gpt-5.6-sol','openai-codex/gpt-5.6-terra','openai-codex/gpt-5.6-luna','openai-codex/gpt-6.1-terra','opencode/claude-opus-4-6','opencode/gpt-5.2','opencode/gpt-5.2-codex','opencode/gpt-5.3-codex','openrouter/openai/gpt-5.2','openrouter/openai/gpt-5.2-chat','openrouter/openai/gpt-5.2-codex','openrouter/openai/gpt-5.2-pro','openrouter/openai/gpt-5.3-codex','vercel-ai-gateway/anthropic/claude-opus-4.6','vercel-ai-gateway/openai/gpt-5.2','vercel-ai-gateway/openai/gpt-5.2-chat','vercel-ai-gateway/openai/gpt-5.2-codex','vercel-ai-gateway/openai/gpt-5.2-pro','vercel-ai-gateway/openai/gpt-5.3-codex','xai/grok-4.7','xai/grok-4.6','openai/gpt-5.4','openai/gpt-5.4-pro','openai/gpt-5.6','openai-codex/gpt-5.6','openai-codex/gpt-5.4','openai-codex/gpt-5.1-codex']);
2135
+ XHIGH_MODEL_REFS.splice(0, XHIGH_MODEL_REFS.length, ...['deepseek/deepseek-flash','deepseek/deepseek-v4-pro','meta/muse-spark-1.3','meta/muse-spark-1.2','anthropic/claude-fable-5-2','anthropic/claude-fable-5-1','anthropic/claude-sonnet-5-5','anthropic/claude-opus-5-5','anthropic/claude-haiku-5-5','anthropic/claude-opus-5','anthropic/claude-sonnet-5','anthropic/claude-fable-5','anthropic/claude-opus-4-6','azure-openai-responses/gpt-5.2','azure-openai-responses/gpt-5.2-chat-latest','azure-openai-responses/gpt-5.2-codex','azure-openai-responses/gpt-5.2-pro','azure-openai-responses/gpt-5.3-codex','azure-openai-responses/gpt-5.3-codex-spark','github-copilot/claude-opus-4.6','github-copilot/gpt-5.2','github-copilot/gpt-5.2-codex','google/gemini-4-hydrogen','openai/gpt-5.2','openai/gpt-5.2-chat-latest','openai/gpt-5.2-codex','openai/gpt-5.2-pro','openai/gpt-5.3-codex','openai/gpt-5.3-codex-spark','openai/gpt-6-astra','openai/gpt-6.1-sol','openai/gpt-6-sol','openai/gpt-6-luna','openai/gpt-5.6-sol','openai/gpt-5.6-terra','openai/gpt-5.6-luna','openai/gpt-6.1-terra','openai-codex/gpt-5.2','openai-codex/gpt-5.2-codex','openai-codex/gpt-5.3-codex','openai-codex/gpt-5.3-codex-spark','openai-codex/gpt-6.1-sol','openai-codex/gpt-6-sol','openai-codex/gpt-6-luna','openai-codex/gpt-6-astra','openai-codex/gpt-5.6-sol','openai-codex/gpt-5.6-terra','openai-codex/gpt-5.6-luna','openai-codex/gpt-6.1-terra','opencode/claude-opus-4-6','opencode/gpt-5.2','opencode/gpt-5.2-codex','opencode/gpt-5.3-codex','openrouter/openai/gpt-5.2','openrouter/openai/gpt-5.2-chat','openrouter/openai/gpt-5.2-codex','openrouter/openai/gpt-5.2-pro','openrouter/openai/gpt-5.3-codex','vercel-ai-gateway/anthropic/claude-opus-4.6','vercel-ai-gateway/openai/gpt-5.2','vercel-ai-gateway/openai/gpt-5.2-chat','vercel-ai-gateway/openai/gpt-5.2-codex','vercel-ai-gateway/openai/gpt-5.2-pro','vercel-ai-gateway/openai/gpt-5.3-codex','xai/grok-4.7','xai/grok-4.6','openai/gpt-5.4','openai/gpt-5.4-pro','openai/gpt-5.6','openai-codex/gpt-5.6','openai-codex/gpt-5.4','openai-codex/gpt-5.1-codex']);
2136
2136
  /* JOHNNESS_MODELS_MASTER:END */
2137
2137
  new Set(XHIGH_MODEL_REFS.map((entry) => entry.toLowerCase()));
2138
2138
  new Set(XHIGH_MODEL_REFS.map((entry) => entry.split("/")[1]?.toLowerCase()).filter((entry) => Boolean(entry)));
@@ -1,3 +1,4 @@
1
+ import { createCallAuth, withServedAuthProfile, formatServedAuthLabel } from "./subscription-call-auth.js"; // JOHNNESS_PATCH_CALL_AUTH_98
1
2
  // JOHNNESS_PATCH_SUBSCRIPTION_USAGE_93 dist/compact-B247y5Qt.js
2
3
  import { loadSubscriptionStatus } from "./subscription-usage.js";
3
4
  import { createSubscriptionAuthTracker, formatAuthProfileFallback } from "./anthropic-auth-runtime.js"; // JOHNNESS_PATCH_SUBSCRIPTION_RUNTIME_92
@@ -17531,6 +17532,7 @@ async function runEmbeddedAttempt(params) {
17531
17532
  activeSession.agent.streamFn = wrapStreamFnTrimToolCallNames(activeSession.agent.streamFn, allowedToolNames);
17532
17533
  if (isXaiProvider(params.provider, params.modelId)) activeSession.agent.streamFn = wrapStreamFnDecodeXaiToolCallArguments(activeSession.agent.streamFn);
17533
17534
  if (anthropicPayloadLogger) activeSession.agent.streamFn = anthropicPayloadLogger.wrapStreamFn(activeSession.agent.streamFn);
17535
+ if (params.callAuth) activeSession.agent.streamFn = params.callAuth.wrapStreamFn(activeSession.agent.streamFn); // JOHNNESS_PATCH_CALL_AUTH_98: outermost, every model call picks its credential
17534
17536
  try {
17535
17537
  const prior = await sanitizeSessionHistory({
17536
17538
  messages: activeSession.messages,
@@ -18638,6 +18640,7 @@ async function runEmbeddedPiAgent(params) {
18638
18640
  }
18639
18641
  };
18640
18642
  const MAX_OVERFLOW_COMPACTION_ATTEMPTS = 3;
18643
+ const callAuth = createCallAuth({ provider, store: authStore, candidates: profileCandidates, lockedProfileId, getIndex: () => profileIndex, setIndex: (index) => { profileIndex = index; }, getProfileId: () => lastProfileId, getKey: () => apiKeyInfo?.apiKey, apply: (candidate) => applyApiKeyInfo(candidate), freshStore: () => ensureAuthProfileStore(agentDir, { allowKeychainPrompt: false }), resolveOrder: () => resolveAuthProfileOrder({ cfg: params.config, store: authStore, provider, preferredProfile: preferredProfileId }), inCooldown: isProfileInCooldown, tracker: subscriptionAuth, warn: (message) => log$16.warn(message) }); // JOHNNESS_PATCH_CALL_AUTH_98: a run is many model calls, not one credential
18641
18644
  const MAX_RUN_LOOP_ITERATIONS = resolveMaxRunRetryIterations(profileCandidates.length);
18642
18645
  let overflowCompactionAttempts = 0;
18643
18646
  let toolResultTruncationAttempted = false;
@@ -18755,6 +18758,7 @@ async function runEmbeddedPiAgent(params) {
18755
18758
  authProfileId: lastProfileId,
18756
18759
  authProfileIdSource: lockedProfileId ? "user" : "auto",
18757
18760
  authStorage,
18761
+ callAuth, // JOHNNESS_PATCH_CALL_AUTH_98
18758
18762
  modelRegistry,
18759
18763
  agentId: workspaceResolution.agentId,
18760
18764
  legacyBeforeAgentStartResult,
@@ -35857,7 +35861,11 @@ async function buildExportSessionReply(params) {
35857
35861
  }
35858
35862
  //#endregion
35859
35863
  //#region src/agents/model-auth-label.ts
35860
- function resolveModelAuthLabel(params) {
35864
+ function resolveModelAuthLabel(params) { // JOHNNESS_PATCH_CALL_AUTH_98: the transcript names the profile that served the latest model call
35865
+ params = withServedAuthProfile(params);
35866
+ return formatServedAuthLabel(resolveStoredModelAuthLabel(params), params);
35867
+ }
35868
+ function resolveStoredModelAuthLabel(params) {
35861
35869
  const resolvedProvider = params.provider?.trim();
35862
35870
  if (!resolvedProvider) return;
35863
35871
  const providerKey = normalizeProviderId(resolvedProvider);
@@ -1852,7 +1852,7 @@ Object.assign(DEFAULT_MODEL_ALIASES, {
1852
1852
  grok46: "xai/grok-4.6"
1853
1853
  });
1854
1854
  /* JOHNNESS_MODELS_MASTER:BEGIN aliases (generated from models/models.json by scripts/models-sync.mjs; edit the master, not this block) */
1855
- const JOHNNESS_MASTER_ALIASES = {"deepseek":"deepseek/deepseek-flash","deepseek-pro":"deepseek/deepseek-v4-pro","gemini-lite":"google/gemini-3.5-flash-lite","muse":"meta/muse-spark-1.3","muse-spark":"meta/muse-spark-1.3","opus46":"anthropic/claude-opus-4-6","sonnet46":"anthropic/claude-sonnet-4-6","gpt-mini":"openai/gpt-5-mini","gemini":"google/gemini-4-carbon","gemini4-argon":"google/gemini-4-argon","gemini31":"google/gemini-3.1-pro-preview","gemini-flash":"google/gemini-3.8-flash","gemini-flash-lite":"google/gemini-2.5-flash-lite","flash":"google/gemini-3.8-flash","banana":"google/gemini-nano-banana-2.1","nano-banana":"google/gemini-nano-banana-2.1","nano-banana-pro":"google/gemini-3-pro-image","nano-banana-pro-preview":"google/gemini-3-pro-image-preview","nano-banana-lite":"google/gemini-3.1-flash-lite-image","grok-image":"xai/grok-imagine-image-2.0","image-sunburst25":"openai-codex/gpt-image-2.5-sunburst","image-flare25":"openai-codex/gpt-image-2.5-flare","image2":"openai-codex/gpt-image-2","sonnet5":"anthropic/claude-sonnet-5","opus5":"anthropic/claude-opus-5","fable51":"anthropic/claude-fable-5-1","haiku45":"anthropic/claude-haiku-4-5","sol6":"openai-codex/gpt-6-sol","sol56":"openai-codex/gpt-5.6-sol","luna56":"openai-codex/gpt-5.6-luna","grok46":"xai/grok-4.6","terra56":"openai-codex/gpt-5.6-terra","image":"openai-codex/gpt-image-2.6-sunburst","image-sunburst":"openai-codex/gpt-image-2.6-sunburst","image-flare":"openai-codex/gpt-image-2.6-flare","opus":"anthropic/claude-opus-5-5","sonnet":"anthropic/claude-sonnet-5-5","fable":"anthropic/claude-fable-5-2","haiku":"anthropic/claude-haiku-5-5","gpt":"openai-codex/gpt-6.1-sol","sol":"openai-codex/gpt-6.1-sol","luna":"openai-codex/gpt-6-luna","astra":"openai-codex/gpt-6-astra","terra":"openai-codex/gpt-6.1-terra","grok":"xai/grok-4.7"};
1855
+ const JOHNNESS_MASTER_ALIASES = {"deepseek":"deepseek/deepseek-flash","deepseek-pro":"deepseek/deepseek-v4-pro","gemini-lite":"google/gemini-3.5-flash-lite","muse":"meta/muse-spark-1.3","muse-spark":"meta/muse-spark-1.3","opus46":"anthropic/claude-opus-4-6","sonnet46":"anthropic/claude-sonnet-4-6","gpt-mini":"openai/gpt-5-mini","gemini":"google/gemini-4-hydrogen","gemini4-argon":"google/gemini-4-argon","gemini31":"google/gemini-3.1-pro-preview","gemini-flash":"google/gemini-4-hydrogen","gemini-flash-lite":"google/gemini-2.5-flash-lite","flash":"google/gemini-4-hydrogen","banana":"google/gemini-nano-banana-2.1","nano-banana":"google/gemini-nano-banana-2.1","nano-banana-pro":"google/gemini-3-pro-image","nano-banana-pro-preview":"google/gemini-3-pro-image-preview","nano-banana-lite":"google/gemini-3.1-flash-lite-image","grok-image":"xai/grok-imagine-image-2.0","image-sunburst25":"openai-codex/gpt-image-2.5-sunburst","image-flare25":"openai-codex/gpt-image-2.5-flare","image2":"openai-codex/gpt-image-2","sonnet5":"anthropic/claude-sonnet-5","opus5":"anthropic/claude-opus-5","fable51":"anthropic/claude-fable-5-1","haiku45":"anthropic/claude-haiku-4-5","sol6":"openai-codex/gpt-6-sol","sol56":"openai-codex/gpt-5.6-sol","luna56":"openai-codex/gpt-5.6-luna","grok46":"xai/grok-4.6","terra56":"openai-codex/gpt-5.6-terra","gemini4-carbon":"google/gemini-4-carbon","flash38":"google/gemini-3.8-flash","image":"openai-codex/gpt-image-2.6-sunburst","image-sunburst":"openai-codex/gpt-image-2.6-sunburst","image-flare":"openai-codex/gpt-image-2.6-flare","opus":"anthropic/claude-opus-5-5","sonnet":"anthropic/claude-sonnet-5-5","fable":"anthropic/claude-fable-5-2","haiku":"anthropic/claude-haiku-5-5","gpt":"openai-codex/gpt-6.1-sol","sol":"openai-codex/gpt-6.1-sol","luna":"openai-codex/gpt-6-luna","astra":"openai-codex/gpt-6-astra","terra":"openai-codex/gpt-6.1-terra","grok":"xai/grok-4.7"};
1856
1856
  for (const [alias, ref] of Object.entries(JOHNNESS_MASTER_ALIASES)) DEFAULT_MODEL_ALIASES[alias] = ref;
1857
1857
  /* JOHNNESS_MODELS_MASTER:END */
1858
1858
  const DEFAULT_MODEL_COST = {
@@ -5004,7 +5004,7 @@ Object.assign(DEFAULT_MODEL_ALIASES, {
5004
5004
  grok46: "xai/grok-4.6"
5005
5005
  });
5006
5006
  /* JOHNNESS_MODELS_MASTER:BEGIN aliases (generated from models/models.json by scripts/models-sync.mjs; edit the master, not this block) */
5007
- const JOHNNESS_MASTER_ALIASES = {"deepseek":"deepseek/deepseek-flash","deepseek-pro":"deepseek/deepseek-v4-pro","gemini-lite":"google/gemini-3.5-flash-lite","muse":"meta/muse-spark-1.3","muse-spark":"meta/muse-spark-1.3","opus46":"anthropic/claude-opus-4-6","sonnet46":"anthropic/claude-sonnet-4-6","gpt-mini":"openai/gpt-5-mini","gemini":"google/gemini-4-carbon","gemini4-argon":"google/gemini-4-argon","gemini31":"google/gemini-3.1-pro-preview","gemini-flash":"google/gemini-3.8-flash","gemini-flash-lite":"google/gemini-2.5-flash-lite","flash":"google/gemini-3.8-flash","banana":"google/gemini-nano-banana-2.1","nano-banana":"google/gemini-nano-banana-2.1","nano-banana-pro":"google/gemini-3-pro-image","nano-banana-pro-preview":"google/gemini-3-pro-image-preview","nano-banana-lite":"google/gemini-3.1-flash-lite-image","grok-image":"xai/grok-imagine-image-2.0","image-sunburst25":"openai-codex/gpt-image-2.5-sunburst","image-flare25":"openai-codex/gpt-image-2.5-flare","image2":"openai-codex/gpt-image-2","sonnet5":"anthropic/claude-sonnet-5","opus5":"anthropic/claude-opus-5","fable51":"anthropic/claude-fable-5-1","haiku45":"anthropic/claude-haiku-4-5","sol6":"openai-codex/gpt-6-sol","sol56":"openai-codex/gpt-5.6-sol","luna56":"openai-codex/gpt-5.6-luna","grok46":"xai/grok-4.6","terra56":"openai-codex/gpt-5.6-terra","image":"openai-codex/gpt-image-2.6-sunburst","image-sunburst":"openai-codex/gpt-image-2.6-sunburst","image-flare":"openai-codex/gpt-image-2.6-flare","opus":"anthropic/claude-opus-5-5","sonnet":"anthropic/claude-sonnet-5-5","fable":"anthropic/claude-fable-5-2","haiku":"anthropic/claude-haiku-5-5","gpt":"openai-codex/gpt-6.1-sol","sol":"openai-codex/gpt-6.1-sol","luna":"openai-codex/gpt-6-luna","astra":"openai-codex/gpt-6-astra","terra":"openai-codex/gpt-6.1-terra","grok":"xai/grok-4.7"};
5007
+ const JOHNNESS_MASTER_ALIASES = {"deepseek":"deepseek/deepseek-flash","deepseek-pro":"deepseek/deepseek-v4-pro","gemini-lite":"google/gemini-3.5-flash-lite","muse":"meta/muse-spark-1.3","muse-spark":"meta/muse-spark-1.3","opus46":"anthropic/claude-opus-4-6","sonnet46":"anthropic/claude-sonnet-4-6","gpt-mini":"openai/gpt-5-mini","gemini":"google/gemini-4-hydrogen","gemini4-argon":"google/gemini-4-argon","gemini31":"google/gemini-3.1-pro-preview","gemini-flash":"google/gemini-4-hydrogen","gemini-flash-lite":"google/gemini-2.5-flash-lite","flash":"google/gemini-4-hydrogen","banana":"google/gemini-nano-banana-2.1","nano-banana":"google/gemini-nano-banana-2.1","nano-banana-pro":"google/gemini-3-pro-image","nano-banana-pro-preview":"google/gemini-3-pro-image-preview","nano-banana-lite":"google/gemini-3.1-flash-lite-image","grok-image":"xai/grok-imagine-image-2.0","image-sunburst25":"openai-codex/gpt-image-2.5-sunburst","image-flare25":"openai-codex/gpt-image-2.5-flare","image2":"openai-codex/gpt-image-2","sonnet5":"anthropic/claude-sonnet-5","opus5":"anthropic/claude-opus-5","fable51":"anthropic/claude-fable-5-1","haiku45":"anthropic/claude-haiku-4-5","sol6":"openai-codex/gpt-6-sol","sol56":"openai-codex/gpt-5.6-sol","luna56":"openai-codex/gpt-5.6-luna","grok46":"xai/grok-4.6","terra56":"openai-codex/gpt-5.6-terra","gemini4-carbon":"google/gemini-4-carbon","flash38":"google/gemini-3.8-flash","image":"openai-codex/gpt-image-2.6-sunburst","image-sunburst":"openai-codex/gpt-image-2.6-sunburst","image-flare":"openai-codex/gpt-image-2.6-flare","opus":"anthropic/claude-opus-5-5","sonnet":"anthropic/claude-sonnet-5-5","fable":"anthropic/claude-fable-5-2","haiku":"anthropic/claude-haiku-5-5","gpt":"openai-codex/gpt-6.1-sol","sol":"openai-codex/gpt-6.1-sol","luna":"openai-codex/gpt-6-luna","astra":"openai-codex/gpt-6-astra","terra":"openai-codex/gpt-6.1-terra","grok":"xai/grok-4.7"};
5008
5008
  for (const [alias, ref] of Object.entries(JOHNNESS_MASTER_ALIASES)) DEFAULT_MODEL_ALIASES[alias] = ref;
5009
5009
  /* JOHNNESS_MODELS_MASTER:END */
5010
5010
  const DEFAULT_MODEL_COST = {
@@ -1714,7 +1714,7 @@ Object.assign(DEFAULT_MODEL_ALIASES, {
1714
1714
  grok46: "xai/grok-4.6"
1715
1715
  });
1716
1716
  /* JOHNNESS_MODELS_MASTER:BEGIN aliases (generated from models/models.json by scripts/models-sync.mjs; edit the master, not this block) */
1717
- const JOHNNESS_MASTER_ALIASES = {"deepseek":"deepseek/deepseek-flash","deepseek-pro":"deepseek/deepseek-v4-pro","gemini-lite":"google/gemini-3.5-flash-lite","muse":"meta/muse-spark-1.3","muse-spark":"meta/muse-spark-1.3","opus46":"anthropic/claude-opus-4-6","sonnet46":"anthropic/claude-sonnet-4-6","gpt-mini":"openai/gpt-5-mini","gemini":"google/gemini-4-carbon","gemini4-argon":"google/gemini-4-argon","gemini31":"google/gemini-3.1-pro-preview","gemini-flash":"google/gemini-3.8-flash","gemini-flash-lite":"google/gemini-2.5-flash-lite","flash":"google/gemini-3.8-flash","banana":"google/gemini-nano-banana-2.1","nano-banana":"google/gemini-nano-banana-2.1","nano-banana-pro":"google/gemini-3-pro-image","nano-banana-pro-preview":"google/gemini-3-pro-image-preview","nano-banana-lite":"google/gemini-3.1-flash-lite-image","grok-image":"xai/grok-imagine-image-2.0","image-sunburst25":"openai-codex/gpt-image-2.5-sunburst","image-flare25":"openai-codex/gpt-image-2.5-flare","image2":"openai-codex/gpt-image-2","sonnet5":"anthropic/claude-sonnet-5","opus5":"anthropic/claude-opus-5","fable51":"anthropic/claude-fable-5-1","haiku45":"anthropic/claude-haiku-4-5","sol6":"openai-codex/gpt-6-sol","sol56":"openai-codex/gpt-5.6-sol","luna56":"openai-codex/gpt-5.6-luna","grok46":"xai/grok-4.6","terra56":"openai-codex/gpt-5.6-terra","image":"openai-codex/gpt-image-2.6-sunburst","image-sunburst":"openai-codex/gpt-image-2.6-sunburst","image-flare":"openai-codex/gpt-image-2.6-flare","opus":"anthropic/claude-opus-5-5","sonnet":"anthropic/claude-sonnet-5-5","fable":"anthropic/claude-fable-5-2","haiku":"anthropic/claude-haiku-5-5","gpt":"openai-codex/gpt-6.1-sol","sol":"openai-codex/gpt-6.1-sol","luna":"openai-codex/gpt-6-luna","astra":"openai-codex/gpt-6-astra","terra":"openai-codex/gpt-6.1-terra","grok":"xai/grok-4.7"};
1717
+ const JOHNNESS_MASTER_ALIASES = {"deepseek":"deepseek/deepseek-flash","deepseek-pro":"deepseek/deepseek-v4-pro","gemini-lite":"google/gemini-3.5-flash-lite","muse":"meta/muse-spark-1.3","muse-spark":"meta/muse-spark-1.3","opus46":"anthropic/claude-opus-4-6","sonnet46":"anthropic/claude-sonnet-4-6","gpt-mini":"openai/gpt-5-mini","gemini":"google/gemini-4-hydrogen","gemini4-argon":"google/gemini-4-argon","gemini31":"google/gemini-3.1-pro-preview","gemini-flash":"google/gemini-4-hydrogen","gemini-flash-lite":"google/gemini-2.5-flash-lite","flash":"google/gemini-4-hydrogen","banana":"google/gemini-nano-banana-2.1","nano-banana":"google/gemini-nano-banana-2.1","nano-banana-pro":"google/gemini-3-pro-image","nano-banana-pro-preview":"google/gemini-3-pro-image-preview","nano-banana-lite":"google/gemini-3.1-flash-lite-image","grok-image":"xai/grok-imagine-image-2.0","image-sunburst25":"openai-codex/gpt-image-2.5-sunburst","image-flare25":"openai-codex/gpt-image-2.5-flare","image2":"openai-codex/gpt-image-2","sonnet5":"anthropic/claude-sonnet-5","opus5":"anthropic/claude-opus-5","fable51":"anthropic/claude-fable-5-1","haiku45":"anthropic/claude-haiku-4-5","sol6":"openai-codex/gpt-6-sol","sol56":"openai-codex/gpt-5.6-sol","luna56":"openai-codex/gpt-5.6-luna","grok46":"xai/grok-4.6","terra56":"openai-codex/gpt-5.6-terra","gemini4-carbon":"google/gemini-4-carbon","flash38":"google/gemini-3.8-flash","image":"openai-codex/gpt-image-2.6-sunburst","image-sunburst":"openai-codex/gpt-image-2.6-sunburst","image-flare":"openai-codex/gpt-image-2.6-flare","opus":"anthropic/claude-opus-5-5","sonnet":"anthropic/claude-sonnet-5-5","fable":"anthropic/claude-fable-5-2","haiku":"anthropic/claude-haiku-5-5","gpt":"openai-codex/gpt-6.1-sol","sol":"openai-codex/gpt-6.1-sol","luna":"openai-codex/gpt-6-luna","astra":"openai-codex/gpt-6-astra","terra":"openai-codex/gpt-6.1-terra","grok":"xai/grok-4.7"};
1718
1718
  for (const [alias, ref] of Object.entries(JOHNNESS_MASTER_ALIASES)) DEFAULT_MODEL_ALIASES[alias] = ref;
1719
1719
  /* JOHNNESS_MODELS_MASTER:END */
1720
1720
  const DEFAULT_MODEL_COST = {
@@ -1689,7 +1689,7 @@ Object.assign(DEFAULT_MODEL_ALIASES, {
1689
1689
  grok46: "xai/grok-4.6"
1690
1690
  });
1691
1691
  /* JOHNNESS_MODELS_MASTER:BEGIN aliases (generated from models/models.json by scripts/models-sync.mjs; edit the master, not this block) */
1692
- const JOHNNESS_MASTER_ALIASES = {"deepseek":"deepseek/deepseek-flash","deepseek-pro":"deepseek/deepseek-v4-pro","gemini-lite":"google/gemini-3.5-flash-lite","muse":"meta/muse-spark-1.3","muse-spark":"meta/muse-spark-1.3","opus46":"anthropic/claude-opus-4-6","sonnet46":"anthropic/claude-sonnet-4-6","gpt-mini":"openai/gpt-5-mini","gemini":"google/gemini-4-carbon","gemini4-argon":"google/gemini-4-argon","gemini31":"google/gemini-3.1-pro-preview","gemini-flash":"google/gemini-3.8-flash","gemini-flash-lite":"google/gemini-2.5-flash-lite","flash":"google/gemini-3.8-flash","banana":"google/gemini-nano-banana-2.1","nano-banana":"google/gemini-nano-banana-2.1","nano-banana-pro":"google/gemini-3-pro-image","nano-banana-pro-preview":"google/gemini-3-pro-image-preview","nano-banana-lite":"google/gemini-3.1-flash-lite-image","grok-image":"xai/grok-imagine-image-2.0","image-sunburst25":"openai-codex/gpt-image-2.5-sunburst","image-flare25":"openai-codex/gpt-image-2.5-flare","image2":"openai-codex/gpt-image-2","sonnet5":"anthropic/claude-sonnet-5","opus5":"anthropic/claude-opus-5","fable51":"anthropic/claude-fable-5-1","haiku45":"anthropic/claude-haiku-4-5","sol6":"openai-codex/gpt-6-sol","sol56":"openai-codex/gpt-5.6-sol","luna56":"openai-codex/gpt-5.6-luna","grok46":"xai/grok-4.6","terra56":"openai-codex/gpt-5.6-terra","image":"openai-codex/gpt-image-2.6-sunburst","image-sunburst":"openai-codex/gpt-image-2.6-sunburst","image-flare":"openai-codex/gpt-image-2.6-flare","opus":"anthropic/claude-opus-5-5","sonnet":"anthropic/claude-sonnet-5-5","fable":"anthropic/claude-fable-5-2","haiku":"anthropic/claude-haiku-5-5","gpt":"openai-codex/gpt-6.1-sol","sol":"openai-codex/gpt-6.1-sol","luna":"openai-codex/gpt-6-luna","astra":"openai-codex/gpt-6-astra","terra":"openai-codex/gpt-6.1-terra","grok":"xai/grok-4.7"};
1692
+ const JOHNNESS_MASTER_ALIASES = {"deepseek":"deepseek/deepseek-flash","deepseek-pro":"deepseek/deepseek-v4-pro","gemini-lite":"google/gemini-3.5-flash-lite","muse":"meta/muse-spark-1.3","muse-spark":"meta/muse-spark-1.3","opus46":"anthropic/claude-opus-4-6","sonnet46":"anthropic/claude-sonnet-4-6","gpt-mini":"openai/gpt-5-mini","gemini":"google/gemini-4-hydrogen","gemini4-argon":"google/gemini-4-argon","gemini31":"google/gemini-3.1-pro-preview","gemini-flash":"google/gemini-4-hydrogen","gemini-flash-lite":"google/gemini-2.5-flash-lite","flash":"google/gemini-4-hydrogen","banana":"google/gemini-nano-banana-2.1","nano-banana":"google/gemini-nano-banana-2.1","nano-banana-pro":"google/gemini-3-pro-image","nano-banana-pro-preview":"google/gemini-3-pro-image-preview","nano-banana-lite":"google/gemini-3.1-flash-lite-image","grok-image":"xai/grok-imagine-image-2.0","image-sunburst25":"openai-codex/gpt-image-2.5-sunburst","image-flare25":"openai-codex/gpt-image-2.5-flare","image2":"openai-codex/gpt-image-2","sonnet5":"anthropic/claude-sonnet-5","opus5":"anthropic/claude-opus-5","fable51":"anthropic/claude-fable-5-1","haiku45":"anthropic/claude-haiku-4-5","sol6":"openai-codex/gpt-6-sol","sol56":"openai-codex/gpt-5.6-sol","luna56":"openai-codex/gpt-5.6-luna","grok46":"xai/grok-4.6","terra56":"openai-codex/gpt-5.6-terra","gemini4-carbon":"google/gemini-4-carbon","flash38":"google/gemini-3.8-flash","image":"openai-codex/gpt-image-2.6-sunburst","image-sunburst":"openai-codex/gpt-image-2.6-sunburst","image-flare":"openai-codex/gpt-image-2.6-flare","opus":"anthropic/claude-opus-5-5","sonnet":"anthropic/claude-sonnet-5-5","fable":"anthropic/claude-fable-5-2","haiku":"anthropic/claude-haiku-5-5","gpt":"openai-codex/gpt-6.1-sol","sol":"openai-codex/gpt-6.1-sol","luna":"openai-codex/gpt-6-luna","astra":"openai-codex/gpt-6-astra","terra":"openai-codex/gpt-6.1-terra","grok":"xai/grok-4.7"};
1693
1693
  for (const [alias, ref] of Object.entries(JOHNNESS_MASTER_ALIASES)) DEFAULT_MODEL_ALIASES[alias] = ref;
1694
1694
  /* JOHNNESS_MODELS_MASTER:END */
1695
1695
  const DEFAULT_MODEL_COST = {
@@ -1620,7 +1620,7 @@ Object.assign(DEFAULT_MODEL_ALIASES, {
1620
1620
  grok46: "xai/grok-4.6"
1621
1621
  });
1622
1622
  /* JOHNNESS_MODELS_MASTER:BEGIN aliases (generated from models/models.json by scripts/models-sync.mjs; edit the master, not this block) */
1623
- const JOHNNESS_MASTER_ALIASES = {"deepseek":"deepseek/deepseek-flash","deepseek-pro":"deepseek/deepseek-v4-pro","gemini-lite":"google/gemini-3.5-flash-lite","muse":"meta/muse-spark-1.3","muse-spark":"meta/muse-spark-1.3","opus46":"anthropic/claude-opus-4-6","sonnet46":"anthropic/claude-sonnet-4-6","gpt-mini":"openai/gpt-5-mini","gemini":"google/gemini-4-carbon","gemini4-argon":"google/gemini-4-argon","gemini31":"google/gemini-3.1-pro-preview","gemini-flash":"google/gemini-3.8-flash","gemini-flash-lite":"google/gemini-2.5-flash-lite","flash":"google/gemini-3.8-flash","banana":"google/gemini-nano-banana-2.1","nano-banana":"google/gemini-nano-banana-2.1","nano-banana-pro":"google/gemini-3-pro-image","nano-banana-pro-preview":"google/gemini-3-pro-image-preview","nano-banana-lite":"google/gemini-3.1-flash-lite-image","grok-image":"xai/grok-imagine-image-2.0","image-sunburst25":"openai-codex/gpt-image-2.5-sunburst","image-flare25":"openai-codex/gpt-image-2.5-flare","image2":"openai-codex/gpt-image-2","sonnet5":"anthropic/claude-sonnet-5","opus5":"anthropic/claude-opus-5","fable51":"anthropic/claude-fable-5-1","haiku45":"anthropic/claude-haiku-4-5","sol6":"openai-codex/gpt-6-sol","sol56":"openai-codex/gpt-5.6-sol","luna56":"openai-codex/gpt-5.6-luna","grok46":"xai/grok-4.6","terra56":"openai-codex/gpt-5.6-terra","image":"openai-codex/gpt-image-2.6-sunburst","image-sunburst":"openai-codex/gpt-image-2.6-sunburst","image-flare":"openai-codex/gpt-image-2.6-flare","opus":"anthropic/claude-opus-5-5","sonnet":"anthropic/claude-sonnet-5-5","fable":"anthropic/claude-fable-5-2","haiku":"anthropic/claude-haiku-5-5","gpt":"openai-codex/gpt-6.1-sol","sol":"openai-codex/gpt-6.1-sol","luna":"openai-codex/gpt-6-luna","astra":"openai-codex/gpt-6-astra","terra":"openai-codex/gpt-6.1-terra","grok":"xai/grok-4.7"};
1623
+ const JOHNNESS_MASTER_ALIASES = {"deepseek":"deepseek/deepseek-flash","deepseek-pro":"deepseek/deepseek-v4-pro","gemini-lite":"google/gemini-3.5-flash-lite","muse":"meta/muse-spark-1.3","muse-spark":"meta/muse-spark-1.3","opus46":"anthropic/claude-opus-4-6","sonnet46":"anthropic/claude-sonnet-4-6","gpt-mini":"openai/gpt-5-mini","gemini":"google/gemini-4-hydrogen","gemini4-argon":"google/gemini-4-argon","gemini31":"google/gemini-3.1-pro-preview","gemini-flash":"google/gemini-4-hydrogen","gemini-flash-lite":"google/gemini-2.5-flash-lite","flash":"google/gemini-4-hydrogen","banana":"google/gemini-nano-banana-2.1","nano-banana":"google/gemini-nano-banana-2.1","nano-banana-pro":"google/gemini-3-pro-image","nano-banana-pro-preview":"google/gemini-3-pro-image-preview","nano-banana-lite":"google/gemini-3.1-flash-lite-image","grok-image":"xai/grok-imagine-image-2.0","image-sunburst25":"openai-codex/gpt-image-2.5-sunburst","image-flare25":"openai-codex/gpt-image-2.5-flare","image2":"openai-codex/gpt-image-2","sonnet5":"anthropic/claude-sonnet-5","opus5":"anthropic/claude-opus-5","fable51":"anthropic/claude-fable-5-1","haiku45":"anthropic/claude-haiku-4-5","sol6":"openai-codex/gpt-6-sol","sol56":"openai-codex/gpt-5.6-sol","luna56":"openai-codex/gpt-5.6-luna","grok46":"xai/grok-4.6","terra56":"openai-codex/gpt-5.6-terra","gemini4-carbon":"google/gemini-4-carbon","flash38":"google/gemini-3.8-flash","image":"openai-codex/gpt-image-2.6-sunburst","image-sunburst":"openai-codex/gpt-image-2.6-sunburst","image-flare":"openai-codex/gpt-image-2.6-flare","opus":"anthropic/claude-opus-5-5","sonnet":"anthropic/claude-sonnet-5-5","fable":"anthropic/claude-fable-5-2","haiku":"anthropic/claude-haiku-5-5","gpt":"openai-codex/gpt-6.1-sol","sol":"openai-codex/gpt-6.1-sol","luna":"openai-codex/gpt-6-luna","astra":"openai-codex/gpt-6-astra","terra":"openai-codex/gpt-6.1-terra","grok":"xai/grok-4.7"};
1624
1624
  for (const [alias, ref] of Object.entries(JOHNNESS_MASTER_ALIASES)) DEFAULT_MODEL_ALIASES[alias] = ref;
1625
1625
  /* JOHNNESS_MODELS_MASTER:END */
1626
1626
  const DEFAULT_MODEL_COST = {
@@ -1,3 +1,4 @@
1
+ import { createCallAuth, withServedAuthProfile, formatServedAuthLabel } from "./subscription-call-auth.js"; // JOHNNESS_PATCH_CALL_AUTH_98
1
2
  // JOHNNESS_PATCH_SUBSCRIPTION_USAGE_93 dist/pi-embedded-C6ITuRXf.js
2
3
  import { loadSubscriptionStatus } from "./subscription-usage.js";
3
4
  import { createSubscriptionAuthTracker, formatAuthProfileFallback } from "./anthropic-auth-runtime.js"; // JOHNNESS_PATCH_SUBSCRIPTION_RUNTIME_92
@@ -27893,7 +27894,11 @@ async function buildExportSessionReply(params) {
27893
27894
  }
27894
27895
  //#endregion
27895
27896
  //#region src/agents/model-auth-label.ts
27896
- function resolveModelAuthLabel(params) {
27897
+ function resolveModelAuthLabel(params) { // JOHNNESS_PATCH_CALL_AUTH_98: the transcript names the profile that served the latest model call
27898
+ params = withServedAuthProfile(params);
27899
+ return formatServedAuthLabel(resolveStoredModelAuthLabel(params), params);
27900
+ }
27901
+ function resolveStoredModelAuthLabel(params) {
27897
27902
  const resolvedProvider = params.provider?.trim();
27898
27903
  if (!resolvedProvider) return;
27899
27904
  const providerKey = normalizeProviderId(resolvedProvider);
@@ -103143,6 +103148,7 @@ async function runEmbeddedAttempt(params) {
103143
103148
  activeSession.agent.streamFn = wrapStreamFnTrimToolCallNames(activeSession.agent.streamFn, allowedToolNames);
103144
103149
  if (isXaiProvider(params.provider, params.modelId)) activeSession.agent.streamFn = wrapStreamFnDecodeXaiToolCallArguments(activeSession.agent.streamFn);
103145
103150
  if (anthropicPayloadLogger) activeSession.agent.streamFn = anthropicPayloadLogger.wrapStreamFn(activeSession.agent.streamFn);
103151
+ if (params.callAuth) activeSession.agent.streamFn = params.callAuth.wrapStreamFn(activeSession.agent.streamFn); // JOHNNESS_PATCH_CALL_AUTH_98: outermost, every model call picks its credential
103146
103152
  try {
103147
103153
  const prior = await sanitizeSessionHistory({
103148
103154
  messages: activeSession.messages,
@@ -104250,6 +104256,7 @@ async function runEmbeddedPiAgent(params) {
104250
104256
  }
104251
104257
  };
104252
104258
  const MAX_OVERFLOW_COMPACTION_ATTEMPTS = 3;
104259
+ const callAuth = createCallAuth({ provider, store: authStore, candidates: profileCandidates, lockedProfileId, getIndex: () => profileIndex, setIndex: (index) => { profileIndex = index; }, getProfileId: () => lastProfileId, getKey: () => apiKeyInfo?.apiKey, apply: (candidate) => applyApiKeyInfo(candidate), freshStore: () => ensureAuthProfileStore(agentDir, { allowKeychainPrompt: false }), resolveOrder: () => resolveAuthProfileOrder({ cfg: params.config, store: authStore, provider, preferredProfile: preferredProfileId }), inCooldown: isProfileInCooldown, tracker: subscriptionAuth, warn: (message) => log$3.warn(message) }); // JOHNNESS_PATCH_CALL_AUTH_98: a run is many model calls, not one credential
104253
104260
  const MAX_RUN_LOOP_ITERATIONS = resolveMaxRunRetryIterations(profileCandidates.length);
104254
104261
  let overflowCompactionAttempts = 0;
104255
104262
  let toolResultTruncationAttempted = false;
@@ -104374,6 +104381,7 @@ async function runEmbeddedPiAgent(params) {
104374
104381
  authProfileId: lastProfileId,
104375
104382
  authProfileIdSource: lockedProfileId ? "user" : "auto",
104376
104383
  authStorage,
104384
+ callAuth, // JOHNNESS_PATCH_CALL_AUTH_98
104377
104385
  modelRegistry,
104378
104386
  agentId: workspaceResolution.agentId,
104379
104387
  legacyBeforeAgentStartResult,
@@ -1,3 +1,4 @@
1
+ import { createCallAuth, withServedAuthProfile, formatServedAuthLabel } from "./subscription-call-auth.js"; // JOHNNESS_PATCH_CALL_AUTH_98
1
2
  // JOHNNESS_PATCH_SUBSCRIPTION_USAGE_93 dist/pi-embedded-DoQsYfIY.js
2
3
  import { loadSubscriptionStatus } from "./subscription-usage.js";
3
4
  import { createSubscriptionAuthTracker, formatAuthProfileFallback } from "./anthropic-auth-runtime.js"; // JOHNNESS_PATCH_SUBSCRIPTION_RUNTIME_92
@@ -27889,7 +27890,11 @@ async function buildExportSessionReply(params) {
27889
27890
  }
27890
27891
  //#endregion
27891
27892
  //#region src/agents/model-auth-label.ts
27892
- function resolveModelAuthLabel(params) {
27893
+ function resolveModelAuthLabel(params) { // JOHNNESS_PATCH_CALL_AUTH_98: the transcript names the profile that served the latest model call
27894
+ params = withServedAuthProfile(params);
27895
+ return formatServedAuthLabel(resolveStoredModelAuthLabel(params), params);
27896
+ }
27897
+ function resolveStoredModelAuthLabel(params) {
27893
27898
  const resolvedProvider = params.provider?.trim();
27894
27899
  if (!resolvedProvider) return;
27895
27900
  const providerKey = normalizeProviderId(resolvedProvider);
@@ -103133,6 +103138,7 @@ async function runEmbeddedAttempt(params) {
103133
103138
  activeSession.agent.streamFn = wrapStreamFnTrimToolCallNames(activeSession.agent.streamFn, allowedToolNames);
103134
103139
  if (isXaiProvider(params.provider, params.modelId)) activeSession.agent.streamFn = wrapStreamFnDecodeXaiToolCallArguments(activeSession.agent.streamFn);
103135
103140
  if (anthropicPayloadLogger) activeSession.agent.streamFn = anthropicPayloadLogger.wrapStreamFn(activeSession.agent.streamFn);
103141
+ if (params.callAuth) activeSession.agent.streamFn = params.callAuth.wrapStreamFn(activeSession.agent.streamFn); // JOHNNESS_PATCH_CALL_AUTH_98: outermost, every model call picks its credential
103136
103142
  try {
103137
103143
  const prior = await sanitizeSessionHistory({
103138
103144
  messages: activeSession.messages,
@@ -104240,6 +104246,7 @@ async function runEmbeddedPiAgent(params) {
104240
104246
  }
104241
104247
  };
104242
104248
  const MAX_OVERFLOW_COMPACTION_ATTEMPTS = 3;
104249
+ const callAuth = createCallAuth({ provider, store: authStore, candidates: profileCandidates, lockedProfileId, getIndex: () => profileIndex, setIndex: (index) => { profileIndex = index; }, getProfileId: () => lastProfileId, getKey: () => apiKeyInfo?.apiKey, apply: (candidate) => applyApiKeyInfo(candidate), freshStore: () => ensureAuthProfileStore(agentDir, { allowKeychainPrompt: false }), resolveOrder: () => resolveAuthProfileOrder({ cfg: params.config, store: authStore, provider, preferredProfile: preferredProfileId }), inCooldown: isProfileInCooldown, tracker: subscriptionAuth, warn: (message) => log$3.warn(message) }); // JOHNNESS_PATCH_CALL_AUTH_98: a run is many model calls, not one credential
104243
104250
  const MAX_RUN_LOOP_ITERATIONS = resolveMaxRunRetryIterations(profileCandidates.length);
104244
104251
  let overflowCompactionAttempts = 0;
104245
104252
  let toolResultTruncationAttempted = false;
@@ -104357,6 +104364,7 @@ async function runEmbeddedPiAgent(params) {
104357
104364
  authProfileId: lastProfileId,
104358
104365
  authProfileIdSource: lockedProfileId ? "user" : "auto",
104359
104366
  authStorage,
104367
+ callAuth, // JOHNNESS_PATCH_CALL_AUTH_98
104360
104368
  modelRegistry,
104361
104369
  agentId: workspaceResolution.agentId,
104362
104370
  legacyBeforeAgentStartResult,
@@ -7123,7 +7123,7 @@ Object.assign(DEFAULT_MODEL_ALIASES, {
7123
7123
  grok46: "xai/grok-4.6"
7124
7124
  });
7125
7125
  /* JOHNNESS_MODELS_MASTER:BEGIN aliases (generated from models/models.json by scripts/models-sync.mjs; edit the master, not this block) */
7126
- const JOHNNESS_MASTER_ALIASES = {"deepseek":"deepseek/deepseek-flash","deepseek-pro":"deepseek/deepseek-v4-pro","gemini-lite":"google/gemini-3.5-flash-lite","muse":"meta/muse-spark-1.3","muse-spark":"meta/muse-spark-1.3","opus46":"anthropic/claude-opus-4-6","sonnet46":"anthropic/claude-sonnet-4-6","gpt-mini":"openai/gpt-5-mini","gemini":"google/gemini-4-carbon","gemini4-argon":"google/gemini-4-argon","gemini31":"google/gemini-3.1-pro-preview","gemini-flash":"google/gemini-3.8-flash","gemini-flash-lite":"google/gemini-2.5-flash-lite","flash":"google/gemini-3.8-flash","banana":"google/gemini-nano-banana-2.1","nano-banana":"google/gemini-nano-banana-2.1","nano-banana-pro":"google/gemini-3-pro-image","nano-banana-pro-preview":"google/gemini-3-pro-image-preview","nano-banana-lite":"google/gemini-3.1-flash-lite-image","grok-image":"xai/grok-imagine-image-2.0","image-sunburst25":"openai-codex/gpt-image-2.5-sunburst","image-flare25":"openai-codex/gpt-image-2.5-flare","image2":"openai-codex/gpt-image-2","sonnet5":"anthropic/claude-sonnet-5","opus5":"anthropic/claude-opus-5","fable51":"anthropic/claude-fable-5-1","haiku45":"anthropic/claude-haiku-4-5","sol6":"openai-codex/gpt-6-sol","sol56":"openai-codex/gpt-5.6-sol","luna56":"openai-codex/gpt-5.6-luna","grok46":"xai/grok-4.6","terra56":"openai-codex/gpt-5.6-terra","image":"openai-codex/gpt-image-2.6-sunburst","image-sunburst":"openai-codex/gpt-image-2.6-sunburst","image-flare":"openai-codex/gpt-image-2.6-flare","opus":"anthropic/claude-opus-5-5","sonnet":"anthropic/claude-sonnet-5-5","fable":"anthropic/claude-fable-5-2","haiku":"anthropic/claude-haiku-5-5","gpt":"openai-codex/gpt-6.1-sol","sol":"openai-codex/gpt-6.1-sol","luna":"openai-codex/gpt-6-luna","astra":"openai-codex/gpt-6-astra","terra":"openai-codex/gpt-6.1-terra","grok":"xai/grok-4.7"};
7126
+ const JOHNNESS_MASTER_ALIASES = {"deepseek":"deepseek/deepseek-flash","deepseek-pro":"deepseek/deepseek-v4-pro","gemini-lite":"google/gemini-3.5-flash-lite","muse":"meta/muse-spark-1.3","muse-spark":"meta/muse-spark-1.3","opus46":"anthropic/claude-opus-4-6","sonnet46":"anthropic/claude-sonnet-4-6","gpt-mini":"openai/gpt-5-mini","gemini":"google/gemini-4-hydrogen","gemini4-argon":"google/gemini-4-argon","gemini31":"google/gemini-3.1-pro-preview","gemini-flash":"google/gemini-4-hydrogen","gemini-flash-lite":"google/gemini-2.5-flash-lite","flash":"google/gemini-4-hydrogen","banana":"google/gemini-nano-banana-2.1","nano-banana":"google/gemini-nano-banana-2.1","nano-banana-pro":"google/gemini-3-pro-image","nano-banana-pro-preview":"google/gemini-3-pro-image-preview","nano-banana-lite":"google/gemini-3.1-flash-lite-image","grok-image":"xai/grok-imagine-image-2.0","image-sunburst25":"openai-codex/gpt-image-2.5-sunburst","image-flare25":"openai-codex/gpt-image-2.5-flare","image2":"openai-codex/gpt-image-2","sonnet5":"anthropic/claude-sonnet-5","opus5":"anthropic/claude-opus-5","fable51":"anthropic/claude-fable-5-1","haiku45":"anthropic/claude-haiku-4-5","sol6":"openai-codex/gpt-6-sol","sol56":"openai-codex/gpt-5.6-sol","luna56":"openai-codex/gpt-5.6-luna","grok46":"xai/grok-4.6","terra56":"openai-codex/gpt-5.6-terra","gemini4-carbon":"google/gemini-4-carbon","flash38":"google/gemini-3.8-flash","image":"openai-codex/gpt-image-2.6-sunburst","image-sunburst":"openai-codex/gpt-image-2.6-sunburst","image-flare":"openai-codex/gpt-image-2.6-flare","opus":"anthropic/claude-opus-5-5","sonnet":"anthropic/claude-sonnet-5-5","fable":"anthropic/claude-fable-5-2","haiku":"anthropic/claude-haiku-5-5","gpt":"openai-codex/gpt-6.1-sol","sol":"openai-codex/gpt-6.1-sol","luna":"openai-codex/gpt-6-luna","astra":"openai-codex/gpt-6-astra","terra":"openai-codex/gpt-6.1-terra","grok":"xai/grok-4.7"};
7127
7127
  for (const [alias, ref] of Object.entries(JOHNNESS_MASTER_ALIASES)) DEFAULT_MODEL_ALIASES[alias] = ref;
7128
7128
  /* JOHNNESS_MODELS_MASTER:END */
7129
7129
  const DEFAULT_MODEL_COST = {
@@ -8124,7 +8124,7 @@ Object.assign(DEFAULT_MODEL_ALIASES, {
8124
8124
  grok46: "xai/grok-4.6"
8125
8125
  });
8126
8126
  /* JOHNNESS_MODELS_MASTER:BEGIN aliases (generated from models/models.json by scripts/models-sync.mjs; edit the master, not this block) */
8127
- const JOHNNESS_MASTER_ALIASES = {"deepseek":"deepseek/deepseek-flash","deepseek-pro":"deepseek/deepseek-v4-pro","gemini-lite":"google/gemini-3.5-flash-lite","muse":"meta/muse-spark-1.3","muse-spark":"meta/muse-spark-1.3","opus46":"anthropic/claude-opus-4-6","sonnet46":"anthropic/claude-sonnet-4-6","gpt-mini":"openai/gpt-5-mini","gemini":"google/gemini-4-carbon","gemini4-argon":"google/gemini-4-argon","gemini31":"google/gemini-3.1-pro-preview","gemini-flash":"google/gemini-3.8-flash","gemini-flash-lite":"google/gemini-2.5-flash-lite","flash":"google/gemini-3.8-flash","banana":"google/gemini-nano-banana-2.1","nano-banana":"google/gemini-nano-banana-2.1","nano-banana-pro":"google/gemini-3-pro-image","nano-banana-pro-preview":"google/gemini-3-pro-image-preview","nano-banana-lite":"google/gemini-3.1-flash-lite-image","grok-image":"xai/grok-imagine-image-2.0","image-sunburst25":"openai-codex/gpt-image-2.5-sunburst","image-flare25":"openai-codex/gpt-image-2.5-flare","image2":"openai-codex/gpt-image-2","sonnet5":"anthropic/claude-sonnet-5","opus5":"anthropic/claude-opus-5","fable51":"anthropic/claude-fable-5-1","haiku45":"anthropic/claude-haiku-4-5","sol6":"openai-codex/gpt-6-sol","sol56":"openai-codex/gpt-5.6-sol","luna56":"openai-codex/gpt-5.6-luna","grok46":"xai/grok-4.6","terra56":"openai-codex/gpt-5.6-terra","image":"openai-codex/gpt-image-2.6-sunburst","image-sunburst":"openai-codex/gpt-image-2.6-sunburst","image-flare":"openai-codex/gpt-image-2.6-flare","opus":"anthropic/claude-opus-5-5","sonnet":"anthropic/claude-sonnet-5-5","fable":"anthropic/claude-fable-5-2","haiku":"anthropic/claude-haiku-5-5","gpt":"openai-codex/gpt-6.1-sol","sol":"openai-codex/gpt-6.1-sol","luna":"openai-codex/gpt-6-luna","astra":"openai-codex/gpt-6-astra","terra":"openai-codex/gpt-6.1-terra","grok":"xai/grok-4.7"};
8127
+ const JOHNNESS_MASTER_ALIASES = {"deepseek":"deepseek/deepseek-flash","deepseek-pro":"deepseek/deepseek-v4-pro","gemini-lite":"google/gemini-3.5-flash-lite","muse":"meta/muse-spark-1.3","muse-spark":"meta/muse-spark-1.3","opus46":"anthropic/claude-opus-4-6","sonnet46":"anthropic/claude-sonnet-4-6","gpt-mini":"openai/gpt-5-mini","gemini":"google/gemini-4-hydrogen","gemini4-argon":"google/gemini-4-argon","gemini31":"google/gemini-3.1-pro-preview","gemini-flash":"google/gemini-4-hydrogen","gemini-flash-lite":"google/gemini-2.5-flash-lite","flash":"google/gemini-4-hydrogen","banana":"google/gemini-nano-banana-2.1","nano-banana":"google/gemini-nano-banana-2.1","nano-banana-pro":"google/gemini-3-pro-image","nano-banana-pro-preview":"google/gemini-3-pro-image-preview","nano-banana-lite":"google/gemini-3.1-flash-lite-image","grok-image":"xai/grok-imagine-image-2.0","image-sunburst25":"openai-codex/gpt-image-2.5-sunburst","image-flare25":"openai-codex/gpt-image-2.5-flare","image2":"openai-codex/gpt-image-2","sonnet5":"anthropic/claude-sonnet-5","opus5":"anthropic/claude-opus-5","fable51":"anthropic/claude-fable-5-1","haiku45":"anthropic/claude-haiku-4-5","sol6":"openai-codex/gpt-6-sol","sol56":"openai-codex/gpt-5.6-sol","luna56":"openai-codex/gpt-5.6-luna","grok46":"xai/grok-4.6","terra56":"openai-codex/gpt-5.6-terra","gemini4-carbon":"google/gemini-4-carbon","flash38":"google/gemini-3.8-flash","image":"openai-codex/gpt-image-2.6-sunburst","image-sunburst":"openai-codex/gpt-image-2.6-sunburst","image-flare":"openai-codex/gpt-image-2.6-flare","opus":"anthropic/claude-opus-5-5","sonnet":"anthropic/claude-sonnet-5-5","fable":"anthropic/claude-fable-5-2","haiku":"anthropic/claude-haiku-5-5","gpt":"openai-codex/gpt-6.1-sol","sol":"openai-codex/gpt-6.1-sol","luna":"openai-codex/gpt-6-luna","astra":"openai-codex/gpt-6-astra","terra":"openai-codex/gpt-6.1-terra","grok":"xai/grok-4.7"};
8128
8128
  for (const [alias, ref] of Object.entries(JOHNNESS_MASTER_ALIASES)) DEFAULT_MODEL_ALIASES[alias] = ref;
8129
8129
  /* JOHNNESS_MODELS_MASTER:END */
8130
8130
  const DEFAULT_MODEL_COST = {
@@ -5232,7 +5232,7 @@ Object.assign(DEFAULT_MODEL_ALIASES, {
5232
5232
  grok46: "xai/grok-4.6"
5233
5233
  });
5234
5234
  /* JOHNNESS_MODELS_MASTER:BEGIN aliases (generated from models/models.json by scripts/models-sync.mjs; edit the master, not this block) */
5235
- const JOHNNESS_MASTER_ALIASES = {"deepseek":"deepseek/deepseek-flash","deepseek-pro":"deepseek/deepseek-v4-pro","gemini-lite":"google/gemini-3.5-flash-lite","muse":"meta/muse-spark-1.3","muse-spark":"meta/muse-spark-1.3","opus46":"anthropic/claude-opus-4-6","sonnet46":"anthropic/claude-sonnet-4-6","gpt-mini":"openai/gpt-5-mini","gemini":"google/gemini-4-carbon","gemini4-argon":"google/gemini-4-argon","gemini31":"google/gemini-3.1-pro-preview","gemini-flash":"google/gemini-3.8-flash","gemini-flash-lite":"google/gemini-2.5-flash-lite","flash":"google/gemini-3.8-flash","banana":"google/gemini-nano-banana-2.1","nano-banana":"google/gemini-nano-banana-2.1","nano-banana-pro":"google/gemini-3-pro-image","nano-banana-pro-preview":"google/gemini-3-pro-image-preview","nano-banana-lite":"google/gemini-3.1-flash-lite-image","grok-image":"xai/grok-imagine-image-2.0","image-sunburst25":"openai-codex/gpt-image-2.5-sunburst","image-flare25":"openai-codex/gpt-image-2.5-flare","image2":"openai-codex/gpt-image-2","sonnet5":"anthropic/claude-sonnet-5","opus5":"anthropic/claude-opus-5","fable51":"anthropic/claude-fable-5-1","haiku45":"anthropic/claude-haiku-4-5","sol6":"openai-codex/gpt-6-sol","sol56":"openai-codex/gpt-5.6-sol","luna56":"openai-codex/gpt-5.6-luna","grok46":"xai/grok-4.6","terra56":"openai-codex/gpt-5.6-terra","image":"openai-codex/gpt-image-2.6-sunburst","image-sunburst":"openai-codex/gpt-image-2.6-sunburst","image-flare":"openai-codex/gpt-image-2.6-flare","opus":"anthropic/claude-opus-5-5","sonnet":"anthropic/claude-sonnet-5-5","fable":"anthropic/claude-fable-5-2","haiku":"anthropic/claude-haiku-5-5","gpt":"openai-codex/gpt-6.1-sol","sol":"openai-codex/gpt-6.1-sol","luna":"openai-codex/gpt-6-luna","astra":"openai-codex/gpt-6-astra","terra":"openai-codex/gpt-6.1-terra","grok":"xai/grok-4.7"};
5235
+ const JOHNNESS_MASTER_ALIASES = {"deepseek":"deepseek/deepseek-flash","deepseek-pro":"deepseek/deepseek-v4-pro","gemini-lite":"google/gemini-3.5-flash-lite","muse":"meta/muse-spark-1.3","muse-spark":"meta/muse-spark-1.3","opus46":"anthropic/claude-opus-4-6","sonnet46":"anthropic/claude-sonnet-4-6","gpt-mini":"openai/gpt-5-mini","gemini":"google/gemini-4-hydrogen","gemini4-argon":"google/gemini-4-argon","gemini31":"google/gemini-3.1-pro-preview","gemini-flash":"google/gemini-4-hydrogen","gemini-flash-lite":"google/gemini-2.5-flash-lite","flash":"google/gemini-4-hydrogen","banana":"google/gemini-nano-banana-2.1","nano-banana":"google/gemini-nano-banana-2.1","nano-banana-pro":"google/gemini-3-pro-image","nano-banana-pro-preview":"google/gemini-3-pro-image-preview","nano-banana-lite":"google/gemini-3.1-flash-lite-image","grok-image":"xai/grok-imagine-image-2.0","image-sunburst25":"openai-codex/gpt-image-2.5-sunburst","image-flare25":"openai-codex/gpt-image-2.5-flare","image2":"openai-codex/gpt-image-2","sonnet5":"anthropic/claude-sonnet-5","opus5":"anthropic/claude-opus-5","fable51":"anthropic/claude-fable-5-1","haiku45":"anthropic/claude-haiku-4-5","sol6":"openai-codex/gpt-6-sol","sol56":"openai-codex/gpt-5.6-sol","luna56":"openai-codex/gpt-5.6-luna","grok46":"xai/grok-4.6","terra56":"openai-codex/gpt-5.6-terra","gemini4-carbon":"google/gemini-4-carbon","flash38":"google/gemini-3.8-flash","image":"openai-codex/gpt-image-2.6-sunburst","image-sunburst":"openai-codex/gpt-image-2.6-sunburst","image-flare":"openai-codex/gpt-image-2.6-flare","opus":"anthropic/claude-opus-5-5","sonnet":"anthropic/claude-sonnet-5-5","fable":"anthropic/claude-fable-5-2","haiku":"anthropic/claude-haiku-5-5","gpt":"openai-codex/gpt-6.1-sol","sol":"openai-codex/gpt-6.1-sol","luna":"openai-codex/gpt-6-luna","astra":"openai-codex/gpt-6-astra","terra":"openai-codex/gpt-6.1-terra","grok":"xai/grok-4.7"};
5236
5236
  for (const [alias, ref] of Object.entries(JOHNNESS_MASTER_ALIASES)) DEFAULT_MODEL_ALIASES[alias] = ref;
5237
5237
  /* JOHNNESS_MODELS_MASTER:END */
5238
5238
  const DEFAULT_MODEL_COST = {
@@ -1,3 +1,4 @@
1
+ import { createCallAuth, withServedAuthProfile, formatServedAuthLabel } from "../subscription-call-auth.js"; // JOHNNESS_PATCH_CALL_AUTH_98
1
2
  // JOHNNESS_PATCH_SUBSCRIPTION_USAGE_93 dist/plugin-sdk/dispatch-BP0viZiL.js
2
3
  import { loadSubscriptionStatus } from "../subscription-usage.js";
3
4
  import { createSubscriptionAuthTracker, formatAuthProfileFallback } from "../anthropic-auth-runtime.js"; // JOHNNESS_PATCH_SUBSCRIPTION_RUNTIME_92
@@ -24290,7 +24291,11 @@ async function recordDiscordModelPickerRecentModel(params) {
24290
24291
  }
24291
24292
  //#endregion
24292
24293
  //#region src/agents/model-auth-label.ts
24293
- function resolveModelAuthLabel(params) {
24294
+ function resolveModelAuthLabel(params) { // JOHNNESS_PATCH_CALL_AUTH_98: the transcript names the profile that served the latest model call
24295
+ params = withServedAuthProfile(params);
24296
+ return formatServedAuthLabel(resolveStoredModelAuthLabel(params), params);
24297
+ }
24298
+ function resolveStoredModelAuthLabel(params) {
24294
24299
  const resolvedProvider = params.provider?.trim();
24295
24300
  if (!resolvedProvider) return;
24296
24301
  const providerKey = normalizeProviderId(resolvedProvider);
@@ -87392,6 +87397,7 @@ async function runEmbeddedAttempt(params) {
87392
87397
  activeSession.agent.streamFn = wrapStreamFnTrimToolCallNames(activeSession.agent.streamFn, allowedToolNames);
87393
87398
  if (isXaiProvider(params.provider, params.modelId)) activeSession.agent.streamFn = wrapStreamFnDecodeXaiToolCallArguments(activeSession.agent.streamFn);
87394
87399
  if (anthropicPayloadLogger) activeSession.agent.streamFn = anthropicPayloadLogger.wrapStreamFn(activeSession.agent.streamFn);
87400
+ if (params.callAuth) activeSession.agent.streamFn = params.callAuth.wrapStreamFn(activeSession.agent.streamFn); // JOHNNESS_PATCH_CALL_AUTH_98: outermost, every model call picks its credential
87395
87401
  try {
87396
87402
  const prior = await sanitizeSessionHistory({
87397
87403
  messages: activeSession.messages,
@@ -88481,6 +88487,7 @@ async function runEmbeddedPiAgent(params) {
88481
88487
  }
88482
88488
  };
88483
88489
  const MAX_OVERFLOW_COMPACTION_ATTEMPTS = 3;
88490
+ const callAuth = createCallAuth({ provider, store: authStore, candidates: profileCandidates, lockedProfileId, getIndex: () => profileIndex, setIndex: (index) => { profileIndex = index; }, getProfileId: () => lastProfileId, getKey: () => apiKeyInfo?.apiKey, apply: (candidate) => applyApiKeyInfo(candidate), freshStore: () => ensureAuthProfileStore(agentDir, { allowKeychainPrompt: false }), resolveOrder: () => resolveAuthProfileOrder({ cfg: params.config, store: authStore, provider, preferredProfile: preferredProfileId }), inCooldown: isProfileInCooldown, tracker: subscriptionAuth, warn: (message) => log$7.warn(message) }); // JOHNNESS_PATCH_CALL_AUTH_98: a run is many model calls, not one credential
88484
88491
  const MAX_RUN_LOOP_ITERATIONS = resolveMaxRunRetryIterations(profileCandidates.length);
88485
88492
  let overflowCompactionAttempts = 0;
88486
88493
  let toolResultTruncationAttempted = false;
@@ -88597,6 +88604,7 @@ async function runEmbeddedPiAgent(params) {
88597
88604
  authProfileId: lastProfileId,
88598
88605
  authProfileIdSource: lockedProfileId ? "user" : "auto",
88599
88606
  authStorage,
88607
+ callAuth, // JOHNNESS_PATCH_CALL_AUTH_98
88600
88608
  modelRegistry,
88601
88609
  agentId: workspaceResolution.agentId,
88602
88610
  legacyBeforeAgentStartResult,
@@ -1,3 +1,4 @@
1
+ import { createCallAuth, withServedAuthProfile, formatServedAuthLabel } from "../subscription-call-auth.js"; // JOHNNESS_PATCH_CALL_AUTH_98
1
2
  // JOHNNESS_PATCH_SUBSCRIPTION_USAGE_93 dist/plugin-sdk/dispatch-CQsjmw7g.js
2
3
  import { loadSubscriptionStatus } from "../subscription-usage.js";
3
4
  import { createSubscriptionAuthTracker, formatAuthProfileFallback } from "../anthropic-auth-runtime.js"; // JOHNNESS_PATCH_SUBSCRIPTION_RUNTIME_92
@@ -24399,7 +24400,11 @@ async function recordDiscordModelPickerRecentModel(params) {
24399
24400
  }
24400
24401
  //#endregion
24401
24402
  //#region src/agents/model-auth-label.ts
24402
- function resolveModelAuthLabel(params) {
24403
+ function resolveModelAuthLabel(params) { // JOHNNESS_PATCH_CALL_AUTH_98: the transcript names the profile that served the latest model call
24404
+ params = withServedAuthProfile(params);
24405
+ return formatServedAuthLabel(resolveStoredModelAuthLabel(params), params);
24406
+ }
24407
+ function resolveStoredModelAuthLabel(params) {
24403
24408
  const resolvedProvider = params.provider?.trim();
24404
24409
  if (!resolvedProvider) return;
24405
24410
  const providerKey = normalizeProviderId(resolvedProvider);
@@ -87392,6 +87397,7 @@ async function runEmbeddedAttempt(params) {
87392
87397
  activeSession.agent.streamFn = wrapStreamFnTrimToolCallNames(activeSession.agent.streamFn, allowedToolNames);
87393
87398
  if (isXaiProvider(params.provider, params.modelId)) activeSession.agent.streamFn = wrapStreamFnDecodeXaiToolCallArguments(activeSession.agent.streamFn);
87394
87399
  if (anthropicPayloadLogger) activeSession.agent.streamFn = anthropicPayloadLogger.wrapStreamFn(activeSession.agent.streamFn);
87400
+ if (params.callAuth) activeSession.agent.streamFn = params.callAuth.wrapStreamFn(activeSession.agent.streamFn); // JOHNNESS_PATCH_CALL_AUTH_98: outermost, every model call picks its credential
87395
87401
  try {
87396
87402
  const prior = await sanitizeSessionHistory({
87397
87403
  messages: activeSession.messages,
@@ -88481,6 +88487,7 @@ async function runEmbeddedPiAgent(params) {
88481
88487
  }
88482
88488
  };
88483
88489
  const MAX_OVERFLOW_COMPACTION_ATTEMPTS = 3;
88490
+ const callAuth = createCallAuth({ provider, store: authStore, candidates: profileCandidates, lockedProfileId, getIndex: () => profileIndex, setIndex: (index) => { profileIndex = index; }, getProfileId: () => lastProfileId, getKey: () => apiKeyInfo?.apiKey, apply: (candidate) => applyApiKeyInfo(candidate), freshStore: () => ensureAuthProfileStore(agentDir, { allowKeychainPrompt: false }), resolveOrder: () => resolveAuthProfileOrder({ cfg: params.config, store: authStore, provider, preferredProfile: preferredProfileId }), inCooldown: isProfileInCooldown, tracker: subscriptionAuth, warn: (message) => log$7.warn(message) }); // JOHNNESS_PATCH_CALL_AUTH_98: a run is many model calls, not one credential
88484
88491
  const MAX_RUN_LOOP_ITERATIONS = resolveMaxRunRetryIterations(profileCandidates.length);
88485
88492
  let overflowCompactionAttempts = 0;
88486
88493
  let toolResultTruncationAttempted = false;
@@ -88597,6 +88604,7 @@ async function runEmbeddedPiAgent(params) {
88597
88604
  authProfileId: lastProfileId,
88598
88605
  authProfileIdSource: lockedProfileId ? "user" : "auto",
88599
88606
  authStorage,
88607
+ callAuth, // JOHNNESS_PATCH_CALL_AUTH_98
88600
88608
  modelRegistry,
88601
88609
  agentId: workspaceResolution.agentId,
88602
88610
  legacyBeforeAgentStartResult,
@@ -1,3 +1,4 @@
1
+ import { createCallAuth, withServedAuthProfile, formatServedAuthLabel } from "../subscription-call-auth.js"; // JOHNNESS_PATCH_CALL_AUTH_98
1
2
  // JOHNNESS_PATCH_SUBSCRIPTION_USAGE_93 dist/plugin-sdk/dispatch-Cerq29sy.js
2
3
  import { loadSubscriptionStatus } from "../subscription-usage.js";
3
4
  import { createSubscriptionAuthTracker, formatAuthProfileFallback } from "../anthropic-auth-runtime.js"; // JOHNNESS_PATCH_SUBSCRIPTION_RUNTIME_92
@@ -24983,7 +24984,11 @@ async function recordDiscordModelPickerRecentModel(params) {
24983
24984
  }
24984
24985
  //#endregion
24985
24986
  //#region src/agents/model-auth-label.ts
24986
- function resolveModelAuthLabel(params) {
24987
+ function resolveModelAuthLabel(params) { // JOHNNESS_PATCH_CALL_AUTH_98: the transcript names the profile that served the latest model call
24988
+ params = withServedAuthProfile(params);
24989
+ return formatServedAuthLabel(resolveStoredModelAuthLabel(params), params);
24990
+ }
24991
+ function resolveStoredModelAuthLabel(params) {
24987
24992
  const resolvedProvider = params.provider?.trim();
24988
24993
  if (!resolvedProvider) return;
24989
24994
  const providerKey = normalizeProviderId(resolvedProvider);
@@ -87706,6 +87711,7 @@ async function runEmbeddedAttempt(params) {
87706
87711
  activeSession.agent.streamFn = wrapStreamFnTrimToolCallNames(activeSession.agent.streamFn, allowedToolNames);
87707
87712
  if (isXaiProvider(params.provider, params.modelId)) activeSession.agent.streamFn = wrapStreamFnDecodeXaiToolCallArguments(activeSession.agent.streamFn);
87708
87713
  if (anthropicPayloadLogger) activeSession.agent.streamFn = anthropicPayloadLogger.wrapStreamFn(activeSession.agent.streamFn);
87714
+ if (params.callAuth) activeSession.agent.streamFn = params.callAuth.wrapStreamFn(activeSession.agent.streamFn); // JOHNNESS_PATCH_CALL_AUTH_98: outermost, every model call picks its credential
87709
87715
  try {
87710
87716
  const prior = await sanitizeSessionHistory({
87711
87717
  messages: activeSession.messages,
@@ -88795,6 +88801,7 @@ async function runEmbeddedPiAgent(params) {
88795
88801
  }
88796
88802
  };
88797
88803
  const MAX_OVERFLOW_COMPACTION_ATTEMPTS = 3;
88804
+ const callAuth = createCallAuth({ provider, store: authStore, candidates: profileCandidates, lockedProfileId, getIndex: () => profileIndex, setIndex: (index) => { profileIndex = index; }, getProfileId: () => lastProfileId, getKey: () => apiKeyInfo?.apiKey, apply: (candidate) => applyApiKeyInfo(candidate), freshStore: () => ensureAuthProfileStore(agentDir, { allowKeychainPrompt: false }), resolveOrder: () => resolveAuthProfileOrder({ cfg: params.config, store: authStore, provider, preferredProfile: preferredProfileId }), inCooldown: isProfileInCooldown, tracker: subscriptionAuth, warn: (message) => log$7.warn(message) }); // JOHNNESS_PATCH_CALL_AUTH_98: a run is many model calls, not one credential
88798
88805
  const MAX_RUN_LOOP_ITERATIONS = resolveMaxRunRetryIterations(profileCandidates.length);
88799
88806
  let overflowCompactionAttempts = 0;
88800
88807
  let toolResultTruncationAttempted = false;
@@ -88911,6 +88918,7 @@ async function runEmbeddedPiAgent(params) {
88911
88918
  authProfileId: lastProfileId,
88912
88919
  authProfileIdSource: lockedProfileId ? "user" : "auto",
88913
88920
  authStorage,
88921
+ callAuth, // JOHNNESS_PATCH_CALL_AUTH_98
88914
88922
  modelRegistry,
88915
88923
  agentId: workspaceResolution.agentId,
88916
88924
  legacyBeforeAgentStartResult,
@@ -1,3 +1,4 @@
1
+ import { createCallAuth, withServedAuthProfile, formatServedAuthLabel } from "../subscription-call-auth.js"; // JOHNNESS_PATCH_CALL_AUTH_98
1
2
  // JOHNNESS_PATCH_SUBSCRIPTION_USAGE_93 dist/plugin-sdk/dispatch-Cndjtt0g.js
2
3
  import { loadSubscriptionStatus } from "../subscription-usage.js";
3
4
  import { createSubscriptionAuthTracker, formatAuthProfileFallback } from "../anthropic-auth-runtime.js"; // JOHNNESS_PATCH_SUBSCRIPTION_RUNTIME_92
@@ -24664,7 +24665,11 @@ async function recordDiscordModelPickerRecentModel(params) {
24664
24665
  }
24665
24666
  //#endregion
24666
24667
  //#region src/agents/model-auth-label.ts
24667
- function resolveModelAuthLabel(params) {
24668
+ function resolveModelAuthLabel(params) { // JOHNNESS_PATCH_CALL_AUTH_98: the transcript names the profile that served the latest model call
24669
+ params = withServedAuthProfile(params);
24670
+ return formatServedAuthLabel(resolveStoredModelAuthLabel(params), params);
24671
+ }
24672
+ function resolveStoredModelAuthLabel(params) {
24668
24673
  const resolvedProvider = params.provider?.trim();
24669
24674
  if (!resolvedProvider) return;
24670
24675
  const providerKey = normalizeProviderId(resolvedProvider);
@@ -87433,6 +87438,7 @@ async function runEmbeddedAttempt(params) {
87433
87438
  activeSession.agent.streamFn = wrapStreamFnTrimToolCallNames(activeSession.agent.streamFn, allowedToolNames);
87434
87439
  if (isXaiProvider(params.provider, params.modelId)) activeSession.agent.streamFn = wrapStreamFnDecodeXaiToolCallArguments(activeSession.agent.streamFn);
87435
87440
  if (anthropicPayloadLogger) activeSession.agent.streamFn = anthropicPayloadLogger.wrapStreamFn(activeSession.agent.streamFn);
87441
+ if (params.callAuth) activeSession.agent.streamFn = params.callAuth.wrapStreamFn(activeSession.agent.streamFn); // JOHNNESS_PATCH_CALL_AUTH_98: outermost, every model call picks its credential
87436
87442
  try {
87437
87443
  const prior = await sanitizeSessionHistory({
87438
87444
  messages: activeSession.messages,
@@ -88522,6 +88528,7 @@ async function runEmbeddedPiAgent(params) {
88522
88528
  }
88523
88529
  };
88524
88530
  const MAX_OVERFLOW_COMPACTION_ATTEMPTS = 3;
88531
+ const callAuth = createCallAuth({ provider, store: authStore, candidates: profileCandidates, lockedProfileId, getIndex: () => profileIndex, setIndex: (index) => { profileIndex = index; }, getProfileId: () => lastProfileId, getKey: () => apiKeyInfo?.apiKey, apply: (candidate) => applyApiKeyInfo(candidate), freshStore: () => ensureAuthProfileStore(agentDir, { allowKeychainPrompt: false }), resolveOrder: () => resolveAuthProfileOrder({ cfg: params.config, store: authStore, provider, preferredProfile: preferredProfileId }), inCooldown: isProfileInCooldown, tracker: subscriptionAuth, warn: (message) => log$7.warn(message) }); // JOHNNESS_PATCH_CALL_AUTH_98: a run is many model calls, not one credential
88525
88532
  const MAX_RUN_LOOP_ITERATIONS = resolveMaxRunRetryIterations(profileCandidates.length);
88526
88533
  let overflowCompactionAttempts = 0;
88527
88534
  let toolResultTruncationAttempted = false;
@@ -88638,6 +88645,7 @@ async function runEmbeddedPiAgent(params) {
88638
88645
  authProfileId: lastProfileId,
88639
88646
  authProfileIdSource: lockedProfileId ? "user" : "auto",
88640
88647
  authStorage,
88648
+ callAuth, // JOHNNESS_PATCH_CALL_AUTH_98
88641
88649
  modelRegistry,
88642
88650
  agentId: workspaceResolution.agentId,
88643
88651
  legacyBeforeAgentStartResult,