mirror of
https://github.com/tiennm99/ccs.git
synced 2026-10-11 03:13:12 +00:00
fix: stop ccsxp model alias parsing at option terminator
This commit is contained in:
1 parent
62a4d44b58
commit
5776e9c3b1
2 files changed
+33
-1
No files matched your search
@@ -143,6 +143,10 @@ function normalizeCcsxpCodexModelFlagAliases(args: string[]): {
|
|||||||
|
|
||||||
for (let index = 0; index < normalizedArgs.length; index += 1) {
|
for (let index = 0; index < normalizedArgs.length; index += 1) {
|
||||||
const arg = normalizedArgs[index];
|
const arg = normalizedArgs[index];
|
||||||
|
if (arg === '--') {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
if (arg === '-m' || arg === '--model') {
|
if (arg === '-m' || arg === '--model') {
|
||||||
const nextValue = normalizedArgs[index + 1];
|
const nextValue = normalizedArgs[index + 1];
|
||||||
if (typeof nextValue === 'string') {
|
if (typeof nextValue === 'string') {
|
||||||
|
|||||||
@@ -848,6 +848,32 @@ process.exit(0);
|
|||||||
]);
|
]);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('preserves ccsxp positional model-like arguments after the option terminator', () => {
|
||||||
|
if (process.platform === 'win32') return;
|
||||||
|
|
||||||
|
const result = runCcsxpAlias(['--', '--', '-m', 'gpt-5.5-high-fast', 'prompt text'], {
|
||||||
|
...process.env,
|
||||||
|
CI: '1',
|
||||||
|
NO_COLOR: '1',
|
||||||
|
HOME: tmpHome,
|
||||||
|
CCS_HOME: tmpHome,
|
||||||
|
CCS_CODEX_PATH: fakeCodexPath,
|
||||||
|
CCS_TEST_CODEX_ARGS_OUT: codexArgsLogPath,
|
||||||
|
CCS_TEST_CODEX_ENV_OUT: codexEnvLogPath,
|
||||||
|
});
|
||||||
|
|
||||||
|
expect(result.status).toBe(0);
|
||||||
|
const codexCalls = readLoggedCodexCalls(codexArgsLogPath);
|
||||||
|
expect(codexCalls.at(-1)).toEqual([
|
||||||
|
'--config',
|
||||||
|
'model_provider="cliproxy"',
|
||||||
|
'--',
|
||||||
|
'-m',
|
||||||
|
'gpt-5.5-high-fast',
|
||||||
|
'prompt text',
|
||||||
|
]);
|
||||||
|
});
|
||||||
|
|
||||||
it('normalizes ccsxp native low Codex tuning aliases in config.toml', () => {
|
it('normalizes ccsxp native low Codex tuning aliases in config.toml', () => {
|
||||||
if (process.platform === 'win32') return;
|
if (process.platform === 'win32') return;
|
||||||
|
|
||||||
@@ -1137,7 +1163,9 @@ supports_websockets = false
|
|||||||
});
|
});
|
||||||
|
|
||||||
expect(result.status).toBe(0);
|
expect(result.status).toBe(0);
|
||||||
expect(result.stderr).not.toContain('Codex CLI does not support Claude account-based profiles.');
|
expect(result.stderr).not.toContain(
|
||||||
|
'Codex CLI does not support Claude account-based profiles.'
|
||||||
|
);
|
||||||
expect(readLoggedCodexCalls(codexArgsLogPath)).toEqual([['fix failing tests']]);
|
expect(readLoggedCodexCalls(codexArgsLogPath)).toEqual([['fix failing tests']]);
|
||||||
expect(readLoggedCodexEnv(codexEnvLogPath)).toEqual([
|
expect(readLoggedCodexEnv(codexEnvLogPath)).toEqual([
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in new issue
Block a user