Coach: the Codex provider, and a credential that stays out of your backups
The Codex CLI adapter, its runtime and sandbox in the coach image only, and the one placement decision this PR exists to get right. Codex keeps a refreshable sign-in cache of its own rather than taking a token on the environment, so it needs somewhere durable to write. That is ./coach-auth — a sibling of ./data, never a folder inside it, mounted separately, owned by `coach`, mode 0700. The placement is the point. docs/SELF_HOSTING §5 tells owners to back up with `tar czf … data/`, so anything under ./data lands in every archive people are instructed to produce. Workout history belongs there; a live refresh token does not — it keeps working after that archive is copied to a laptop or a cloud drive. Keeping the cache outside ./data is what lets the backup instructions stay true about what they capture, and §5 now says so explicitly rather than leaving the reader to find out. I got to define this rather than fix it: no Codex path was ever committed here, so the nested layout the fork had never reached this repo. A test asserts the sibling relationship directly, because "outside ./data" is the kind of invariant a later refactor breaks by tidying. bubblewrap and the Codex CLI are added in the coach target only — bubblewrap is a Codex requirement, so an owner who never opted in carries neither. The image job now asserts both directions: present and runnable in the coach image (codex-cli 0.147.0, bubblewrap 0.11.2, /coach-auth as coach:0700), and absent from the default one. Codex is usable through the existing connect route with an API key, which needs no new surface. Its ChatGPT device-code sign-in is not in this PR — see the PR description for what that still needs. api 73/73, frontend 404/404, both image targets built and inspected, 11 locales in sync at 767, library in sync at 1324. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
64fd67cfa8
commit
ef61df50f2
9 files changed
+147
-2
No files matched your search
@@ -50,3 +50,21 @@ test('the fixture provider needs no credential and the Claude one names both it
|
||||
assert.equal(cfg.PROVIDERS.claude.apiKeyEnv, 'ANTHROPIC_API_KEY');
|
||||
assert.equal(cfg.PROVIDERS.claude.setupToken, true);
|
||||
});
|
||||
|
||||
test('the Codex credential cache is a sibling of ./data, never inside it', () => {
|
||||
// The documented backup is `tar czf … data/`. A refresh token under ./data would ride along in
|
||||
// every archive an owner is told to make, and keep working wherever that archive is copied.
|
||||
const home = cfg.CREDENTIAL_HOME;
|
||||
assert.ok(home, 'a provider that writes a credential cache needs somewhere to write it');
|
||||
assert.equal(home.startsWith(process.env.DATA_DIR + '/'), false, `${home} is inside ./data`);
|
||||
|
||||
// …and it is actually handed to the runtime, under the variable that provider declares.
|
||||
cfg.reset();
|
||||
cfg.save({ enabled: true, provider: 'codex' });
|
||||
assert.equal(cfg.jobEnv('/tmp/job', { ok: true }).CODEX_HOME, home);
|
||||
|
||||
// A provider with no cache of its own is given no such variable at all.
|
||||
cfg.reset();
|
||||
cfg.save({ enabled: true, provider: 'claude' });
|
||||
assert.equal(cfg.jobEnv('/tmp/job', { ok: true }).CODEX_HOME, undefined);
|
||||
});
|
||||
Reference in new issue
Block a user