johns-harness 2026.10.17 → 2026.10.18
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/CHANGELOG.md +9 -0
- package/README.md +1 -1
- package/dist/pi-embedded-helpers-B7bn2aDM.js +5 -1
- package/dist/pi-embedded-helpers-CGK9ncQY.js +5 -1
- package/dist/pi-embedded-helpers-CkWXaNFn.js +5 -1
- package/dist/pi-embedded-helpers-DLLQ3MsR.js +5 -1
- package/dist/plugin-sdk/pi-embedded-helpers-B89Z8pGU.js +5 -1
- package/dist/plugin-sdk/pi-embedded-helpers-BDFUaaiY.js +5 -1
- package/dist/plugin-sdk/pi-embedded-helpers-BnFhV3or.js +5 -1
- package/dist/plugin-sdk/pi-embedded-helpers-CRUVFL1T.js +5 -1
- package/dist/plugin-sdk/pi-embedded-helpers-CY7PsNpl.js +5 -1
- package/dist/plugin-sdk/pi-embedded-helpers-Dira0ZRW.js +5 -1
- package/docs/PATCHES.md +17 -0
- package/node_modules/@mariozechner/pi-ai/dist/providers/anthropic.js +2 -1
- package/package.json +1 -1
- package/vendor/patched-deps/@mariozechner/pi-ai/dist/providers/anthropic.js +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 2026.10.18
|
|
4
|
+
|
|
5
|
+
- **Claude subscription proven live and fixed to fail over:** a real Decision Team credential (john.rood@decision.com) completed `johnness login claude` on 2026.10.17 end to end: hCaptcha, magic link, consent, `code#state`, token exchange, atomic `anthropic:subscription` storage. Through the harness's own Anthropic adapter, Opus 5.5 answered HTTP 200 with streaming, one tool call and `anthropic-ratelimit-unified-*` headers (`5h-status: allowed`), every subscription turn cost $0, and a forced refresh rotated both tokens through the real resolver. Two things broke on the way, both fixed here.
|
|
6
|
+
- **Current Claude Code user-agent floor:** Anthropic now rejects `claude-cli/2.1.62` for current models with HTTP 400 `claude_code_version_too_old` ("version 2.1.280 or newer is required"). The vendored and installed adapter send `claude-cli/2.1.304` for subscription tokens only; API-key requests are unchanged.
|
|
7
|
+
- **Subscription rejections fail over to the API key:** when an organization has extra usage switched off, Anthropic answers the harness's full request with HTTP 400 "Third-party apps now draw from extra usage, not plan limits" (`anthropic-ratelimit-unified-overage-disabled-reason: org_level_disabled`). The stock classifier treated that 400 as a format error and ended the turn. It and the version rejection are now billing failures in all ten helper bundles: the subscription profile is disabled for the billing backoff and the paid API profile answers the same turn. Verified live: subscription 400, then API-key 200 with the tool call and a normal reply, with the subscription usage still recorded at $0 and the API turns priced normally.
|
|
8
|
+
- **What John or a Decision admin may still toggle:** Anthropic bills third-party apps against the organization's Extra usage, not the included plan limits. With Extra usage off for the Decision Team org, every full harness turn on the subscription falls back to the API key. Turn on Extra usage (Claude admin settings, billing) to have subscription turns served; a bare Claude Code request already succeeds, so the credential and Team entitlement are fine.
|
|
9
|
+
- **Validation:** Family 87 exact replay (adapter + 10 helper copies, `--check` read-only, `--dependency-only`), classifier tests on the verbatim Anthropic messages, real adapter user-agent and $0 tests, older hash-pinned families (67, 78, 81, 82) strip and re-layer Family 87 with Family 86, 543 verifier checks, full suite 1,192 tests (1,187 pass, 5 skip).
|
|
10
|
+
- **Rollback:** `npm i -g johns-harness@2026.10.17`.
|
|
11
|
+
|
|
3
12
|
## 2026.10.17
|
|
4
13
|
|
|
5
14
|
- **Named subscription login:** bare `/login` lists options; `/login chatgpt` (alias `gpt`, case-insensitive) preserves the existing ChatGPT device flow. `/login claude` adds a browser/URL plus complete-code handoff, PKCE and state checks, a 15-minute window and owner-only native dispatch. CLI equivalents are `johnness login [chatgpt|claude]` and `johnness models auth login [chatgpt|claude]`; `--no-browser` supports remote Claude sign-in, and the existing `--device` shortcut still signs in to ChatGPT.
|
package/README.md
CHANGED
|
@@ -51,7 +51,7 @@ Send `/login` to list subscription choices. Use `/login chatgpt` (or `/login gpt
|
|
|
51
51
|
|
|
52
52
|
For **ChatGPT**, open the link, sign in, enter the device code on that page and tap Approve. In Telegram, tap the code to copy it. Enable "Device code authorization for Codex" once in chatgpt.com > Settings > Security; then send `/login chatgpt` for a fresh code. The existing device flow is unchanged.
|
|
53
53
|
|
|
54
|
-
For **Claude**, open the link, sign in to your subscription account, approve, then copy the complete code (including `#state`) from the callback page. Send `/login claude <complete code>` in the same chat. This uses the Claude Code OAuth client and request envelope, not a new third-party Anthropic client. Eligible Pro, Max and Team accounts use subscription limits first, with your existing Anthropic API-key profile as fallback on rate limits, authentication failures or quota exhaustion. Subscription turns record $0; API fallback turns keep normal API pricing. Tokens refresh automatically. Sign-in does not edit gateway configuration.
|
|
54
|
+
For **Claude**, open the link, sign in to your subscription account, approve, then copy the complete code (including `#state`) from the callback page. Send `/login claude <complete code>` in the same chat. This uses the Claude Code OAuth client and request envelope, not a new third-party Anthropic client. Eligible Pro, Max and Team accounts use subscription limits first, with your existing Anthropic API-key profile as fallback on rate limits, authentication failures or quota exhaustion. Subscription turns record $0; API fallback turns keep normal API pricing. Tokens refresh automatically. Sign-in does not edit gateway configuration. If Anthropic answers "Third-party apps now draw from extra usage", your organization has Extra usage switched off; the harness falls back to the API key on that turn, and an org admin can turn Extra usage on in Claude admin billing settings to have subscription turns served.
|
|
55
55
|
|
|
56
56
|
In a terminal, run `johnness login` to list choices, `johnness login chatgpt` or `johnness login claude`. Claude opens the browser and asks for the complete code; use `--no-browser` on a remote host to print the link instead. The equivalent commands are `johnness models auth login chatgpt` and `johnness models auth login claude`. Existing `johnness models auth login --device` remains a ChatGPT shortcut.
|
|
57
57
|
|
|
@@ -226,7 +226,11 @@ const ERROR_PATTERNS = {
|
|
|
226
226
|
/insufficient[_ ]quota/i,
|
|
227
227
|
"credit balance",
|
|
228
228
|
"plans & billing",
|
|
229
|
-
"insufficient balance"
|
|
229
|
+
"insufficient balance",
|
|
230
|
+
// JOHNNESS_PATCH_SUBSCRIPTION_FAILOVER_87: Claude subscription credentials that cannot serve this request.
|
|
231
|
+
"draw from extra usage",
|
|
232
|
+
"claude_code_version_too_old",
|
|
233
|
+
/claude code [0-9.]+ does not support this model/i
|
|
230
234
|
],
|
|
231
235
|
authPermanent: [
|
|
232
236
|
/api[_ ]?key[_ ]?(?:revoked|invalid|deactivated|deleted)/i,
|
|
@@ -226,7 +226,11 @@ const ERROR_PATTERNS = {
|
|
|
226
226
|
/insufficient[_ ]quota/i,
|
|
227
227
|
"credit balance",
|
|
228
228
|
"plans & billing",
|
|
229
|
-
"insufficient balance"
|
|
229
|
+
"insufficient balance",
|
|
230
|
+
// JOHNNESS_PATCH_SUBSCRIPTION_FAILOVER_87: Claude subscription credentials that cannot serve this request.
|
|
231
|
+
"draw from extra usage",
|
|
232
|
+
"claude_code_version_too_old",
|
|
233
|
+
/claude code [0-9.]+ does not support this model/i
|
|
230
234
|
],
|
|
231
235
|
authPermanent: [
|
|
232
236
|
/api[_ ]?key[_ ]?(?:revoked|invalid|deactivated|deleted)/i,
|
|
@@ -8785,7 +8785,11 @@ const ERROR_PATTERNS = {
|
|
|
8785
8785
|
/insufficient[_ ]quota/i,
|
|
8786
8786
|
"credit balance",
|
|
8787
8787
|
"plans & billing",
|
|
8788
|
-
"insufficient balance"
|
|
8788
|
+
"insufficient balance",
|
|
8789
|
+
// JOHNNESS_PATCH_SUBSCRIPTION_FAILOVER_87: Claude subscription credentials that cannot serve this request.
|
|
8790
|
+
"draw from extra usage",
|
|
8791
|
+
"claude_code_version_too_old",
|
|
8792
|
+
/claude code [0-9.]+ does not support this model/i
|
|
8789
8793
|
],
|
|
8790
8794
|
authPermanent: [
|
|
8791
8795
|
/api[_ ]?key[_ ]?(?:revoked|invalid|deactivated|deleted)/i,
|
|
@@ -8788,7 +8788,11 @@ const ERROR_PATTERNS = {
|
|
|
8788
8788
|
/insufficient[_ ]quota/i,
|
|
8789
8789
|
"credit balance",
|
|
8790
8790
|
"plans & billing",
|
|
8791
|
-
"insufficient balance"
|
|
8791
|
+
"insufficient balance",
|
|
8792
|
+
// JOHNNESS_PATCH_SUBSCRIPTION_FAILOVER_87: Claude subscription credentials that cannot serve this request.
|
|
8793
|
+
"draw from extra usage",
|
|
8794
|
+
"claude_code_version_too_old",
|
|
8795
|
+
/claude code [0-9.]+ does not support this model/i
|
|
8792
8796
|
],
|
|
8793
8797
|
authPermanent: [
|
|
8794
8798
|
/api[_ ]?key[_ ]?(?:revoked|invalid|deactivated|deleted)/i,
|
|
@@ -8782,7 +8782,11 @@ const ERROR_PATTERNS = {
|
|
|
8782
8782
|
/insufficient[_ ]quota/i,
|
|
8783
8783
|
"credit balance",
|
|
8784
8784
|
"plans & billing",
|
|
8785
|
-
"insufficient balance"
|
|
8785
|
+
"insufficient balance",
|
|
8786
|
+
// JOHNNESS_PATCH_SUBSCRIPTION_FAILOVER_87: Claude subscription credentials that cannot serve this request.
|
|
8787
|
+
"draw from extra usage",
|
|
8788
|
+
"claude_code_version_too_old",
|
|
8789
|
+
/claude code [0-9.]+ does not support this model/i
|
|
8786
8790
|
],
|
|
8787
8791
|
authPermanent: [
|
|
8788
8792
|
/api[_ ]?key[_ ]?(?:revoked|invalid|deactivated|deleted)/i,
|
|
@@ -8782,7 +8782,11 @@ const ERROR_PATTERNS = {
|
|
|
8782
8782
|
/insufficient[_ ]quota/i,
|
|
8783
8783
|
"credit balance",
|
|
8784
8784
|
"plans & billing",
|
|
8785
|
-
"insufficient balance"
|
|
8785
|
+
"insufficient balance",
|
|
8786
|
+
// JOHNNESS_PATCH_SUBSCRIPTION_FAILOVER_87: Claude subscription credentials that cannot serve this request.
|
|
8787
|
+
"draw from extra usage",
|
|
8788
|
+
"claude_code_version_too_old",
|
|
8789
|
+
/claude code [0-9.]+ does not support this model/i
|
|
8786
8790
|
],
|
|
8787
8791
|
authPermanent: [
|
|
8788
8792
|
/api[_ ]?key[_ ]?(?:revoked|invalid|deactivated|deleted)/i,
|
|
@@ -8782,7 +8782,11 @@ const ERROR_PATTERNS = {
|
|
|
8782
8782
|
/insufficient[_ ]quota/i,
|
|
8783
8783
|
"credit balance",
|
|
8784
8784
|
"plans & billing",
|
|
8785
|
-
"insufficient balance"
|
|
8785
|
+
"insufficient balance",
|
|
8786
|
+
// JOHNNESS_PATCH_SUBSCRIPTION_FAILOVER_87: Claude subscription credentials that cannot serve this request.
|
|
8787
|
+
"draw from extra usage",
|
|
8788
|
+
"claude_code_version_too_old",
|
|
8789
|
+
/claude code [0-9.]+ does not support this model/i
|
|
8786
8790
|
],
|
|
8787
8791
|
authPermanent: [
|
|
8788
8792
|
/api[_ ]?key[_ ]?(?:revoked|invalid|deactivated|deleted)/i,
|
|
@@ -8782,7 +8782,11 @@ const ERROR_PATTERNS = {
|
|
|
8782
8782
|
/insufficient[_ ]quota/i,
|
|
8783
8783
|
"credit balance",
|
|
8784
8784
|
"plans & billing",
|
|
8785
|
-
"insufficient balance"
|
|
8785
|
+
"insufficient balance",
|
|
8786
|
+
// JOHNNESS_PATCH_SUBSCRIPTION_FAILOVER_87: Claude subscription credentials that cannot serve this request.
|
|
8787
|
+
"draw from extra usage",
|
|
8788
|
+
"claude_code_version_too_old",
|
|
8789
|
+
/claude code [0-9.]+ does not support this model/i
|
|
8786
8790
|
],
|
|
8787
8791
|
authPermanent: [
|
|
8788
8792
|
/api[_ ]?key[_ ]?(?:revoked|invalid|deactivated|deleted)/i,
|
|
@@ -8782,7 +8782,11 @@ const ERROR_PATTERNS = {
|
|
|
8782
8782
|
/insufficient[_ ]quota/i,
|
|
8783
8783
|
"credit balance",
|
|
8784
8784
|
"plans & billing",
|
|
8785
|
-
"insufficient balance"
|
|
8785
|
+
"insufficient balance",
|
|
8786
|
+
// JOHNNESS_PATCH_SUBSCRIPTION_FAILOVER_87: Claude subscription credentials that cannot serve this request.
|
|
8787
|
+
"draw from extra usage",
|
|
8788
|
+
"claude_code_version_too_old",
|
|
8789
|
+
/claude code [0-9.]+ does not support this model/i
|
|
8786
8790
|
],
|
|
8787
8791
|
authPermanent: [
|
|
8788
8792
|
/api[_ ]?key[_ ]?(?:revoked|invalid|deactivated|deleted)/i,
|
|
@@ -8775,7 +8775,11 @@ const ERROR_PATTERNS = {
|
|
|
8775
8775
|
/insufficient[_ ]quota/i,
|
|
8776
8776
|
"credit balance",
|
|
8777
8777
|
"plans & billing",
|
|
8778
|
-
"insufficient balance"
|
|
8778
|
+
"insufficient balance",
|
|
8779
|
+
// JOHNNESS_PATCH_SUBSCRIPTION_FAILOVER_87: Claude subscription credentials that cannot serve this request.
|
|
8780
|
+
"draw from extra usage",
|
|
8781
|
+
"claude_code_version_too_old",
|
|
8782
|
+
/claude code [0-9.]+ does not support this model/i
|
|
8779
8783
|
],
|
|
8780
8784
|
authPermanent: [
|
|
8781
8785
|
/api[_ ]?key[_ ]?(?:revoked|invalid|deactivated|deleted)/i,
|
package/docs/PATCHES.md
CHANGED
|
@@ -112,6 +112,7 @@ Family 01 is retired. Families 02 through 41, 43 through 81, including the 65.1
|
|
|
112
112
|
82. **82, daily model integration:** Claude Sonnet 5.5 (`claude-sonnet-5-5`) registered; `sonnet` moves to it with `sonnet5` kept on Sonnet 5. Since 2026.9.37 every Sonnet runs on its full native 1M window. [Details](#82---sonnet-5-5-2026-09-29)
|
|
113
113
|
|
|
114
114
|
86. **86, named subscription login:** `/login chatgpt` preserves ChatGPT device sign-in; `/login claude` adds current Claude Code OAuth, subscription-first auth, API fallback and credential-specific $0 accounting. [Details](#86---named-subscription-login-2026-10-20)
|
|
115
|
+
87. **87, subscription failover:** current Claude Code user-agent floor (`claude-cli/2.1.304`) for subscription tokens, and Anthropic's extra-usage and version rejections rotate the subscription profile to the paid API key instead of ending the turn. [Details](#87---subscription-failover-2026-10-20)
|
|
115
116
|
|
|
116
117
|
---
|
|
117
118
|
|
|
@@ -2965,3 +2966,19 @@ NO_REPLY, failed sends, block streaming, exact replay, idempotence and drift ref
|
|
|
2965
2966
|
**Replay:** `patches/subscription-login-86/changes.json`, `scripts/patch-subscription-login-86.py` and `scripts/subscription_login_layer.py`. All reviewed hunks preflight before any writes; owned new files are exact pinned content. `--check` is read-only; `--present-only` supports historical fixture subsets. Earlier hash-pinned families strip only reviewed Family 86 hunks and re-layer them after reconstruction. The postinstall vendor overlay copies both the OAuth and Anthropic provider changes to the pinned pi-ai dependency. Historical unified-diff fixture tests reverse this layer explicitly, rather than relaxing equality checks.
|
|
2966
2967
|
|
|
2967
2968
|
**Tests:** `tests/subscription-login.test.mjs`, updated device/registry and postinstall tests, and the full suite. Synthetic tests exercise current endpoints, callback state validation, PKCE, owner/route isolation, atomic storage, locked native refresh persistence, all ten picker copies, error classification and the real SSE adapter's Claude Code envelope with $0 subscription versus paid API usage. A browser smoke reached Claude's account subscription gate using the current URL; that browser was on a different account, and no consent or credential exchange was completed. The owner must finish sign-in to prove their Team entitlement. Rollback: `npm i -g johns-harness@2026.10.16`.
|
|
2969
|
+
|
|
2970
|
+
## 87 - Subscription failover (2026-10-20)
|
|
2971
|
+
|
|
2972
|
+
**Intent:** make the Claude subscription path from Family 86 survive what Anthropic actually returns to a real Team credential, and prove the whole path live.
|
|
2973
|
+
|
|
2974
|
+
**Live proof (john.rood@decision.com, Decision Team, isolated `/tmp` state only):** `johnness login claude --no-browser` on 2026.10.17 produced the authorize URL; the owner's agent completed the hCaptcha, magic link, consent and callback; the harness's `startClaudeLogin`/`saveClaudeCredential` exchanged `code#state` and stored `anthropic:subscription` (mode 0600, refresh present, 8-hour access). Through the harness's own pi-ai Anthropic adapter: Opus 5.5 HTTP 200, streaming, one tool call plus tool-result round trip, `anthropic-ratelimit-unified-5h-status: allowed`, `anthropic-ratelimit-unified-7d-status: allowed`, cost `{0,0,0,0}` on both turns. A forced expiry drove the real resolver through `platform.claude.com/v1/oauth/token` (`refresh_token`, 200), rotated access and refresh, persisted them, and the rotated token answered 200.
|
|
2975
|
+
|
|
2976
|
+
**Fix 1, user-agent floor:** the adapter advertised `claude-cli/2.1.62`. Anthropic returned HTTP 400 `{"error_code":"claude_code_version_too_old"}` "Claude Code 2.1.62 does not support this model; version 2.1.280 or newer is required" for `claude-opus-5-5`. `claude-cli/2.1.304` (npm latest `@anthropic-ai/claude-code` that day) returned 200. The constant is the only change in the adapter; it applies to subscription (`sk-ant-oat`) requests only.
|
|
2977
|
+
|
|
2978
|
+
**Fix 2, failover classification:** with the harness's full system prompt, Anthropic returns HTTP 400 "Third-party apps now draw from extra usage, not plan limits. Ask your workspace admin to add more and keep going." and `anthropic-ratelimit-unified-overage-disabled-reason: org_level_disabled`. A bare Claude Code system prompt on the same token returns 200, so this is Anthropic's third-party classification billed against the organization's Extra usage, which the Decision org has off. The stock classifier mapped that 400 to `format`, so the turn ended with "LLM request rejected" and the API key never ran. The ten compiled `pi-embedded-helpers` copies now list `draw from extra usage`, `claude_code_version_too_old` and `Claude Code <v> does not support this model` under billing patterns. Verified live with the real run loop: subscription 400, profile disabled for the billing backoff (`disabledReason: billing`), API-key 200 with the tool call and reply, subscription attempts recorded at $0 and API turns at normal price. Ordinary 400 shape errors still classify as null.
|
|
2979
|
+
|
|
2980
|
+
**Org setting:** Claude admin settings, billing: turn on Extra usage for the Decision Team organization. Until then every full harness turn falls back to the API key; the subscription credential itself is valid and entitled.
|
|
2981
|
+
|
|
2982
|
+
**Replay:** `patches/subscription-failover-87/changes.json`, `scripts/patch-subscription-failover-87.py` (`--check`, `--present-only`, `--dependency-only`, `--record`). `scripts/subscription_login_layer.py` and `tests/helpers/subscription-login-layer.mjs` strip and re-layer Family 87 together with Family 86 so Families 67, 78, 81 and 82 keep exact replay. Verifier checks 87.1 to 87.4.
|
|
2983
|
+
|
|
2984
|
+
**Tests:** `tests/subscription-failover-87.test.mjs` (manifest coverage, user-agent floor, verbatim-message classification in all ten copies, billing backoff path, idempotent replay and drift refusal, real adapter user-agent and $0 on the extra-usage 400). Full suite 1,192 tests, 1,187 pass, 5 skip. Rollback: `npm i -g johns-harness@2026.10.17`.
|
|
@@ -63,7 +63,8 @@ function getCacheControl(baseUrl, cacheRetention) {
|
|
|
63
63
|
};
|
|
64
64
|
}
|
|
65
65
|
// Stealth mode: Mimic Claude Code's tool naming exactly
|
|
66
|
-
|
|
66
|
+
// JOHNNESS_PATCH_SUBSCRIPTION_FAILOVER_87: Anthropic rejects older Claude Code versions per model (claude_code_version_too_old).
|
|
67
|
+
const claudeCodeVersion = "2.1.304";
|
|
67
68
|
// Claude Code 2.x tool names (canonical casing)
|
|
68
69
|
// Source: https://cchistory.mariozechner.at/data/prompts-2.1.11.md
|
|
69
70
|
// To update: https://github.com/badlogic/cchistory
|
package/package.json
CHANGED
|
@@ -63,7 +63,8 @@ function getCacheControl(baseUrl, cacheRetention) {
|
|
|
63
63
|
};
|
|
64
64
|
}
|
|
65
65
|
// Stealth mode: Mimic Claude Code's tool naming exactly
|
|
66
|
-
|
|
66
|
+
// JOHNNESS_PATCH_SUBSCRIPTION_FAILOVER_87: Anthropic rejects older Claude Code versions per model (claude_code_version_too_old).
|
|
67
|
+
const claudeCodeVersion = "2.1.304";
|
|
67
68
|
// Claude Code 2.x tool names (canonical casing)
|
|
68
69
|
// Source: https://cchistory.mariozechner.at/data/prompts-2.1.11.md
|
|
69
70
|
// To update: https://github.com/badlogic/cchistory
|