mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-10-08 16:39:42 +02:00
test(codex): pin reasoning effort through quick-start and the multi-user clamp
Both create schemas now refuse an unknown level, and a non-granted owner's codexConfig keeps its reasoningEffort when the clamp forces bypass off. docs/architecture-invariants.md lists the two --config values codex now takes from codexConfig. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
45db24bacf
commit
0ae39cdd94
File diff suppressed because one or more lines are too long
@@ -28,11 +28,14 @@ describe('codexConfig.reasoningEffort', () => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
it('rejects a level codex does not know, and anything shaped like shell', () => {
|
it('rejects a level codex does not know, and anything shaped like shell, on both create routes', () => {
|
||||||
for (const reasoningEffort of ['bogus', 'HIGH', 'high; rm -rf /', '']) {
|
for (const reasoningEffort of ['bogus', 'HIGH', 'high; rm -rf /', '']) {
|
||||||
expect(() =>
|
expect(() =>
|
||||||
CreateSessionSchema.parse({ workingDir: '/tmp', mode: 'codex', codexConfig: { reasoningEffort } })
|
CreateSessionSchema.parse({ workingDir: '/tmp', mode: 'codex', codexConfig: { reasoningEffort } })
|
||||||
).toThrow();
|
).toThrow();
|
||||||
|
expect(() =>
|
||||||
|
QuickStartSchema.parse({ caseName: 'work', mode: 'codex', codexConfig: { reasoningEffort } })
|
||||||
|
).toThrow();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -104,6 +104,20 @@ describe('clampExternalCliBypassForOwner — multi-user mode', () => {
|
|||||||
expect(out.grokConfig).toEqual({ alwaysApprove: false, model: 'grok-4.5' });
|
expect(out.grokConfig).toEqual({ alwaysApprove: false, model: 'grok-4.5' });
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("keeps a non-granted owner's codex reasoning effort while forcing bypass off", async () => {
|
||||||
|
// The clamp rewrites one field and must carry the rest; a clamp rebuilt from named
|
||||||
|
// fields would drop the effort here without a word.
|
||||||
|
const out = await _clampExternalCliBypassForOwner(
|
||||||
|
'peon',
|
||||||
|
{ dangerouslyBypassApprovals: true, reasoningEffort: 'xhigh' },
|
||||||
|
undefined,
|
||||||
|
undefined,
|
||||||
|
undefined,
|
||||||
|
undefined
|
||||||
|
);
|
||||||
|
expect(out.codexConfig).toEqual({ dangerouslyBypassApprovals: false, reasoningEffort: 'xhigh' });
|
||||||
|
});
|
||||||
|
|
||||||
it('leaves codex/antigravity/grok absent when nothing was sent (they already spawn safe)', async () => {
|
it('leaves codex/antigravity/grok absent when nothing was sent (they already spawn safe)', async () => {
|
||||||
const out = await _clampExternalCliBypassForOwner('peon', undefined, undefined, undefined, undefined, undefined);
|
const out = await _clampExternalCliBypassForOwner('peon', undefined, undefined, undefined, undefined, undefined);
|
||||||
expect(out.codexConfig).toBeUndefined();
|
expect(out.codexConfig).toBeUndefined();
|
||||||
|
|||||||
Reference in New Issue
Block a user