Skip to content

fix(t3code): nest the instance home path under config - #2861

Merged
shunkakinoki merged 1 commit into
mainfrom
fix/t3code-instance-homepath
Sep 21, 2026
Merged

shunkakinoki merged 1 commit into
mainfrom
fix/t3code-instance-homepath

Conversation

@shunkakinoki

@shunkakinoki shunkakinoki commented Sep 21, 2026

Copy link
Copy Markdown
Owner

Problem

T3 Code on Kamino workers reports, on every codex-cliproxy turn:

Your access token could not be refreshed. Please log out and sign in again.

Root cause

T3 Code's ProviderInstanceConfig schema is:

{ driver, displayName, accentColor, environment, enabled, config }

There is no top-level homePath. Both drivers read it from the opaque config blob:

  • codex: codexConfig.homePath ? { CODEX_HOME: expandHomePath(codexConfig.homePath) } : {}
  • claude: resolveClaudeHomePath(config) -> CLAUDE_CONFIG_DIR

...and fall back to the login-backed default home when it is empty:

function resolveHomePath(path, value) {
  const expanded = value && value.trim().length > 0 ? expandHomePath(value) : path.join(OS.homedir(), ".codex");
  return path.resolve(expanded);
}

config/t3code/server-settings.json declared homePath at the top level of each
instance. T3 decodes the merged file, drops the unknown key, and rewrites
~/.t3/userdata/settings.json without it. The CLIProxy instance then runs against
~/.codex, whose stale ChatGPT subscription credential cannot be refreshed, and the
seeded ~/.codex-t3/cliproxy/auth.json is never used.

Confirmed on all four Kamino hosts: after T3's rewrite at 07:11 the top-level
homePath was gone from settings.json.

Fix

Move homePath into each instance's config object. The merge in
activate-settings.sh uses jq's recursive *, so nested keys are preserved and
survive T3's schema decode.

Verification

  • shellspec spec/t3code_spec.sh -> 14 examples, 0 failures (2 new).
  • Local simulation: merged settings keep config.homePath for both instances and
    T3's schema strip no longer removes it.
  • Nix eval of homeConfigurations.kamino4...t3codeSettings carries the new template.

The pre-existing 12 failures in spec/t3_connect_spec.sh are unchanged by this
change (identical with the fix stashed).


Summary by cubic

Fixes T3 Code on Kamino workers repeatedly reporting "Your access token could not be refreshed," by moving the instance home path under each instance's config blob.

  • T3 Code's provider schema has no top-level homePath, so T3 dropped the key when rewriting settings and both CLIProxy instances fell back to the login-backed default home (~/.codex), never using the seeded CLIProxy auth credential.
  • Nested inside config, homePath survives T3's decode since the settings merge uses jq's recursive *.
  • Adds two shellspec tests covering the nested config.homePath and the absence of a top-level homePath.

Written for commit 9fba9cd. Summary will update on new commits.

Review in cubic

T3 Code's ProviderInstanceConfig schema has no top-level homePath: the
codex and claude drivers read it from the opaque config blob. Keeping it
at the top level lets T3 drop it on its next settings write, so both
CLIProxy instances fall back to the login-backed default home. Codex then
reports the stale subscription credential as logged out instead of using
the seeded CLIProxy auth record.
@indent

indent Bot commented Sep 21, 2026

Copy link
Copy Markdown

Warning

This organization's free trial has ended, so Indent couldn't start this review. Manage billing to resume reviews on this repository.

@coderabbitai

coderabbitai Bot commented Sep 21, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 8e15bdb5-796b-4aeb-a44a-8720f6830835

📥 Commits

Reviewing files that changed from the base of the PR and between 7a55ad5 and 9fba9cd.

📒 Files selected for processing (2)
  • config/t3code/server-settings.json
  • spec/t3code_spec.sh
 ______________________________________________________________
< Ad Astra Per Codicem Fixis. To the stars through code fixes. >
 --------------------------------------------------------------
  \
   \   (\__/)
       (•ㅅ•)
       /   づ
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@shunkakinoki
shunkakinoki merged commit 50b6f17 into main Sep 21, 2026
23 of 29 checks passed
@shunkakinoki
shunkakinoki deleted the fix/t3code-instance-homepath branch September 21, 2026 06:12
@linear-code

linear-code Bot commented Sep 21, 2026

Copy link
Copy Markdown

SHUN-6148

@pullfrog pullfrog 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.

✅ No new issues found.

Summary

Issue: T3 Code on Kamino workers was repeatedly reporting "Your access token could not be refreshed" during codex-cliproxy turns.

Root Cause: T3 Code's ProviderInstanceConfig schema strips unknown top-level keys when rewriting settings.json. The drivers (codex and claude) read homePath from the opaque config blob. Because homePath was at the top level, T3's decode silently dropped it, causing both CLIProxy instances to fall back to the login-backed default home (~/.codex) and never use the seeded ~/.codex-t3/cliproxy/auth.json credentials.

Fix: Move homePath inside each instance's config object in config/t3code/server-settings.json. The jq merge in activate-settings.sh uses recursive *, preserving nested keys. The drivers then correctly read config.homePath.

Changes:

  • config/t3code/server-settings.json: moves homePath into config for both claude-cliproxy and codex-cliproxy instances
  • spec/t3code_spec.sh: adds 2 tests — one verifying config.homePath carries correct values, one verifying no top-level homePath exists

Verification: Confirmed on all 4 Kamino hosts that the top-level homePath was being stripped by T3, and the fix ensures it survives the merge.

Pullfrog  | View workflow run | Using openrouter/openrouter/free𝕏

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant