Skip to content

fix(server): API-key Claude instances can spend subscriber API credits - #29406

Open
kyle944 wants to merge 22 commits into
pingdotgg:mainfrom
kyle944:fix/claude-api-key-entrypoint
Open

kyle944 wants to merge 22 commits into
pingdotgg:mainfrom
kyle944:fix/claude-api-key-entrypoint

Conversation

@kyle944

@kyle944 kyle944 commented Nov 2, 2026 •

Copy link
Copy Markdown

Problem

Since #28410, every Claude process T3 Code starts is labeled CLAUDE_CODE_ENTRYPOINT=t3-code. On a Console organization that holds only the included API credits for subscribers, Anthropic answers that label with Credit balance is too low, so an API-key Claude instance fails every turn while the balance is available. T3 Code runs through the Agent SDK, which those credits cover.

Fixes #29393

Change

A Claude process that authenticates with an API key now leaves the entrypoint unset, so the Agent SDK applies its own sdk-ts, and text generation through claude -p gets sdk-cli.

The label is chosen when each process starts, from the settings that process will load:

  • resolveClaudeSessionEnvironment runs for turns in ClaudeAdapterV2 and for commands in ClaudeTextGeneration, using their working directory. Before this, the label was chosen once, when the adapter was created.
  • Those two paths start from mergeClaudeBaseEnvironment, which holds only a label the instance configured, so removing a label from settings takes effect on the next session.
  • readClaudeSessionSettingsEnv reads settings in Claude's order: user, project, local, --settings, then managed. Files are read each time, so a new session sees edits.
  • --project-config-root moves project and local settings to that directory, as in Claude Code.
  • Settings left out by --setting-sources do not change the label. --settings and managed settings always apply. Root local settings apply only when the current user owns the root, .git and .claude, as in the Agent SDK. Tool search shares that lookup.
  • Managed settings now match the Agent SDK: managed-settings.json, then sorted managed-settings.d/*.json, skipping hidden files. On Windows the directory is C:\Program Files\ClaudeCode, not PROGRAMDATA. This Windows path also applies to the existing skill settings reader.
  • An empty ANTHROPIC_API_KEY in a higher layer counts as no key, because Claude's settings env beats the process env.
  • A wrongly typed value in a settings file no longer hides the other values in that file.
  • On Windows, all inherited names are upper-cased in the base environment, as instance variables already are, because a copy of process.env loses the case-insensitive lookup. This also lets T3 Code find CLAUDE_CONFIG_DIR however Windows spells it. Code in this repository that reads PATH accepts the upper-case name.
  • This reader now parses strict JSON, because Claude Code skips a settings file with comments or trailing commas. It also serves ANTHROPIC_BASE_URL, which follows the same rule.
  • The local settings lookup moves from ClaudeAdapterV2 to ClaudeSkills so both paths share it, with no change in behavior.

Nothing changes for subscription logins, which keep t3-code. A configured label from the instance or from settings still wins, and an inherited host value is still dropped, as #28410 intended.

The cost is that API-key requests no longer carry the t3-code label.

Scope and approval

There is no maintainer approval to link, and #29393 has not been triaged yet. This began under the small bug fix exception as one condition in one function. It grew when CodeRabbit showed that a key in project or local settings, or in --settings, would still fail, so it may now need a maintainer's view of scope. All of it serves the one problem in #29393. It keeps the t3-code default for subscription logins, which #28410 and #25597 were about.

This does not cover keys from apiKeyHelper or a Console /login, because they are not in the environment or the settings env. They keep today's behavior. Capability probes keep the label chosen at startup, because their never-yielding prompt sends no model request, according to the comment on probeClaudeCapabilities.

Verification

The problem, on one organization holding only these credits, with Claude Code 2.1.316 and desktop 0.1.7-nightly.20261102.4080:

Path Entrypoint Result
T3 Code, API-key instance t3-code (default), Haiku 5.5 and Opus 5.5 Credit balance is too low
T3 Code, same instance and key sdk-ts set in the instance environment, Haiku 5.5 and Opus 5.5 Worked, and the credit balance went down
claude -p with an API key t3-code Credit balance is too low
claude -p with an API key sdk-cli, or unset Worked

The Agent SDK 0.3.276 source sets sdk-ts only when the variable is unset, so the T3 Code row with sdk-ts is the value this change produces for turns.

An empty key in settings beats the process env, checked with Claude Code 2.1.316: with an invalid ANTHROPIC_API_KEY in the environment, claude -p returned 401 Invalid API key, and with --settings '{"env":{"ANTHROPIC_API_KEY":""}}' added, it succeeded on the subscription login.

Claude Code 2.1.316 also skips a non-strict settings file: with an invalid key in project settings, valid JSON returned 401 Invalid API key, while the same file with a line comment or a trailing comma succeeded on the subscription login.

Claude Code 2.1.316 also ignores project settings under --setting-sources user: an invalid key in the project file returned 401 Invalid API key with --setting-sources project, and authenticated normally with --setting-sources user.

The fix, from a checkout on macOS, with a failing test committed before each fix:

Test commit Fails with Fix commit
5d3e4f0 expected { …(3) } to deeply equal { ANTHROPIC_API_KEY: 'key', KEEP: '1' } 9613eff
fbe6dda expected undefined to be 't3-code' 8a89037
069304e Adapter: expected 't3-code' to equal undefined. Text generation: CLAUDE_CODE_ENTRYPOINT was unset. cddc8c7
66118e3 mergeClaudeBaseEnvironment missing (TypeError) bb5068f
6934847 expected undefined to be 't3-code' 307bcb5
d8d4f9a expected { Anthropic_Api_Key: 'key', …(1) } to deeply equal { ANTHROPIC_API_KEY: 'key' } 339b177
eda0e6c expected { Claude_Config_Dir: 'config', …(2) } to deeply equal { ANTHROPIC_API_KEY: 'key', …(2) } f69ac89
a1dedaa expected 't3-code' to be undefined 5d02ac7
ed320ef expected undefined to be 't3-code' and expected 't3-code' to be undefined 2e5ae7b
e330887 expected undefined to equal 't3-code' 562c2c7

On 562c2c7, with main synced by the merge in 9d37d87:

  • vp run check:changed passes: format, lint, knip, graphql, typecheck, and the 5 test files beside the change, 346 tests, which include ClaudeAdapterV2.test.ts.
  • vp test run apps/server/src/provider/ProviderRegistry.test.ts passes, 50 of 50, because the same reader serves ANTHROPIC_BASE_URL.
  • Those results used a resolved TMPDIR. With the default macOS TMPDIR, ClaudeSkills.test.ts > merges plugin enablement and selects installs in native registry order fails. It also fails on unmodified main (ac8dce0), so it is not related to this change.

I could not check:

  • This build running end to end. I tested the resulting label through the released desktop app, not a dev build of this branch.
  • A key in project or local settings against the real API. Those cases are covered by unit tests only.
    The Agent SDK types say that omitting settingSources loads all sources, and the adapter omits it, so a session does load those files.
  • Real managed settings files, or MDM, registry and server-managed sources. The tests use a fake filesystem for the fixed managed paths.
  • Skill settings still read managed-settings.json without drop-ins, as before this PR.
  • A real Windows machine. The Windows name matching is tested with a simulated platform.
  • The ClaudeDriver line that passes the base environment to text generation. The tests cover the functions on each side of it, but not that call.
  • An organization that also has purchased credits, or one on a different plan.
  • How Anthropic classifies entrypoints. I only observed that the result follows the label.

visible: yes

Model: Claude Opus 5.5 · Harness: Claude Code in T3 Code

🤖 Generated with Claude Code

kyle944 and others added 2 commits November 2, 2026 09:21
Fails on main: mergeClaudeProcessEnvironment labels every Claude process
t3-code, and that label makes Anthropic refuse subscriber API credits.

Refs pingdotgg#29393

Model: Claude Opus 5.5 · Harness: Claude Code in T3 Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Since pingdotgg#28410 every Claude process is labeled t3-code. Anthropic answers that
label with "Credit balance is too low" on an organization holding only
subscriber API credits, although those credits cover the Agent SDK. Leave the
entrypoint unset when the process authenticates with ANTHROPIC_API_KEY, so the
Agent SDK applies sdk-ts. Subscription logins keep t3-code, and explicit
overrides still win.

Fixes pingdotgg#29393

Model: Claude Opus 5.5 · Harness: Claude Code in T3 Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-11-02T15:29:29.021729Z
We couldn’t complete this review. Comment @codex review to try again.
9613eff PR opened
🔒 Security Review ⚠️ Failed 2026-11-02T15:29:34.905450Z
We couldn’t complete this review. Comment @codex security review to try again.
9613eff PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@chatgpt-codex-connector

Copy link
Copy Markdown

The account paying for this security review has reached its Codex usage limits. The payer can check the Codex usage dashboard. For personal accounts, using credits requires enabling “Use credits for security reviews” in Code review settings. If you do not manage the paying account, contact this repository's admins.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Nov 2, 2026
@macroscopeapp

macroscopeapp Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Needs Human Approval

Macroscope's review found this PR requires human approval — API-key Claude instances now default to the Agent SDK entrypoint, enabling subscriber API-credit usage while retaining explicit overrides. Human review is required to confirm this change to default credit-consumption behavior.

You can add or adjust custom eligibility rules. Learn more.

@coderabbitai

coderabbitai Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • Resume reviews
  • Trigger review
Walkthrough

Claude environment resolution now reads API keys and entrypoint values from settings and launch arguments. Provider, adapter, and text-generation paths use resolved environments. Tests cover entrypoint selection and environment-source precedence.

Changes: Claude session environment

Layer / File(s) Summary
Settings loading and entrypoint selection
apps/server/src/provider/Drivers/ClaudeSkills.ts, apps/server/src/provider/Drivers/ClaudeHome.ts, apps/server/src/provider/Drivers/ClaudeHome.test.ts
Settings loading accepts supported string values, including ANTHROPIC_API_KEY, from user, project, local, worktree, launch-argument, and managed sources. Environment merging selects the entrypoint based on settings, the current environment, and API-key presence. Tests cover source precedence and entrypoint behavior.
Base environment construction
apps/server/src/provider/Drivers/ClaudeDriver.ts, apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.ts
Provider and adapter setup uses a base environment that removes inherited entrypoint and Claude host-session variables before merging instance settings.
Session environment integration
apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.ts, apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.test.ts, apps/server/src/textGeneration/ClaudeTextGeneration.ts, apps/server/src/textGeneration/ClaudeTextGeneration.test.ts, apps/server/src/textGeneration/testing/ClaudeTextGeneration.fixture.mjs
The adapter and text-generation paths use resolved session environments when launching Claude. The adapter uses the shared local-settings-directory resolver for tool-search settings. Tests and the fixture check expected entrypoint values.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix · Severity of issue fixed: Medium

Sequence Diagram(s)

sequenceDiagram
  participant ClaudeAdapterV2
  participant resolveClaudeSessionEnvironment
  participant readClaudeSessionSettingsEnv
  participant ClaudeProcess
  ClaudeAdapterV2->>resolveClaudeSessionEnvironment: Claude settings, environment, cwd, and launch arguments
  resolveClaudeSessionEnvironment->>readClaudeSessionSettingsEnv: load session settings
  readClaudeSessionSettingsEnv-->>resolveClaudeSessionEnvironment: merged settings environment
  resolveClaudeSessionEnvironment-->>ClaudeAdapterV2: resolved process environment
  ClaudeAdapterV2->>ClaudeProcess: launch with resolved environment
Loading

Suggested reviewers: t3dotgg, maria-rcks

Merge Risk: Low · up to 339b1

On Windows, a host that spells the Claude config directory variable in mixed case can still hit the low-credit error for API-key instances. This is a narrow edge case, and adding the variable to the canonicalized set fixes it. The rest of the change is low risk.

Pre-merge checks: Passed 4
Check name Status Explanation
Title check Passed The title clearly identifies the main change: enabling API-key Claude instances to use subscriber API credits. It is concise, specific, and follows the repository's conventional commit format.
Linked Issues check Passed Issue #29393 requires API-key Claude instances to run with included subscriber API credits. mergeClaudeBaseEnvironment removes inherited CLAUDE_CODE_ENTRYPOINT, and `resolveClaudeSessionEnvironmen…
Out of Scope Changes check Passed The changes remain within issue #29393. Settings-file resolution extends the same API-key decision to user, project, local, launch, and managed settings. Per-session resolution is required because set…
Description check Passed The description follows the template's Problem, Change, Scope and approval, and Verification sections, and it is detailed. It states the bug, links #29393, and explains the behavior change for API-key…
Full details: Linked Issues check

Explanation

Issue #29393 requires API-key Claude instances to run with included subscriber API credits. mergeClaudeBaseEnvironment removes inherited CLAUDE_CODE_ENTRYPOINT, and resolveClaudeSessionEnvironment leaves it unset when the effective API key comes from the instance or Claude settings. ClaudeAdapterV2 and ClaudeTextGeneration use this per-session environment. Subscription logins retain t3-code. Tests cover API-key sources, settings precedence, Windows name matching, adapter turns, and text generation. These changes implement the issue requirement and add automated coverage.

Full details: Out of Scope Changes check

Explanation

The changes remain within issue #29393. Settings-file resolution extends the same API-key decision to user, project, local, launch, and managed settings. Per-session resolution is required because settings depend on the working directory and launch arguments. Shared local-settings resolution supports both affected execution paths. Strict parsing, precedence handling, Windows case matching, base-environment cleanup, and tests support the entrypoint fix. No unrelated change is demonstrated.

Full details: Description check

Explanation

The description follows the template's Problem, Change, Scope and approval, and Verification sections, and it is detailed. It states the bug, links #29393, and explains the behavior change for API-key and subscription logins. It also gives a thorough verification record with test commits, command results, and a clear list of what was not checked. The Scope and approval section does not link a maintainer approval. The author says the issue is untriaged and that the change grew past the small-fix exception, so the scope question is openly raised. The template requires either an approval link or an explicit justification for the small-fix exception. The author gives a partial justification, but the scope is larger than a one-line fix, so this section is incomplete. The template also asks for the model and harness, and the description includes them. Overall the description is mostly complete, with one required section only partly met.

Finishing Touches
Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Tip

🎯 Customize your risk assessments

Guide how CodeRabbit assesses merge risk and security architecture risk. Highlight sensitive changes and explain your security boundaries using Merge Risk Instructions and Security Risk Instructions in your review settings. Security architecture risk assessments require the Advanced plan or above.

✅ Automatic approvals, with your rules

Let CodeRabbit approve pull requests once required threads are resolved, pre-merge checks pass, and your risk limits are met. Enable Automatic approvals in review settings, with overrides for teams or file paths.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 307bcb5 and 339b177.

Files selected for processing: 3
  • apps/server/src/provider/Drivers/ClaudeHome.test.ts
  • apps/server/src/provider/Drivers/ClaudeHome.ts
  • apps/server/src/textGeneration/ClaudeTextGeneration.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.

@coderabbitai coderabbitai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Fix comments: Fix CodeRabbit comments on this PR

kyle944 and others added 4 commits November 2, 2026 09:41
…abel

Claude's settings env beats the process env, so an empty key there means the
session uses the subscription login.

Refs pingdotgg#29393

Model: Claude Opus 5.5 · Harness: Claude Code in T3 Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude's settings env beats the process env, so a session whose settings empty
ANTHROPIC_API_KEY uses the subscription login and keeps the t3-code label.
Found by CodeRabbit on pingdotgg#29406, confirmed with Claude Code 2.1.316.

Refs pingdotgg#29393

Model: Claude Opus 5.5 · Harness: Claude Code in T3 Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Fails before the fix: an API key in project or local settings, or in --settings,
is not seen, so the session keeps t3-code and can hit "Credit balance is too low".
Reported by CodeRabbit on pingdotgg#29406.

Refs pingdotgg#29393

Model: Claude Opus 5.5 · Harness: Claude Code in T3 Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The label was chosen once when the adapter was created, from user and managed
settings. An API key in project or local settings or in --settings was missed,
so that session kept t3-code and could hit "Credit balance is too low". Turns
and text generation now resolve it at process start, in Claude's own order:
user, project, local, --settings, then managed. Files are read each time, so a
new session sees edits. A wrongly typed value no longer hides the rest of a
file. The local settings lookup moves to ClaudeSkills so both paths share it.
Reported by CodeRabbit on pingdotgg#29406.

Refs pingdotgg#29393

Model: Claude Opus 5.5 · Harness: Claude Code in T3 Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added size:L 100-499 changed lines (additions + deletions). and removed size:S 10-29 changed lines (additions + deletions). labels Nov 2, 2026
kyle944 and others added 2 commits November 2, 2026 09:56
Fails before the fix: a label read from settings at startup stays after it is
removed, and an instance that configures t3-code loses it when a key is present.
Found by an independent review of pingdotgg#29406.

Refs pingdotgg#29393

Model: Claude Opus 5.5 · Harness: Claude Code in T3 Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Turns and text generation now start from an env holding only the label an
instance configured, and add the default when each process starts. Removing a
label from settings takes effect on the next session, and an instance that
configures t3-code keeps it. Capability probes still use the startup label.

Refs pingdotgg#29393

Model: Claude Opus 5.5 · Harness: Claude Code in T3 Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@coderabbitai coderabbitai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Fix comments: Fix CodeRabbit comments on this PR

kyle944 and others added 2 commits November 2, 2026 10:02
… label

Fails before the fix: T3 Code reads a key from a settings file with a comment or
a trailing comma, while Claude Code skips that file and uses the subscription.
Reported by CodeRabbit on pingdotgg#29406.

Refs pingdotgg#29393

Model: Claude Opus 5.5 · Harness: Claude Code in T3 Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude Code skips a settings file with comments or trailing commas, confirmed
with Claude Code 2.1.316, so its key must not remove the t3-code label. This
reader also serves ANTHROPIC_BASE_URL, which now follows the same rule.
Reported by CodeRabbit on pingdotgg#29406.

Refs pingdotgg#29393

Model: Claude Opus 5.5 · Harness: Claude Code in T3 Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@coderabbitai coderabbitai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Fix comments: Fix CodeRabbit comments on this PR

kyle944 and others added 2 commits November 2, 2026 10:19
Fails before the fix: on Windows a host Anthropic_Api_Key reaches Claude, but the
copied environment does not match ANTHROPIC_API_KEY, so the process keeps t3-code.
The text generation test also stops depending on the runner's key.
Reported by CodeRabbit on pingdotgg#29406.

Refs pingdotgg#29393

Model: Claude Opus 5.5 · Harness: Claude Code in T3 Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On Windows, Node's process.env ignores case, but a copy of it does not. A host
Anthropic_Api_Key reached Claude while T3 Code missed it and kept t3-code, and a
differently cased inherited label or session variable was not dropped.
Reported by CodeRabbit on pingdotgg#29406.

Refs pingdotgg#29393

Model: Claude Opus 5.5 · Harness: Claude Code in T3 Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@coderabbitai coderabbitai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Fix comments: Fix CodeRabbit comments on this PR

kyle944 and others added 4 commits November 2, 2026 10:29
Fails before the fix: a host Claude_Config_Dir or ProgramData keeps its spelling,
so T3 Code reads the wrong settings while Claude receives the configured value.
Reported by CodeRabbit on pingdotgg#29406.

Refs pingdotgg#29393

Model: Claude Opus 5.5 · Harness: Claude Code in T3 Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Matching a fixed list missed Claude_Config_Dir, so T3 Code read the default
settings while Claude used the configured directory, and ProgramData, which hid
managed settings. Instance variables are already upper-cased on Windows.
Reported by CodeRabbit on pingdotgg#29406.

Refs pingdotgg#29393

Model: Claude Opus 5.5 · Harness: Claude Code in T3 Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@maria-rcks

maria-rcks commented Nov 4, 2026 •

Copy link
Copy Markdown
Collaborator

Note

Written by gpt-6.1-sol on behalf of Maria

Verified in a real dev environment

verified the launch behavior as-is at e9f63e5134086ad35ef703d2bf54e4b267f60dfd on a linux boat vm. no code changes or pushes were needed.

used separate main and pr checkouts, installed dependencies with vp i, and ran one background dev server at a time with isolated state. drove the actual web client using the repo's playwright and /usr/bin/google-chrome. created a project pointing at a real git repo through the app. all provider turns below used the real local proxy, with no mocks or replay provider.

  • on github/main (3368dd70f2), an api-key claude haiku 5.5 turn running printenv CLAUDE_CODE_ENTRYPOINT returned t3-code.
  • the same prompt on the pr returned sdk-ts. inspecting only that variable in the real claude child's process environment confirmed both values.
  • an explicit instance override of t3-code remained effective with the api key.
  • codex gpt-6.1-sol created real .claude/settings.local.json through the app. after removing the instance api key, a fresh claude session still completed with sdk-ts, without restarting the server.
  • creating a new worktree through the app generated branch t3/check-claude-entrypoint through claude text generation. its cli child launched with the entrypoint unset. the real claude turn in that worktree also returned sdk-ts.
  • with the api key restored on the instance, claude title generation succeeded. codex gpt-6.1-sol completed web turns on both main and the pr, returning the requested CODEX_MAIN_OK and CODEX_PR_OK responses.
  • 395 tests passed through blacksmith in the five focused files: ClaudeHome, ClaudeSkills, ClaudeTextGeneration, ProviderRegistry, and ClaudeAdapterV2. ci reports 29 successful contexts, none pending or failing.

before, main with the api-key instance:

main claude api-key turn reports t3-code

after, the same prompt on the pr:

pr claude api-key turn reports sdk-ts

recorded follow-up turn through the real claude provider:

claude follow-up runs printenv and returns sdk-ts

short runtime transcript

the uploaded screenshots were inspected, and the uploaded 10.8-second video played to completion and supported seeking in t3's browser.

Not verified

actual subscriber-credit spending and the original Credit balance is too low response remain unverified. the proxy can run real claude turns but does not expose an anthropic console organization holding only subscriber api credits. the before/after proves the process-label change, not anthropic's billing decision.

native subscription login, windows environment-name handling, macos/electron shell behavior, native ios/android clients, managed settings, and direct remote/relay/tunnel connections were not exercised. haiku 4.5's short model alias was rejected by the proxy; the successful claude app checks used supported haiku 5.5.

kyle944 and others added 6 commits November 4, 2026 02:27
Fails before the fix: a key only in managed-settings.d is not seen, so the
session keeps t3-code. Windows also looked in PROGRAMDATA, while Claude Code reads
C:\Program Files\ClaudeCode. Found by a Codex review of pingdotgg#29406.

Refs pingdotgg#29393

Model: Claude Opus 5.5 · Harness: Claude Code in T3 Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude Code applies managed-settings.json and then sorted managed-settings.d/*.json,
skipping hidden files, as ClaudeMaintenance already does. A key only in a drop-in
was missed, so the session kept t3-code. The Windows managed directory is now
C:\Program Files\ClaudeCode, as in the Agent SDK, instead of PROGRAMDATA.
Found by a Codex review of pingdotgg#29406.

Refs pingdotgg#29393

Model: Claude Opus 5.5 · Harness: Claude Code in T3 Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Fails before the fix: settings left out by --setting-sources still change the
label, and root local settings count in a checkout another user owns.
Found by a Codex review of pingdotgg#29406.

Refs pingdotgg#29393

Model: Claude Opus 5.5 · Harness: Claude Code in T3 Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Settings left out by --setting-sources no longer change the label, confirmed with
Claude Code 2.1.316. Root local settings now apply only when the current user
owns the root, .git and .claude, matching the Agent SDK. Tool search uses the same
lookup. Found by a Codex review of pingdotgg#29406.

Refs pingdotgg#29393

Model: Claude Opus 5.5 · Harness: Claude Code in T3 Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Fails before the fix: a key under the configured root is missed, and the working
directory's settings still count. Found by a Codex review of pingdotgg#29406.

Refs pingdotgg#29393

Model: Claude Opus 5.5 · Harness: Claude Code in T3 Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude Code loads project and local settings from that directory, confirmed with
Claude Code 2.1.316, and T3 Code forwards the flag from launch arguments. The
lookup now follows it, and resolves a relative root from the working directory.
Found by a Codex review of pingdotgg#29406.

Refs pingdotgg#29393

Model: Claude Opus 5.5 · Harness: Claude Code in T3 Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: API-key Claude instances fail with "Credit balance is too low" on subscriber API credits since the t3-code entrypoint

2 participants