mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-11-16 03:09:33 +01:00
feat(codex): let Codex sessions drive other sessions through the codeman skill
Measured on 1.47.0 with the same "spawn a shell worker, echo, read, delete" task: DeepSeek Harness and OpenCode already pass end to end; Codex 0.162 failed three ways, fixed here. - Start Codex 0.162+ with --no-daemon (new noDaemonFlag gate, fail-closed). The shared app-server daemon stopped every launch on an "incompatible feature settings" dialog when another version's daemon was running, and ran commands with another session's CODEMAN_* environment. - Evaluate registry version gates against the gated CLI's own version (resolveSessionCliVersion) instead of claude's for every entry. - Add the opt-in synced setting App Settings > Codex > Allow network access (codexNetworkAccess, default off): --config sandbox_workspace_write.network_access=true, filled as a launch default and clamped off for non-granted owners like the bypass switch. - Skill: carry on with the curl path when `codeman` is not on PATH, re-run a sandbox-blocked call once through the CLI's approval path, name the new setting. Wiki and registry docs updated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
f1f7eec4d6
commit
87c656283d
20 files changed
+284
-34
No files matched your search
@@ -99,7 +99,7 @@ describe('clampExternalCliBypassForOwner — multi-user mode', () => {
|
||||
undefined,
|
||||
{ alwaysApprove: true, model: 'grok-4.5' }
|
||||
);
|
||||
expect(out.codexConfig).toEqual({ dangerouslyBypassApprovals: false, model: 'gpt-5' });
|
||||
expect(out.codexConfig).toEqual({ dangerouslyBypassApprovals: false, networkAccess: false, model: 'gpt-5' });
|
||||
expect(out.antigravityConfig).toEqual({ dangerouslySkipPermissions: false, model: 'gemini-3-pro' });
|
||||
expect(out.grokConfig).toEqual({ alwaysApprove: false, model: 'grok-4.5' });
|
||||
});
|
||||
@@ -134,7 +134,26 @@ describe('clampExternalCliBypassForOwner — multi-user mode', () => {
|
||||
undefined,
|
||||
undefined
|
||||
);
|
||||
expect(out.codexConfig).toEqual({ dangerouslyBypassApprovals: false, reasoningEffort: 'xhigh' });
|
||||
expect(out.codexConfig).toEqual({
|
||||
dangerouslyBypassApprovals: false,
|
||||
networkAccess: false,
|
||||
reasoningEffort: 'xhigh',
|
||||
});
|
||||
});
|
||||
|
||||
it("forces a non-granted owner's codex network access off, as when the launch default filled it", async () => {
|
||||
// applyLaunchDefaults runs BEFORE this clamp, so App Settings → Allow network access
|
||||
// arrives here as an ordinary `networkAccess: true` in a sent config. It widens the
|
||||
// sandbox to every host, so a non-granted owner must not get it.
|
||||
const out = await _clampExternalCliBypassForOwner(
|
||||
'peon',
|
||||
{ networkAccess: true },
|
||||
undefined,
|
||||
undefined,
|
||||
undefined,
|
||||
undefined
|
||||
);
|
||||
expect(out.codexConfig).toEqual({ dangerouslyBypassApprovals: false, networkAccess: false });
|
||||
});
|
||||
|
||||
it('leaves codex/antigravity/grok absent when nothing was sent (they already spawn safe)', async () => {
|
||||
|
||||
@@ -89,6 +89,32 @@ describe('Codex launch defaults', () => {
|
||||
}
|
||||
});
|
||||
|
||||
it('fills Allow network access into every local codex launch, and an explicit value wins', async () => {
|
||||
await writeFile(SETTINGS_PATH, JSON.stringify({ codexNetworkAccess: true }));
|
||||
expect(await resolveCodexDefaults(undefined)).toEqual({ networkAccess: true });
|
||||
expect(buildCodexCommand(await resolveCodexDefaults(undefined))).toBe(
|
||||
'codex --config sandbox_workspace_write.network_access=true'
|
||||
);
|
||||
// The browser sends a codexConfig without the field, so the default still applies.
|
||||
expect(await resolveCodexDefaults({ dangerouslyBypassApprovals: false })).toEqual({
|
||||
dangerouslyBypassApprovals: false,
|
||||
networkAccess: true,
|
||||
});
|
||||
expect(await resolveCodexDefaults({ networkAccess: false })).toEqual({ networkAccess: false });
|
||||
// Off (and a malformed value) fills nothing, so the launch stays byte-identical.
|
||||
for (const value of [false, 'yes']) {
|
||||
await writeFile(SETTINGS_PATH, JSON.stringify({ codexNetworkAccess: value }));
|
||||
expect(await resolveCodexDefaults(undefined)).toBeUndefined();
|
||||
}
|
||||
});
|
||||
|
||||
for (const url of ['/api/sessions', '/api/quick-start']) {
|
||||
it(`records Allow network access on a codex session created at ${url}`, async () => {
|
||||
await writeFile(SETTINGS_PATH, JSON.stringify({ codexNetworkAccess: true }));
|
||||
expect(await createdConfig(url)).toMatchObject({ networkAccess: true });
|
||||
});
|
||||
}
|
||||
|
||||
it('keeps defaults out of custom endpoint launches', async () => {
|
||||
const config = { model: 'local-model', animations: false };
|
||||
expect(await resolveCodexDefaults(config, true)).toBe(config);
|
||||
@@ -100,6 +126,7 @@ describe('Codex launch defaults', () => {
|
||||
expect(getCli('codex')!.capabilities.launchDefaults).toEqual({
|
||||
model: 'codexModel',
|
||||
reasoningEffort: 'codexReasoningEffort',
|
||||
networkAccess: 'codexNetworkAccess',
|
||||
});
|
||||
for (const entry of STOCK_CLIS) {
|
||||
if ((entry.id as string) === 'codex') continue;
|
||||
|
||||
Reference in new issue
Block a user