Skip to content

Commit c438462

Browse files
committed
Pin the D2 Codex state path
1 parent aa1bdbc commit c438462

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

‎agents/container/run.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,9 @@ export function validateContainer(container: string, profile: ContainerProfile,
203203
|| environment.get('npm_config_cache') !== '/tmp/npm-cache'
204204
|| environment.get('XDG_CACHE_HOME') !== '/tmp/xdg-cache')
205205
throw new Error('Container isolation environment changed.');
206-
if (profile.vendor === 'codex' && names.includes('CLAUDE_CODE_OAUTH_TOKEN')) throw new Error('Credential profiles must not be combined.');
206+
if (profile.vendor === 'codex' && (names.includes('CLAUDE_CODE_OAUTH_TOKEN')
207+
|| environment.get('CODEX_HOME') !== '/run/codeboost-auth/codex'))
208+
throw new Error('Credential profiles must not be combined or redirected.');
207209
if (profile.vendor === 'claude' && (names.includes('CODEX_HOME') || !names.includes('CLAUDE_CODE_OAUTH_TOKEN')))
208210
throw new Error('Credential profiles must not be combined.');
209211
assertContainerProfile(profile);

‎test/agent-container.test.ts‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -217,10 +217,10 @@ describe('real Docker agent isolation', () => {
217217
expect(() => validateContainer(valid.name, valid)).toThrow(/environment|PATH/);
218218
docker('rm', '--force', valid.name); containers.delete(valid.name);
219219

220-
for (const changedCache of ['npm_config_cache=/work/npm-cache', 'XDG_CACHE_HOME=/work/xdg-cache']) {
221-
const cacheArgs = [...valid.args.slice(0, imageIndex), '--env', changedCache, ...valid.args.slice(imageIndex)];
222-
docker(...cacheArgs); containers.add(valid.name);
223-
expect(() => validateContainer(valid.name, valid)).toThrow('isolation environment');
220+
for (const changedPath of ['npm_config_cache=/work/npm-cache', 'XDG_CACHE_HOME=/work/xdg-cache', 'CODEX_HOME=/work']) {
221+
const changedArgs = [...valid.args.slice(0, imageIndex), '--env', changedPath, ...valid.args.slice(imageIndex)];
222+
docker(...changedArgs); containers.add(valid.name);
223+
expect(() => validateContainer(valid.name, valid)).toThrow(/isolation environment|Credential profiles/);
224224
docker('rm', '--force', valid.name); containers.delete(valid.name);
225225
}
226226
}, 60_000);

0 commit comments

Comments
 (0)