fix(web): expose Codex Fast and Plan on Create Session (#1017)

* fix(web): expose Codex Fast and Plan on Create Session

Wire serviceTier and collaborationMode through spawn so Create can set
the same Codex options chat Settings already supports (#1015).

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(cli): forward collaborationMode through machine spawn RPC

Create Session Plan was accepted by the hub but dropped in apiMachine
before buildCliArgs; also preserve collaborationMode on resume spawn.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(cli): correct stopSession mock type in spawn RPC test

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(web): keep Fast mode across Create draft restore while models load

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(web): preserve pending Fast selection

* fix: apply Fast and Plan to imported Codex sessions

* test: narrow imported Codex session id

* fix: forward explicit Standard service tier

* fix: integrate create-session controls with current main

* test: close Codex RPC suite

* fix: preserve existing session spawn field

* fix(web): integrate Codex controls with current New Session form

* fix(web): reconcile draft types and submit state

* fix(hub): integrate spawn arguments with current resume flow

* test(cli): isolate spawn RPC suite

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
SSU-WEI HUANG
2026-07-28 12:13:29 +08:00
committed by GitHub
co-authored by Cursor
parent 5396d5f097
commit 07db10f86d
25 changed files with 395 additions and 17 deletions
+25
View File
@@ -84,6 +84,23 @@ describe('buildCliArgs', () => {
expect(args).toContain('fast')
})
it('passes --collaboration-mode through for codex Plan mode', () => {
const args = buildCliArgs('codex', {
directory: '/tmp',
collaborationMode: 'plan',
})
expect(args).toContain('--collaboration-mode')
expect(args).toContain('plan')
})
it('omits --collaboration-mode for default collaboration mode', () => {
const args = buildCliArgs('codex', {
directory: '/tmp',
collaborationMode: 'default',
})
expect(args).not.toContain('--collaboration-mode')
})
it('does not pass --service-tier for non-codex agents', () => {
const args = buildCliArgs('claude', {
directory: '/tmp',
@@ -143,6 +160,14 @@ describe('buildCliArgs', () => {
expect(args).toContain('cursor-csid-1')
})
it('does not pass --collaboration-mode for non-codex agents', () => {
const args = buildCliArgs('claude', {
directory: '/tmp',
collaborationMode: 'plan',
})
expect(args).not.toContain('--collaboration-mode')
})
it('validates all known permission modes', () => {
for (const mode of ['default', 'acceptEdits', 'auto', 'bypassPermissions', 'plan', 'ask', 'debug', 'autoReview', 'read-only', 'safe-yolo', 'yolo']) {
const args = buildCliArgs('claude', {
+3
View File
@@ -1136,6 +1136,9 @@ export function buildCliArgs(
if (options.serviceTier && agent === 'codex') {
args.push('--service-tier', options.serviceTier);
}
if (options.collaborationMode && options.collaborationMode !== 'default' && agent === 'codex') {
args.push('--collaboration-mode', options.collaborationMode);
}
// Pi RPC mode has no permission switching; never pass these flags to it
// (the Pi parser rejects --permission-mode and ignores --yolo).
if (agent !== 'pi') {